webitel-sdk 23.9.7 → 23.9.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/bundles/index.esm.js +131 -1
  2. package/bundles/index.esm.js.map +1 -1
  3. package/bundles/index.esm.min.js +1 -1
  4. package/bundles/index.esm.min.js.map +1 -1
  5. package/bundles/index.umd.js +126 -0
  6. package/bundles/index.umd.js.map +1 -1
  7. package/bundles/index.umd.min.js +1 -1
  8. package/bundles/index.umd.min.js.map +1 -1
  9. package/esm2015/api/engine-available-system-setting.js +13 -0
  10. package/esm2015/api/engine-available-system-setting.js.map +1 -0
  11. package/esm2015/api/engine-list-available-system-setting.js +13 -0
  12. package/esm2015/api/engine-list-available-system-setting.js.map +1 -0
  13. package/esm2015/api/engine-system-setting-name.js +24 -0
  14. package/esm2015/api/engine-system-setting-name.js.map +1 -0
  15. package/esm2015/api/index.js +3 -0
  16. package/esm2015/api/index.js.map +1 -1
  17. package/esm2015/api/system-setting-service-api.js +80 -0
  18. package/esm2015/api/system-setting-service-api.js.map +1 -1
  19. package/esm5/api/engine-available-system-setting.js +13 -0
  20. package/esm5/api/engine-available-system-setting.js.map +1 -0
  21. package/esm5/api/engine-list-available-system-setting.js +13 -0
  22. package/esm5/api/engine-list-available-system-setting.js.map +1 -0
  23. package/esm5/api/engine-system-setting-name.js +24 -0
  24. package/esm5/api/engine-system-setting-name.js.map +1 -0
  25. package/esm5/api/index.js +3 -0
  26. package/esm5/api/index.js.map +1 -1
  27. package/esm5/api/system-setting-service-api.js +93 -0
  28. package/esm5/api/system-setting-service-api.js.map +1 -1
  29. package/package.json +1 -1
  30. package/types/api/engine-attempt-callback-request.d.ts +6 -0
  31. package/types/api/engine-attempt-callback-request.d.ts.map +1 -1
  32. package/types/api/engine-attempt-result-request.d.ts +6 -0
  33. package/types/api/engine-attempt-result-request.d.ts.map +1 -1
  34. package/types/api/engine-available-system-setting.d.ts +25 -0
  35. package/types/api/engine-available-system-setting.d.ts.map +1 -0
  36. package/types/api/engine-create-system-setting-request.d.ts +3 -2
  37. package/types/api/engine-create-system-setting-request.d.ts.map +1 -1
  38. package/types/api/engine-list-available-system-setting.d.ts +32 -0
  39. package/types/api/engine-list-available-system-setting.d.ts.map +1 -0
  40. package/types/api/engine-system-setting-name.d.ts +22 -0
  41. package/types/api/engine-system-setting-name.d.ts.map +1 -0
  42. package/types/api/engine-system-setting.d.ts +3 -2
  43. package/types/api/engine-system-setting.d.ts.map +1 -1
  44. package/types/api/index.d.ts +3 -0
  45. package/types/api/index.d.ts.map +1 -1
  46. package/types/api/system-setting-service-api.d.ts +26 -0
  47. package/types/api/system-setting-service-api.d.ts.map +1 -1
@@ -1,2 +1,2 @@
1
- import{parse,format}from"url";import globalAxios from"axios";import{EventEmitter}from"ee-ts";import{version,debug,WebSocketInterface,UA}from"jssip";const BASE_PATH="https://dev.webitel.com/api".replace(/\/+$/,"");class BaseAPI{constructor(e,t=BASE_PATH,r=globalAxios){this.basePath=t,this.axios=r,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}}class RequiredError extends Error{constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}const AgentPauseCauseServiceApiAxiosParamCreator=function(e){return{createAgentPauseCause:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgentPauseCause.");const i=parse("/call_center/pause_causes",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteAgentPauseCause:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteAgentPauseCause.");const i="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchAgentPauseCause:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchAgentPauseCause.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchAgentPauseCause.");const a="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readAgentPauseCause:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readAgentPauseCause.");const i="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchAgentPauseCause:async(t,r,i,a,n,s,o={})=>{const u=parse("/call_center/pause_causes",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateAgentPauseCause:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentPauseCause.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateAgentPauseCause.");const a="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},AgentPauseCauseServiceApiFp=function(e){return{async createAgentPauseCause(t,r){const i=await AgentPauseCauseServiceApiAxiosParamCreator(e).createAgentPauseCause(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteAgentPauseCause(t,r){const i=await AgentPauseCauseServiceApiAxiosParamCreator(e).deleteAgentPauseCause(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchAgentPauseCause(t,r,i){const a=await AgentPauseCauseServiceApiAxiosParamCreator(e).patchAgentPauseCause(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readAgentPauseCause(t,r){const i=await AgentPauseCauseServiceApiAxiosParamCreator(e).readAgentPauseCause(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchAgentPauseCause(t,r,i,a,n,s,o){const u=await AgentPauseCauseServiceApiAxiosParamCreator(e).searchAgentPauseCause(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateAgentPauseCause(t,r,i){const a=await AgentPauseCauseServiceApiAxiosParamCreator(e).updateAgentPauseCause(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},AgentPauseCauseServiceApiFactory=function(e,t,r){return{createAgentPauseCause:(i,a)=>AgentPauseCauseServiceApiFp(e).createAgentPauseCause(i,a).then(e=>e(r,t)),deleteAgentPauseCause:(i,a)=>AgentPauseCauseServiceApiFp(e).deleteAgentPauseCause(i,a).then(e=>e(r,t)),patchAgentPauseCause:(i,a,n)=>AgentPauseCauseServiceApiFp(e).patchAgentPauseCause(i,a,n).then(e=>e(r,t)),readAgentPauseCause:(i,a)=>AgentPauseCauseServiceApiFp(e).readAgentPauseCause(i,a).then(e=>e(r,t)),searchAgentPauseCause:(i,a,n,s,o,u,c)=>AgentPauseCauseServiceApiFp(e).searchAgentPauseCause(i,a,n,s,o,u,c).then(e=>e(r,t)),updateAgentPauseCause:(i,a,n)=>AgentPauseCauseServiceApiFp(e).updateAgentPauseCause(i,a,n).then(e=>e(r,t))}};class AgentPauseCauseServiceApi extends BaseAPI{createAgentPauseCause(e,t){return AgentPauseCauseServiceApiFp(this.configuration).createAgentPauseCause(e,t).then(e=>e(this.axios,this.basePath))}deleteAgentPauseCause(e,t){return AgentPauseCauseServiceApiFp(this.configuration).deleteAgentPauseCause(e,t).then(e=>e(this.axios,this.basePath))}patchAgentPauseCause(e,t,r){return AgentPauseCauseServiceApiFp(this.configuration).patchAgentPauseCause(e,t,r).then(e=>e(this.axios,this.basePath))}readAgentPauseCause(e,t){return AgentPauseCauseServiceApiFp(this.configuration).readAgentPauseCause(e,t).then(e=>e(this.axios,this.basePath))}searchAgentPauseCause(e,t,r,i,a,n,s){return AgentPauseCauseServiceApiFp(this.configuration).searchAgentPauseCause(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateAgentPauseCause(e,t,r){return AgentPauseCauseServiceApiFp(this.configuration).updateAgentPauseCause(e,t,r).then(e=>e(this.axios,this.basePath))}}const AgentServiceApiAxiosParamCreator=function(e){return{agentSetState:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentSetState.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling agentSetState.");const a="/call_center/agents/{agent_id}/states/waiting".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},agentStateHistory:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentStateHistory.");const c="/call_center/agents/{agent_id}/states/history".replace("{agent_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.time_from=a),void 0!==n&&(y.time_to=n),void 0!==s&&(y.q=s),void 0!==o&&(y.domain_id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},agentTodayStatistics:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentTodayStatistics.");const a="/call_center/agents/{agent_id}/statistics/today".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}r&&(c.fields=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},createAgent:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgent.");const i=parse("/call_center/agents",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteAgent.");const a="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},patchAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchAgent.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchAgent.");const a="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readAgent.");const a="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchAgent:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b={})=>{const S=parse("/call_center/agents",!0);let q;e&&(q=e.baseOptions);const v={method:"GET",...q,...b},C={},R={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;C["X-Webitel-Access"]=t}void 0!==t&&(R.page=t),void 0!==r&&(R.size=r),void 0!==i&&(R.q=i),void 0!==a&&(R.sort=a),n&&(R.fields=n),s&&(R.id=s),o&&(R.allow_channels=o),u&&(R.supervisor_id=u),c&&(R.team_id=c),l&&(R.region_id=l),d&&(R.auditor_id=d),void 0!==p&&(R.is_supervisor=p),h&&(R.skill_id=h),y&&(R.queue_id=y),void 0!==g&&(R.not_supervisor=g),A&&(R.user_id=A),f&&(R.extension=f),m&&(R.not_team_id=m),w&&(R.not_skill_id=w),S.query={...S.query,...R,...b.query},delete S.search;let P=q&&q.headers?q.headers:{};return v.headers={...C,...P,...b.headers},{url:format(S),options:v}},searchAgentCallStatistics:async(t,r,i,a,n,s,o,u,c,l={})=>{const d=parse("/call_center/agents/reports/call",!0);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...l},y={},g={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;y["X-Webitel-Access"]=t}void 0!==t&&(g.page=t),void 0!==r&&(g.size=r),void 0!==i&&(g["time.from"]=i),void 0!==a&&(g["time.to"]=a),n&&(g.agent_id=n),void 0!==s&&(g.domain_id=s),void 0!==o&&(g.q=o),u&&(g.fields=u),void 0!==c&&(g.sort=c),d.query={...d.query,...g,...l.query},delete d.search;let A=p&&p.headers?p.headers:{};return h.headers={...y,...A,...l.headers},{url:format(d),options:h}},searchAgentInQueue:async(t,r,i,a,n,s,o={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling searchAgentInQueue.");const u="/call_center/agents/{id}/queues".replace("{id}",encodeURIComponent(String(t))),c=parse(u,!0);let l;e&&(l=e.baseOptions);const d={method:"GET",...l,...o},p={},h={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;p["X-Webitel-Access"]=t}void 0!==r&&(h.page=r),void 0!==i&&(h.size=i),void 0!==a&&(h.q=a),void 0!==n&&(h.sort=n),s&&(h.fields=s),c.query={...c.query,...h,...o.query},delete c.search;let y=l&&l.headers?l.headers:{};return d.headers={...p,...y,...o.headers},{url:format(c),options:d}},searchAgentInQueueStatistics:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling searchAgentInQueueStatistics.");const a="/call_center/agents/{agent_id}/statistics/queues".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchAgentInTeam:async(t,r,i,a,n,s={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling searchAgentInTeam.");const o="/call_center/agents/{id}/teams".replace("{id}",encodeURIComponent(String(t))),u=parse(o,!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...s},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==r&&(p.page=r),void 0!==i&&(p.size=i),void 0!==a&&(p.q=a),void 0!==n&&(p.domain_id=n),u.query={...u.query,...p,...s.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...s.headers},{url:format(u),options:l}},searchAgentStateHistory:async(t,r,i,a,n,s,o,u,c={})=>{const l=parse("/call_center/agents/states/history",!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==t&&(y.page=t),void 0!==r&&(y.size=r),void 0!==i&&(y["joined_at.from"]=i),void 0!==a&&(y["joined_at.to"]=a),n&&(y.agent_id=n),void 0!==s&&(y.sort=s),void 0!==o&&(y.domain_id=o),void 0!==u&&(y.from_id=u),l.query={...l.query,...y,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},searchAgentStatusStatistic:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w={})=>{const b=parse("/call_center/agents/reports/status",!0);let S;e&&(S=e.baseOptions);const q={method:"GET",...S,...w},v={},C={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;v["X-Webitel-Access"]=t}void 0!==t&&(C.page=t),void 0!==r&&(C.size=r),void 0!==i&&(C.q=i),void 0!==a&&(C.sort=a),n&&(C.fields=n),s&&(C.agent_id=s),void 0!==o&&(C["time.from"]=o),void 0!==u&&(C["time.to"]=u),c&&(C.status=c),l&&(C.queue_id=l),d&&(C.team_id=d),void 0!==p&&(C["utilization.from"]=p),void 0!==h&&(C["utilization.to"]=h),void 0!==y&&(C.has_call=y),g&&(C.skill_id=g),A&&(C.region_id=A),f&&(C.supervisor_id=f),m&&(C.auditor_id=m),b.query={...b.query,...C,...w.query},delete b.search;let R=S&&S.headers?S.headers:{};return q.headers={...v,...R,...w.headers},{url:format(b),options:q}},searchAgentStatusStatisticItem:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling searchAgentStatusStatisticItem.");const n="/call_center/agents/reports/status/{agent_id}".replace("{agent_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==r&&(l["time.from"]=r),void 0!==i&&(l["time.to"]=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchLookupUsersAgentNotExists:async(t,r,i,a,n={})=>{const s=parse("/call_center/lookups/agents/users",!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...n},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==t&&(l.page=t),void 0!==r&&(l.size=r),void 0!==i&&(l.q=i),void 0!==a&&(l.domain_id=a),s.query={...s.query,...l,...n.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...n.headers},{url:format(s),options:u}},searchPauseCauseForAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling searchPauseCauseForAgent.");const a="/call_center/agents/{agent_id}/pause_causes".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.allow_change=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},updateAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgent.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateAgent.");const a="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},updateAgentStatus:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentStatus.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateAgentStatus.");const a="/call_center/agents/{id}/status".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},AgentServiceApiFp=function(e){return{async agentSetState(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).agentSetState(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async agentStateHistory(t,r,i,a,n,s,o,u){const c=await AgentServiceApiAxiosParamCreator(e).agentStateHistory(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async agentTodayStatistics(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).agentTodayStatistics(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async createAgent(t,r){const i=await AgentServiceApiAxiosParamCreator(e).createAgent(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).deleteAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).patchAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).readAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchAgent(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b){const S=await AgentServiceApiAxiosParamCreator(e).searchAgent(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b);return(e=globalAxios,t=BASE_PATH)=>{const r={...S.options,url:t+S.url};return e.request(r)}},async searchAgentCallStatistics(t,r,i,a,n,s,o,u,c,l){const d=await AgentServiceApiAxiosParamCreator(e).searchAgentCallStatistics(t,r,i,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async searchAgentInQueue(t,r,i,a,n,s,o){const u=await AgentServiceApiAxiosParamCreator(e).searchAgentInQueue(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async searchAgentInQueueStatistics(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).searchAgentInQueueStatistics(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchAgentInTeam(t,r,i,a,n,s){const o=await AgentServiceApiAxiosParamCreator(e).searchAgentInTeam(t,r,i,a,n,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...o.options,url:t+o.url};return e.request(r)}},async searchAgentStateHistory(t,r,i,a,n,s,o,u,c){const l=await AgentServiceApiAxiosParamCreator(e).searchAgentStateHistory(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async searchAgentStatusStatistic(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w){const b=await AgentServiceApiAxiosParamCreator(e).searchAgentStatusStatistic(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w);return(e=globalAxios,t=BASE_PATH)=>{const r={...b.options,url:t+b.url};return e.request(r)}},async searchAgentStatusStatisticItem(t,r,i,a){const n=await AgentServiceApiAxiosParamCreator(e).searchAgentStatusStatisticItem(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchLookupUsersAgentNotExists(t,r,i,a,n){const s=await AgentServiceApiAxiosParamCreator(e).searchLookupUsersAgentNotExists(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async searchPauseCauseForAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).searchPauseCauseForAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async updateAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).updateAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async updateAgentStatus(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).updateAgentStatus(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},AgentServiceApiFactory=function(e,t,r){return{agentSetState:(i,a,n)=>AgentServiceApiFp(e).agentSetState(i,a,n).then(e=>e(r,t)),agentStateHistory:(i,a,n,s,o,u,c,l)=>AgentServiceApiFp(e).agentStateHistory(i,a,n,s,o,u,c,l).then(e=>e(r,t)),agentTodayStatistics:(i,a,n)=>AgentServiceApiFp(e).agentTodayStatistics(i,a,n).then(e=>e(r,t)),createAgent:(i,a)=>AgentServiceApiFp(e).createAgent(i,a).then(e=>e(r,t)),deleteAgent:(i,a,n)=>AgentServiceApiFp(e).deleteAgent(i,a,n).then(e=>e(r,t)),patchAgent:(i,a,n)=>AgentServiceApiFp(e).patchAgent(i,a,n).then(e=>e(r,t)),readAgent:(i,a,n)=>AgentServiceApiFp(e).readAgent(i,a,n).then(e=>e(r,t)),searchAgent:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q)=>AgentServiceApiFp(e).searchAgent(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q).then(e=>e(r,t)),searchAgentCallStatistics:(i,a,n,s,o,u,c,l,d,p)=>AgentServiceApiFp(e).searchAgentCallStatistics(i,a,n,s,o,u,c,l,d,p).then(e=>e(r,t)),searchAgentInQueue:(i,a,n,s,o,u,c)=>AgentServiceApiFp(e).searchAgentInQueue(i,a,n,s,o,u,c).then(e=>e(r,t)),searchAgentInQueueStatistics:(i,a,n)=>AgentServiceApiFp(e).searchAgentInQueueStatistics(i,a,n).then(e=>e(r,t)),searchAgentInTeam:(i,a,n,s,o,u)=>AgentServiceApiFp(e).searchAgentInTeam(i,a,n,s,o,u).then(e=>e(r,t)),searchAgentStateHistory:(i,a,n,s,o,u,c,l,d)=>AgentServiceApiFp(e).searchAgentStateHistory(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),searchAgentStatusStatistic:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S)=>AgentServiceApiFp(e).searchAgentStatusStatistic(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S).then(e=>e(r,t)),searchAgentStatusStatisticItem:(i,a,n,s)=>AgentServiceApiFp(e).searchAgentStatusStatisticItem(i,a,n,s).then(e=>e(r,t)),searchLookupUsersAgentNotExists:(i,a,n,s,o)=>AgentServiceApiFp(e).searchLookupUsersAgentNotExists(i,a,n,s,o).then(e=>e(r,t)),searchPauseCauseForAgent:(i,a,n)=>AgentServiceApiFp(e).searchPauseCauseForAgent(i,a,n).then(e=>e(r,t)),updateAgent:(i,a,n)=>AgentServiceApiFp(e).updateAgent(i,a,n).then(e=>e(r,t)),updateAgentStatus:(i,a,n)=>AgentServiceApiFp(e).updateAgentStatus(i,a,n).then(e=>e(r,t))}};class AgentServiceApi extends BaseAPI{agentSetState(e,t,r){return AgentServiceApiFp(this.configuration).agentSetState(e,t,r).then(e=>e(this.axios,this.basePath))}agentStateHistory(e,t,r,i,a,n,s,o){return AgentServiceApiFp(this.configuration).agentStateHistory(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}agentTodayStatistics(e,t,r){return AgentServiceApiFp(this.configuration).agentTodayStatistics(e,t,r).then(e=>e(this.axios,this.basePath))}createAgent(e,t){return AgentServiceApiFp(this.configuration).createAgent(e,t).then(e=>e(this.axios,this.basePath))}deleteAgent(e,t,r){return AgentServiceApiFp(this.configuration).deleteAgent(e,t,r).then(e=>e(this.axios,this.basePath))}patchAgent(e,t,r){return AgentServiceApiFp(this.configuration).patchAgent(e,t,r).then(e=>e(this.axios,this.basePath))}readAgent(e,t,r){return AgentServiceApiFp(this.configuration).readAgent(e,t,r).then(e=>e(this.axios,this.basePath))}searchAgent(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w){return AgentServiceApiFp(this.configuration).searchAgent(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w).then(e=>e(this.axios,this.basePath))}searchAgentCallStatistics(e,t,r,i,a,n,s,o,u,c){return AgentServiceApiFp(this.configuration).searchAgentCallStatistics(e,t,r,i,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}searchAgentInQueue(e,t,r,i,a,n,s){return AgentServiceApiFp(this.configuration).searchAgentInQueue(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}searchAgentInQueueStatistics(e,t,r){return AgentServiceApiFp(this.configuration).searchAgentInQueueStatistics(e,t,r).then(e=>e(this.axios,this.basePath))}searchAgentInTeam(e,t,r,i,a,n){return AgentServiceApiFp(this.configuration).searchAgentInTeam(e,t,r,i,a,n).then(e=>e(this.axios,this.basePath))}searchAgentStateHistory(e,t,r,i,a,n,s,o,u){return AgentServiceApiFp(this.configuration).searchAgentStateHistory(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}searchAgentStatusStatistic(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m){return AgentServiceApiFp(this.configuration).searchAgentStatusStatistic(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m).then(e=>e(this.axios,this.basePath))}searchAgentStatusStatisticItem(e,t,r,i){return AgentServiceApiFp(this.configuration).searchAgentStatusStatisticItem(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchLookupUsersAgentNotExists(e,t,r,i,a){return AgentServiceApiFp(this.configuration).searchLookupUsersAgentNotExists(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}searchPauseCauseForAgent(e,t,r){return AgentServiceApiFp(this.configuration).searchPauseCauseForAgent(e,t,r).then(e=>e(this.axios,this.basePath))}updateAgent(e,t,r){return AgentServiceApiFp(this.configuration).updateAgent(e,t,r).then(e=>e(this.axios,this.basePath))}updateAgentStatus(e,t,r){return AgentServiceApiFp(this.configuration).updateAgentStatus(e,t,r).then(e=>e(this.axios,this.basePath))}}const AgentSkillServiceApiAxiosParamCreator=function(e){return{createAgentSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling createAgentSkill.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgentSkill.");const a="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},createAgentSkills:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling createAgentSkills.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgentSkills.");const a="/call_center/agents/{agent_id}/skills/bulk".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteAgentSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling deleteAgentSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteAgentSkill.");const n="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},deleteAgentSkills:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling deleteAgentSkills.");const n="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}r&&(l.id=r),i&&(l.skill_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},patchAgentSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling patchAgentSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling patchAgentSkill.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling patchAgentSkill.");const n="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},patchAgentSkills:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling patchAgentSkills.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchAgentSkills.");const a="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readAgentSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling readAgentSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readAgentSkill.");const n="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchAgentSkill:async(t,r,i,a,n,s,o,u,c={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling searchAgentSkill.");const l="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(t))),d=parse(l,!0);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...c},y={},g={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;y["X-Webitel-Access"]=t}void 0!==r&&(g.page=r),void 0!==i&&(g.size=i),void 0!==a&&(g.q=a),void 0!==n&&(g.sort=n),s&&(g.fields=s),o&&(g.id=o),u&&(g.skill_id=u),d.query={...d.query,...g,...c.query},delete d.search;let A=p&&p.headers?p.headers:{};return h.headers={...y,...A,...c.headers},{url:format(d),options:h}},searchLookupAgentNotExistsSkill:async(t,r,i,a,n,s={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling searchLookupAgentNotExistsSkill.");const o="/call_center/lookups/agents/skills/{agent_id}".replace("{agent_id}",encodeURIComponent(String(t))),u=parse(o,!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...s},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==r&&(p.page=r),void 0!==i&&(p.size=i),void 0!==a&&(p.q=a),void 0!==n&&(p.domain_id=n),u.query={...u.query,...p,...s.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...s.headers},{url:format(u),options:l}},updateAgentSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling updateAgentSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentSkill.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateAgentSkill.");const n="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},AgentSkillServiceApiFp=function(e){return{async createAgentSkill(t,r,i){const a=await AgentSkillServiceApiAxiosParamCreator(e).createAgentSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async createAgentSkills(t,r,i){const a=await AgentSkillServiceApiAxiosParamCreator(e).createAgentSkills(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteAgentSkill(t,r,i,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).deleteAgentSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async deleteAgentSkills(t,r,i,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).deleteAgentSkills(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async patchAgentSkill(t,r,i,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).patchAgentSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async patchAgentSkills(t,r,i){const a=await AgentSkillServiceApiAxiosParamCreator(e).patchAgentSkills(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readAgentSkill(t,r,i,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).readAgentSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchAgentSkill(t,r,i,a,n,s,o,u,c){const l=await AgentSkillServiceApiAxiosParamCreator(e).searchAgentSkill(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async searchLookupAgentNotExistsSkill(t,r,i,a,n,s){const o=await AgentSkillServiceApiAxiosParamCreator(e).searchLookupAgentNotExistsSkill(t,r,i,a,n,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...o.options,url:t+o.url};return e.request(r)}},async updateAgentSkill(t,r,i,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).updateAgentSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},AgentSkillServiceApiFactory=function(e,t,r){return{createAgentSkill:(i,a,n)=>AgentSkillServiceApiFp(e).createAgentSkill(i,a,n).then(e=>e(r,t)),createAgentSkills:(i,a,n)=>AgentSkillServiceApiFp(e).createAgentSkills(i,a,n).then(e=>e(r,t)),deleteAgentSkill:(i,a,n,s)=>AgentSkillServiceApiFp(e).deleteAgentSkill(i,a,n,s).then(e=>e(r,t)),deleteAgentSkills:(i,a,n,s)=>AgentSkillServiceApiFp(e).deleteAgentSkills(i,a,n,s).then(e=>e(r,t)),patchAgentSkill:(i,a,n,s)=>AgentSkillServiceApiFp(e).patchAgentSkill(i,a,n,s).then(e=>e(r,t)),patchAgentSkills:(i,a,n)=>AgentSkillServiceApiFp(e).patchAgentSkills(i,a,n).then(e=>e(r,t)),readAgentSkill:(i,a,n,s)=>AgentSkillServiceApiFp(e).readAgentSkill(i,a,n,s).then(e=>e(r,t)),searchAgentSkill:(i,a,n,s,o,u,c,l,d)=>AgentSkillServiceApiFp(e).searchAgentSkill(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),searchLookupAgentNotExistsSkill:(i,a,n,s,o,u)=>AgentSkillServiceApiFp(e).searchLookupAgentNotExistsSkill(i,a,n,s,o,u).then(e=>e(r,t)),updateAgentSkill:(i,a,n,s)=>AgentSkillServiceApiFp(e).updateAgentSkill(i,a,n,s).then(e=>e(r,t))}};class AgentSkillServiceApi extends BaseAPI{createAgentSkill(e,t,r){return AgentSkillServiceApiFp(this.configuration).createAgentSkill(e,t,r).then(e=>e(this.axios,this.basePath))}createAgentSkills(e,t,r){return AgentSkillServiceApiFp(this.configuration).createAgentSkills(e,t,r).then(e=>e(this.axios,this.basePath))}deleteAgentSkill(e,t,r,i){return AgentSkillServiceApiFp(this.configuration).deleteAgentSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}deleteAgentSkills(e,t,r,i){return AgentSkillServiceApiFp(this.configuration).deleteAgentSkills(e,t,r,i).then(e=>e(this.axios,this.basePath))}patchAgentSkill(e,t,r,i){return AgentSkillServiceApiFp(this.configuration).patchAgentSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}patchAgentSkills(e,t,r){return AgentSkillServiceApiFp(this.configuration).patchAgentSkills(e,t,r).then(e=>e(this.axios,this.basePath))}readAgentSkill(e,t,r,i){return AgentSkillServiceApiFp(this.configuration).readAgentSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchAgentSkill(e,t,r,i,a,n,s,o,u){return AgentSkillServiceApiFp(this.configuration).searchAgentSkill(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}searchLookupAgentNotExistsSkill(e,t,r,i,a,n){return AgentSkillServiceApiFp(this.configuration).searchLookupAgentNotExistsSkill(e,t,r,i,a,n).then(e=>e(this.axios,this.basePath))}updateAgentSkill(e,t,r,i){return AgentSkillServiceApiFp(this.configuration).updateAgentSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const AgentTeamServiceApiAxiosParamCreator=function(e){return{createAgentTeam:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgentTeam.");const i=parse("/call_center/teams",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteAgentTeam:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteAgentTeam.");const a="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readAgentTeam:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readAgentTeam.");const a="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchAgentTeam:async(t,r,i,a,n,s,o,u,c={})=>{const l=parse("/call_center/teams",!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==t&&(y.page=t),void 0!==r&&(y.size=r),void 0!==i&&(y.q=i),void 0!==a&&(y.sort=a),n&&(y.fields=n),s&&(y.id=s),o&&(y.strategy=o),u&&(y.admin_id=u),l.query={...l.query,...y,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},updateAgentTeam:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentTeam.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateAgentTeam.");const a="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},AgentTeamServiceApiFp=function(e){return{async createAgentTeam(t,r){const i=await AgentTeamServiceApiAxiosParamCreator(e).createAgentTeam(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteAgentTeam(t,r,i){const a=await AgentTeamServiceApiAxiosParamCreator(e).deleteAgentTeam(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readAgentTeam(t,r,i){const a=await AgentTeamServiceApiAxiosParamCreator(e).readAgentTeam(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchAgentTeam(t,r,i,a,n,s,o,u,c){const l=await AgentTeamServiceApiAxiosParamCreator(e).searchAgentTeam(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async updateAgentTeam(t,r,i){const a=await AgentTeamServiceApiAxiosParamCreator(e).updateAgentTeam(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},AgentTeamServiceApiFactory=function(e,t,r){return{createAgentTeam:(i,a)=>AgentTeamServiceApiFp(e).createAgentTeam(i,a).then(e=>e(r,t)),deleteAgentTeam:(i,a,n)=>AgentTeamServiceApiFp(e).deleteAgentTeam(i,a,n).then(e=>e(r,t)),readAgentTeam:(i,a,n)=>AgentTeamServiceApiFp(e).readAgentTeam(i,a,n).then(e=>e(r,t)),searchAgentTeam:(i,a,n,s,o,u,c,l,d)=>AgentTeamServiceApiFp(e).searchAgentTeam(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),updateAgentTeam:(i,a,n)=>AgentTeamServiceApiFp(e).updateAgentTeam(i,a,n).then(e=>e(r,t))}};class AgentTeamServiceApi extends BaseAPI{createAgentTeam(e,t){return AgentTeamServiceApiFp(this.configuration).createAgentTeam(e,t).then(e=>e(this.axios,this.basePath))}deleteAgentTeam(e,t,r){return AgentTeamServiceApiFp(this.configuration).deleteAgentTeam(e,t,r).then(e=>e(this.axios,this.basePath))}readAgentTeam(e,t,r){return AgentTeamServiceApiFp(this.configuration).readAgentTeam(e,t,r).then(e=>e(this.axios,this.basePath))}searchAgentTeam(e,t,r,i,a,n,s,o,u){return AgentTeamServiceApiFp(this.configuration).searchAgentTeam(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateAgentTeam(e,t,r){return AgentTeamServiceApiFp(this.configuration).updateAgentTeam(e,t,r).then(e=>e(this.axios,this.basePath))}}const AuditFormServiceApiAxiosParamCreator=function(e){return{createAuditForm:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createAuditForm.");const i=parse("/call_center/audit/forms",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},createAuditFormRate:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createAuditFormRate.");const i=parse("/call_center/audit/rate",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteAuditForm:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteAuditForm.");const i="/call_center/audit/forms/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchAuditForm:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchAuditForm.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchAuditForm.");const a="/call_center/audit/forms/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readAuditForm:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readAuditForm.");const i="/call_center/audit/forms/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},readAuditRate:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readAuditRate.");const i="/call_center/audit/rate/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchAuditForm:async(t,r,i,a,n,s,o,u,c,l,d,p,h={})=>{const y=parse("/call_center/audit/forms",!0);let g;e&&(g=e.baseOptions);const A={method:"GET",...g,...h},f={},m={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;f["X-Webitel-Access"]=t}void 0!==t&&(m.page=t),void 0!==r&&(m.size=r),void 0!==i&&(m.q=i),void 0!==a&&(m.sort=a),n&&(m.fields=n),s&&(m.id=s),o&&(m.team_id=o),void 0!==u&&(m.enabled=u),void 0!==c&&(m.archive=c),void 0!==l&&(m.editable=l),void 0!==d&&(m.active=d),void 0!==p&&(m.question=p),y.query={...y.query,...m,...h.query},delete y.search;let w=g&&g.headers?g.headers:{};return A.headers={...f,...w,...h.headers},{url:format(y),options:A}},searchAuditRate:async(t,r,i,a,n,s,o,u,c,l,d,p={})=>{if(null==t)throw new RequiredError("formId","Required parameter formId was null or undefined when calling searchAuditRate.");const h="/call_center/audit/forms/{form_id}/rate".replace("{form_id}",encodeURIComponent(String(t))),y=parse(h,!0);let g;e&&(g=e.baseOptions);const A={method:"GET",...g,...p},f={},m={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;f["X-Webitel-Access"]=t}void 0!==r&&(m.page=r),void 0!==i&&(m.size=i),void 0!==a&&(m.q=a),void 0!==n&&(m.sort=n),s&&(m.fields=s),void 0!==o&&(m["created_at.from"]=o),void 0!==u&&(m["created_at.to"]=u),c&&(m.id=c),l&&(m.call_id=l),d&&(m.rated_user=d),y.query={...y.query,...m,...p.query},delete y.search;let w=g&&g.headers?g.headers:{};return A.headers={...f,...w,...p.headers},{url:format(y),options:A}},updateAuditForm:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAuditForm.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateAuditForm.");const a="/call_center/audit/forms/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},AuditFormServiceApiFp=function(e){return{async createAuditForm(t,r){const i=await AuditFormServiceApiAxiosParamCreator(e).createAuditForm(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createAuditFormRate(t,r){const i=await AuditFormServiceApiAxiosParamCreator(e).createAuditFormRate(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteAuditForm(t,r){const i=await AuditFormServiceApiAxiosParamCreator(e).deleteAuditForm(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchAuditForm(t,r,i){const a=await AuditFormServiceApiAxiosParamCreator(e).patchAuditForm(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readAuditForm(t,r){const i=await AuditFormServiceApiAxiosParamCreator(e).readAuditForm(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async readAuditRate(t,r){const i=await AuditFormServiceApiAxiosParamCreator(e).readAuditRate(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchAuditForm(t,r,i,a,n,s,o,u,c,l,d,p,h){const y=await AuditFormServiceApiAxiosParamCreator(e).searchAuditForm(t,r,i,a,n,s,o,u,c,l,d,p,h);return(e=globalAxios,t=BASE_PATH)=>{const r={...y.options,url:t+y.url};return e.request(r)}},async searchAuditRate(t,r,i,a,n,s,o,u,c,l,d,p){const h=await AuditFormServiceApiAxiosParamCreator(e).searchAuditRate(t,r,i,a,n,s,o,u,c,l,d,p);return(e=globalAxios,t=BASE_PATH)=>{const r={...h.options,url:t+h.url};return e.request(r)}},async updateAuditForm(t,r,i){const a=await AuditFormServiceApiAxiosParamCreator(e).updateAuditForm(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},AuditFormServiceApiFactory=function(e,t,r){return{createAuditForm:(i,a)=>AuditFormServiceApiFp(e).createAuditForm(i,a).then(e=>e(r,t)),createAuditFormRate:(i,a)=>AuditFormServiceApiFp(e).createAuditFormRate(i,a).then(e=>e(r,t)),deleteAuditForm:(i,a)=>AuditFormServiceApiFp(e).deleteAuditForm(i,a).then(e=>e(r,t)),patchAuditForm:(i,a,n)=>AuditFormServiceApiFp(e).patchAuditForm(i,a,n).then(e=>e(r,t)),readAuditForm:(i,a)=>AuditFormServiceApiFp(e).readAuditForm(i,a).then(e=>e(r,t)),readAuditRate:(i,a)=>AuditFormServiceApiFp(e).readAuditRate(i,a).then(e=>e(r,t)),searchAuditForm:(i,a,n,s,o,u,c,l,d,p,h,y,g)=>AuditFormServiceApiFp(e).searchAuditForm(i,a,n,s,o,u,c,l,d,p,h,y,g).then(e=>e(r,t)),searchAuditRate:(i,a,n,s,o,u,c,l,d,p,h,y)=>AuditFormServiceApiFp(e).searchAuditRate(i,a,n,s,o,u,c,l,d,p,h,y).then(e=>e(r,t)),updateAuditForm:(i,a,n)=>AuditFormServiceApiFp(e).updateAuditForm(i,a,n).then(e=>e(r,t))}};class AuditFormServiceApi extends BaseAPI{createAuditForm(e,t){return AuditFormServiceApiFp(this.configuration).createAuditForm(e,t).then(e=>e(this.axios,this.basePath))}createAuditFormRate(e,t){return AuditFormServiceApiFp(this.configuration).createAuditFormRate(e,t).then(e=>e(this.axios,this.basePath))}deleteAuditForm(e,t){return AuditFormServiceApiFp(this.configuration).deleteAuditForm(e,t).then(e=>e(this.axios,this.basePath))}patchAuditForm(e,t,r){return AuditFormServiceApiFp(this.configuration).patchAuditForm(e,t,r).then(e=>e(this.axios,this.basePath))}readAuditForm(e,t){return AuditFormServiceApiFp(this.configuration).readAuditForm(e,t).then(e=>e(this.axios,this.basePath))}readAuditRate(e,t){return AuditFormServiceApiFp(this.configuration).readAuditRate(e,t).then(e=>e(this.axios,this.basePath))}searchAuditForm(e,t,r,i,a,n,s,o,u,c,l,d,p){return AuditFormServiceApiFp(this.configuration).searchAuditForm(e,t,r,i,a,n,s,o,u,c,l,d,p).then(e=>e(this.axios,this.basePath))}searchAuditRate(e,t,r,i,a,n,s,o,u,c,l,d){return AuditFormServiceApiFp(this.configuration).searchAuditRate(e,t,r,i,a,n,s,o,u,c,l,d).then(e=>e(this.axios,this.basePath))}updateAuditForm(e,t,r){return AuditFormServiceApiFp(this.configuration).updateAuditForm(e,t,r).then(e=>e(this.axios,this.basePath))}}const BackendProfileServiceApiAxiosParamCreator=function(e){return{createBackendProfile:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createBackendProfile.");const i=parse("/storage/backend_profiles",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteBackendProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteBackendProfile.");const a="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},patchBackendProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchBackendProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchBackendProfile.");const a="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readBackendProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readBackendProfile.");const a="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchBackendProfile:async(t,r,i,a,n,s,o={})=>{const u=parse("/storage/backend_profiles",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateBackendProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateBackendProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateBackendProfile.");const a="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},BackendProfileServiceApiFp=function(e){return{async createBackendProfile(t,r){const i=await BackendProfileServiceApiAxiosParamCreator(e).createBackendProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteBackendProfile(t,r,i){const a=await BackendProfileServiceApiAxiosParamCreator(e).deleteBackendProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchBackendProfile(t,r,i){const a=await BackendProfileServiceApiAxiosParamCreator(e).patchBackendProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readBackendProfile(t,r,i){const a=await BackendProfileServiceApiAxiosParamCreator(e).readBackendProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchBackendProfile(t,r,i,a,n,s,o){const u=await BackendProfileServiceApiAxiosParamCreator(e).searchBackendProfile(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateBackendProfile(t,r,i){const a=await BackendProfileServiceApiAxiosParamCreator(e).updateBackendProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},BackendProfileServiceApiFactory=function(e,t,r){return{createBackendProfile:(i,a)=>BackendProfileServiceApiFp(e).createBackendProfile(i,a).then(e=>e(r,t)),deleteBackendProfile:(i,a,n)=>BackendProfileServiceApiFp(e).deleteBackendProfile(i,a,n).then(e=>e(r,t)),patchBackendProfile:(i,a,n)=>BackendProfileServiceApiFp(e).patchBackendProfile(i,a,n).then(e=>e(r,t)),readBackendProfile:(i,a,n)=>BackendProfileServiceApiFp(e).readBackendProfile(i,a,n).then(e=>e(r,t)),searchBackendProfile:(i,a,n,s,o,u,c)=>BackendProfileServiceApiFp(e).searchBackendProfile(i,a,n,s,o,u,c).then(e=>e(r,t)),updateBackendProfile:(i,a,n)=>BackendProfileServiceApiFp(e).updateBackendProfile(i,a,n).then(e=>e(r,t))}};class BackendProfileServiceApi extends BaseAPI{createBackendProfile(e,t){return BackendProfileServiceApiFp(this.configuration).createBackendProfile(e,t).then(e=>e(this.axios,this.basePath))}deleteBackendProfile(e,t,r){return BackendProfileServiceApiFp(this.configuration).deleteBackendProfile(e,t,r).then(e=>e(this.axios,this.basePath))}patchBackendProfile(e,t,r){return BackendProfileServiceApiFp(this.configuration).patchBackendProfile(e,t,r).then(e=>e(this.axios,this.basePath))}readBackendProfile(e,t,r){return BackendProfileServiceApiFp(this.configuration).readBackendProfile(e,t,r).then(e=>e(this.axios,this.basePath))}searchBackendProfile(e,t,r,i,a,n,s){return BackendProfileServiceApiFp(this.configuration).searchBackendProfile(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateBackendProfile(e,t,r){return BackendProfileServiceApiFp(this.configuration).updateBackendProfile(e,t,r).then(e=>e(this.axios,this.basePath))}}const BucketServiceApiAxiosParamCreator=function(e){return{createBucket:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createBucket.");const i=parse("/call_center/buckets",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteBucket.");const a="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readBucket.");const a="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchBucket:async(t,r,i,a,n,s,o={})=>{const u=parse("/call_center/buckets",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateBucket.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateBucket.");const a="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},BucketServiceApiFp=function(e){return{async createBucket(t,r){const i=await BucketServiceApiAxiosParamCreator(e).createBucket(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteBucket(t,r,i){const a=await BucketServiceApiAxiosParamCreator(e).deleteBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readBucket(t,r,i){const a=await BucketServiceApiAxiosParamCreator(e).readBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchBucket(t,r,i,a,n,s,o){const u=await BucketServiceApiAxiosParamCreator(e).searchBucket(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateBucket(t,r,i){const a=await BucketServiceApiAxiosParamCreator(e).updateBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},BucketServiceApiFactory=function(e,t,r){return{createBucket:(i,a)=>BucketServiceApiFp(e).createBucket(i,a).then(e=>e(r,t)),deleteBucket:(i,a,n)=>BucketServiceApiFp(e).deleteBucket(i,a,n).then(e=>e(r,t)),readBucket:(i,a,n)=>BucketServiceApiFp(e).readBucket(i,a,n).then(e=>e(r,t)),searchBucket:(i,a,n,s,o,u,c)=>BucketServiceApiFp(e).searchBucket(i,a,n,s,o,u,c).then(e=>e(r,t)),updateBucket:(i,a,n)=>BucketServiceApiFp(e).updateBucket(i,a,n).then(e=>e(r,t))}};class BucketServiceApi extends BaseAPI{createBucket(e,t){return BucketServiceApiFp(this.configuration).createBucket(e,t).then(e=>e(this.axios,this.basePath))}deleteBucket(e,t,r){return BucketServiceApiFp(this.configuration).deleteBucket(e,t,r).then(e=>e(this.axios,this.basePath))}readBucket(e,t,r){return BucketServiceApiFp(this.configuration).readBucket(e,t,r).then(e=>e(this.axios,this.basePath))}searchBucket(e,t,r,i,a,n,s){return BucketServiceApiFp(this.configuration).searchBucket(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateBucket(e,t,r){return BucketServiceApiFp(this.configuration).updateBucket(e,t,r).then(e=>e(this.axios,this.basePath))}}const CalendarServiceApiAxiosParamCreator=function(e){return{createCalendar:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCalendar.");const i=parse("/calendars",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteCalendar:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteCalendar.");const a="/calendars/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readCalendar:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readCalendar.");const a="/calendars/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchCalendar:async(t,r,i,a,n,s,o={})=>{const u=parse("/calendars",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},searchTimezones:async(t,r,i,a,n,s,o={})=>{const u=parse("/calendars/timezones",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateCalendar:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCalendar.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateCalendar.");const a="/calendars/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},CalendarServiceApiFp=function(e){return{async createCalendar(t,r){const i=await CalendarServiceApiAxiosParamCreator(e).createCalendar(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteCalendar(t,r,i){const a=await CalendarServiceApiAxiosParamCreator(e).deleteCalendar(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readCalendar(t,r,i){const a=await CalendarServiceApiAxiosParamCreator(e).readCalendar(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchCalendar(t,r,i,a,n,s,o){const u=await CalendarServiceApiAxiosParamCreator(e).searchCalendar(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async searchTimezones(t,r,i,a,n,s,o){const u=await CalendarServiceApiAxiosParamCreator(e).searchTimezones(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateCalendar(t,r,i){const a=await CalendarServiceApiAxiosParamCreator(e).updateCalendar(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},CalendarServiceApiFactory=function(e,t,r){return{createCalendar:(i,a)=>CalendarServiceApiFp(e).createCalendar(i,a).then(e=>e(r,t)),deleteCalendar:(i,a,n)=>CalendarServiceApiFp(e).deleteCalendar(i,a,n).then(e=>e(r,t)),readCalendar:(i,a,n)=>CalendarServiceApiFp(e).readCalendar(i,a,n).then(e=>e(r,t)),searchCalendar:(i,a,n,s,o,u,c)=>CalendarServiceApiFp(e).searchCalendar(i,a,n,s,o,u,c).then(e=>e(r,t)),searchTimezones:(i,a,n,s,o,u,c)=>CalendarServiceApiFp(e).searchTimezones(i,a,n,s,o,u,c).then(e=>e(r,t)),updateCalendar:(i,a,n)=>CalendarServiceApiFp(e).updateCalendar(i,a,n).then(e=>e(r,t))}};class CalendarServiceApi extends BaseAPI{createCalendar(e,t){return CalendarServiceApiFp(this.configuration).createCalendar(e,t).then(e=>e(this.axios,this.basePath))}deleteCalendar(e,t,r){return CalendarServiceApiFp(this.configuration).deleteCalendar(e,t,r).then(e=>e(this.axios,this.basePath))}readCalendar(e,t,r){return CalendarServiceApiFp(this.configuration).readCalendar(e,t,r).then(e=>e(this.axios,this.basePath))}searchCalendar(e,t,r,i,a,n,s){return CalendarServiceApiFp(this.configuration).searchCalendar(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}searchTimezones(e,t,r,i,a,n,s){return CalendarServiceApiFp(this.configuration).searchTimezones(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateCalendar(e,t,r){return CalendarServiceApiFp(this.configuration).updateCalendar(e,t,r).then(e=>e(this.axios,this.basePath))}}const CallServiceApiAxiosParamCreator=function(e){return{aggregateHistoryCall:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling aggregateHistoryCall.");const i=parse("/calls/history/aggregate",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},blindTransferCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling blindTransferCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling blindTransferCall.");const a="/calls/active/{id}/transfer".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},confirmPush:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling confirmPush.");const i="/calls/active/{id}/confirm_push".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"PATCH",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},createCall:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCall.");const i=parse("/calls",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},createCallAnnotation:async(t,r,i={})=>{if(null==t)throw new RequiredError("callId","Required parameter callId was null or undefined when calling createCallAnnotation.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createCallAnnotation.");const a="/calls/history/{call_id}/annotation".replace("{call_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteCallAnnotation:async(t,r,i={})=>{if(null==t)throw new RequiredError("callId","Required parameter callId was null or undefined when calling deleteCallAnnotation.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteCallAnnotation.");const a="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},dtmfCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling dtmfCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling dtmfCall.");const a="/calls/active/{id}/dtmf".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},eavesdropCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling eavesdropCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling eavesdropCall.");const a="/calls/active/{id}/eavesdrop".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},hangupCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling hangupCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling hangupCall.");const a="/calls/active/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},holdCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling holdCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling holdCall.");const a="/calls/active/{id}/hold".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},patchHistoryCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchHistoryCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchHistoryCall.");const a="/calls/history/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readCall.");const a="/calls/active/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchActiveCall:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q,v,C,R,P,T,E,_,K={})=>{const x=parse("/calls/active",!0);let F;e&&(F=e.baseOptions);const I={method:"GET",...F,...K},O={},k={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;O["X-Webitel-Access"]=t}void 0!==t&&(k.page=t),void 0!==r&&(k.size=r),void 0!==i&&(k.q=i),void 0!==a&&(k.sort=a),n&&(k.fields=n),void 0!==s&&(k["created_at.from"]=s),void 0!==o&&(k["created_at.to"]=o),u&&(k.user_id=u),c&&(k.agent_id=c),l&&(k.queue_id=l),d&&(k.team_id=d),p&&(k.member_id=p),h&&(k.gateway_id=h),void 0!==y&&(k["duration.from"]=y),void 0!==g&&(k["duration.to"]=g),void 0!==A&&(k.skip_parent=A),void 0!==f&&(k.parent_id=f),m&&(k.cause=m),void 0!==w&&(k.exists_file=w),void 0!==b&&(k.domain_id=b),void 0!==S&&(k.number=S),q&&(k.direction=q),void 0!==v&&(k["answered_at.from"]=v),void 0!==C&&(k["answered_at.to"]=C),void 0!==R&&(k.missed=R),void 0!==P&&(k["stored_at.from"]=P),void 0!==T&&(k["stored_at.to"]=T),E&&(k.supervisor_id=E),_&&(k.state=_),x.query={...x.query,...k,...K.query},delete x.search;let B=F&&F.headers?F.headers:{};return I.headers={...O,...B,...K.headers},{url:format(x),options:I}},searchHistoryCall:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q,v,C,R,P,T,E,_,K,x,F,I,O,k,B,W,X,H,Q,U,L,M,j,G,N,D,V,J,z,$={})=>{const Y=parse("/calls/history",!0);let Z;e&&(Z=e.baseOptions);const ee={method:"GET",...Z,...$},te={},re={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;te["X-Webitel-Access"]=t}void 0!==t&&(re.page=t),void 0!==r&&(re.size=r),void 0!==i&&(re.q=i),void 0!==a&&(re.sort=a),n&&(re.fields=n),void 0!==s&&(re["created_at.from"]=s),void 0!==o&&(re["created_at.to"]=o),u&&(re.user_id=u),c&&(re.agent_id=c),l&&(re.queue_id=l),d&&(re.team_id=d),p&&(re.member_id=p),h&&(re.gateway_id=h),void 0!==y&&(re["duration.from"]=y),void 0!==g&&(re["duration.to"]=g),void 0!==A&&(re.skip_parent=A),void 0!==f&&(re.parent_id=f),m&&(re.cause=m),void 0!==w&&(re.has_file=w),void 0!==b&&(re.domain_id=b),void 0!==S&&(re.number=S),void 0!==q&&(re.direction=q),void 0!==v&&(re["answered_at.from"]=v),void 0!==C&&(re["answered_at.to"]=C),void 0!==R&&(re.missed=R),void 0!==P&&(re["stored_at.from"]=P),void 0!==T&&(re["stored_at.to"]=T),E&&(re.id=E),_&&(re.transfer_from=_),K&&(re.transfer_to=K),void 0!==x&&(re.dependency_id=x),F&&(re.tags=F),I&&(re.amd_result=I),void 0!==O&&(re.fts=O),k&&(re.directions=k),void 0!==B&&(re.has_transcript=B),void 0!==W&&(re.agent_description=W),X&&(re.owner_id=X),H&&(re.grantee_id=H),Q&&(re.amd_ai_result=Q),void 0!==U&&(re["talk.from"]=U),void 0!==L&&(re["talk.to"]=L),void 0!==M&&(re.rated=M),j&&(re.rated_by=j),void 0!==G&&(re["score_required.from"]=G),void 0!==N&&(re["score_required.to"]=N),void 0!==D&&(re["score_optional.from"]=D),void 0!==V&&(re["score_optional.to"]=V),J&&(re.rated_user=J),z&&(re.contact_id=z),Y.query={...Y.query,...re,...$.query},delete Y.search;let ie=Z&&Z.headers?Z.headers:{};return ee.headers={...te,...ie,...$.headers},{url:format(Y),options:ee}},searchHistoryCallPost:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling searchHistoryCallPost.");const i=parse("/calls/history",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},setVariablesCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling setVariablesCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling setVariablesCall.");const a="/calls/active/{id}/variables".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},unHoldCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling unHoldCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling unHoldCall.");const a="/calls/active/{id}/unhold".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},updateCallAnnotation:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("callId","Required parameter callId was null or undefined when calling updateCallAnnotation.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCallAnnotation.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateCallAnnotation.");const n="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},CallServiceApiFp=function(e){return{async aggregateHistoryCall(t,r){const i=await CallServiceApiAxiosParamCreator(e).aggregateHistoryCall(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async blindTransferCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).blindTransferCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async confirmPush(t,r){const i=await CallServiceApiAxiosParamCreator(e).confirmPush(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createCall(t,r){const i=await CallServiceApiAxiosParamCreator(e).createCall(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createCallAnnotation(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).createCallAnnotation(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteCallAnnotation(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).deleteCallAnnotation(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async dtmfCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).dtmfCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async eavesdropCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).eavesdropCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async hangupCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).hangupCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async holdCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).holdCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchHistoryCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).patchHistoryCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).readCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchActiveCall(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q,v,C,R,P,T,E,_,K){const x=await CallServiceApiAxiosParamCreator(e).searchActiveCall(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q,v,C,R,P,T,E,_,K);return(e=globalAxios,t=BASE_PATH)=>{const r={...x.options,url:t+x.url};return e.request(r)}},async searchHistoryCall(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q,v,C,R,P,T,E,_,K,x,F,I,O,k,B,W,X,H,Q,U,L,M,j,G,N,D,V,J,z,$){const Y=await CallServiceApiAxiosParamCreator(e).searchHistoryCall(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q,v,C,R,P,T,E,_,K,x,F,I,O,k,B,W,X,H,Q,U,L,M,j,G,N,D,V,J,z,$);return(e=globalAxios,t=BASE_PATH)=>{const r={...Y.options,url:t+Y.url};return e.request(r)}},async searchHistoryCallPost(t,r){const i=await CallServiceApiAxiosParamCreator(e).searchHistoryCallPost(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async setVariablesCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).setVariablesCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async unHoldCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).unHoldCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async updateCallAnnotation(t,r,i,a){const n=await CallServiceApiAxiosParamCreator(e).updateCallAnnotation(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},CallServiceApiFactory=function(e,t,r){return{aggregateHistoryCall:(i,a)=>CallServiceApiFp(e).aggregateHistoryCall(i,a).then(e=>e(r,t)),blindTransferCall:(i,a,n)=>CallServiceApiFp(e).blindTransferCall(i,a,n).then(e=>e(r,t)),confirmPush:(i,a)=>CallServiceApiFp(e).confirmPush(i,a).then(e=>e(r,t)),createCall:(i,a)=>CallServiceApiFp(e).createCall(i,a).then(e=>e(r,t)),createCallAnnotation:(i,a,n)=>CallServiceApiFp(e).createCallAnnotation(i,a,n).then(e=>e(r,t)),deleteCallAnnotation:(i,a,n)=>CallServiceApiFp(e).deleteCallAnnotation(i,a,n).then(e=>e(r,t)),dtmfCall:(i,a,n)=>CallServiceApiFp(e).dtmfCall(i,a,n).then(e=>e(r,t)),eavesdropCall:(i,a,n)=>CallServiceApiFp(e).eavesdropCall(i,a,n).then(e=>e(r,t)),hangupCall:(i,a,n)=>CallServiceApiFp(e).hangupCall(i,a,n).then(e=>e(r,t)),holdCall:(i,a,n)=>CallServiceApiFp(e).holdCall(i,a,n).then(e=>e(r,t)),patchHistoryCall:(i,a,n)=>CallServiceApiFp(e).patchHistoryCall(i,a,n).then(e=>e(r,t)),readCall:(i,a,n)=>CallServiceApiFp(e).readCall(i,a,n).then(e=>e(r,t)),searchActiveCall:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q,v,C,R,P,T,E,_,K,x,F)=>CallServiceApiFp(e).searchActiveCall(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q,v,C,R,P,T,E,_,K,x,F).then(e=>e(r,t)),searchHistoryCall:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q,v,C,R,P,T,E,_,K,x,F,I,O,k,B,W,X,H,Q,U,L,M,j,G,N,D,V,J,z,$,Y,Z)=>CallServiceApiFp(e).searchHistoryCall(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q,v,C,R,P,T,E,_,K,x,F,I,O,k,B,W,X,H,Q,U,L,M,j,G,N,D,V,J,z,$,Y,Z).then(e=>e(r,t)),searchHistoryCallPost:(i,a)=>CallServiceApiFp(e).searchHistoryCallPost(i,a).then(e=>e(r,t)),setVariablesCall:(i,a,n)=>CallServiceApiFp(e).setVariablesCall(i,a,n).then(e=>e(r,t)),unHoldCall:(i,a,n)=>CallServiceApiFp(e).unHoldCall(i,a,n).then(e=>e(r,t)),updateCallAnnotation:(i,a,n,s)=>CallServiceApiFp(e).updateCallAnnotation(i,a,n,s).then(e=>e(r,t))}};class CallServiceApi extends BaseAPI{aggregateHistoryCall(e,t){return CallServiceApiFp(this.configuration).aggregateHistoryCall(e,t).then(e=>e(this.axios,this.basePath))}blindTransferCall(e,t,r){return CallServiceApiFp(this.configuration).blindTransferCall(e,t,r).then(e=>e(this.axios,this.basePath))}confirmPush(e,t){return CallServiceApiFp(this.configuration).confirmPush(e,t).then(e=>e(this.axios,this.basePath))}createCall(e,t){return CallServiceApiFp(this.configuration).createCall(e,t).then(e=>e(this.axios,this.basePath))}createCallAnnotation(e,t,r){return CallServiceApiFp(this.configuration).createCallAnnotation(e,t,r).then(e=>e(this.axios,this.basePath))}deleteCallAnnotation(e,t,r){return CallServiceApiFp(this.configuration).deleteCallAnnotation(e,t,r).then(e=>e(this.axios,this.basePath))}dtmfCall(e,t,r){return CallServiceApiFp(this.configuration).dtmfCall(e,t,r).then(e=>e(this.axios,this.basePath))}eavesdropCall(e,t,r){return CallServiceApiFp(this.configuration).eavesdropCall(e,t,r).then(e=>e(this.axios,this.basePath))}hangupCall(e,t,r){return CallServiceApiFp(this.configuration).hangupCall(e,t,r).then(e=>e(this.axios,this.basePath))}holdCall(e,t,r){return CallServiceApiFp(this.configuration).holdCall(e,t,r).then(e=>e(this.axios,this.basePath))}patchHistoryCall(e,t,r){return CallServiceApiFp(this.configuration).patchHistoryCall(e,t,r).then(e=>e(this.axios,this.basePath))}readCall(e,t,r){return CallServiceApiFp(this.configuration).readCall(e,t,r).then(e=>e(this.axios,this.basePath))}searchActiveCall(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q,v,C,R,P,T,E,_){return CallServiceApiFp(this.configuration).searchActiveCall(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q,v,C,R,P,T,E,_).then(e=>e(this.axios,this.basePath))}searchHistoryCall(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q,v,C,R,P,T,E,_,K,x,F,I,O,k,B,W,X,H,Q,U,L,M,j,G,N,D,V,J,z){return CallServiceApiFp(this.configuration).searchHistoryCall(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q,v,C,R,P,T,E,_,K,x,F,I,O,k,B,W,X,H,Q,U,L,M,j,G,N,D,V,J,z).then(e=>e(this.axios,this.basePath))}searchHistoryCallPost(e,t){return CallServiceApiFp(this.configuration).searchHistoryCallPost(e,t).then(e=>e(this.axios,this.basePath))}setVariablesCall(e,t,r){return CallServiceApiFp(this.configuration).setVariablesCall(e,t,r).then(e=>e(this.axios,this.basePath))}unHoldCall(e,t,r){return CallServiceApiFp(this.configuration).unHoldCall(e,t,r).then(e=>e(this.axios,this.basePath))}updateCallAnnotation(e,t,r,i){return CallServiceApiFp(this.configuration).updateCallAnnotation(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const CatalogApiAxiosParamCreator=function(e){return{getCustomers:async(t,r,i,a,n,s,o,u,c,l,d={})=>{const p=parse("/chat/customers",!0);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...d},g={},A={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==t&&(A.page=t),void 0!==r&&(A.size=r),void 0!==i&&(A.q=i),a&&(A.sort=a),n&&(A.fields=n),s&&(A.id=s),void 0!==o&&(A.type=o),void 0!==u&&(A["via.id"]=u),void 0!==c&&(A["via.type"]=c),void 0!==l&&(A["via.name"]=l),p.query={...p.query,...A,...d.query},delete p.search;let f=h&&h.headers?h.headers:{};return y.headers={...g,...f,...d.headers},{url:format(p),options:y}},getDialogs:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A={})=>{const f=parse("/chat/dialogs",!0);let m;e&&(m=e.baseOptions);const w={method:"GET",...m,...A},b={},S={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;b["X-Webitel-Access"]=t}void 0!==t&&(S.page=t),void 0!==r&&(S.size=r),void 0!==i&&(S.q=i),a&&(S.sort=a),n&&(S.fields=n),s&&(S.id=s),void 0!==o&&(S["via.id"]=o),void 0!==u&&(S["via.type"]=u),void 0!==c&&(S["via.name"]=c),void 0!==l&&(S["peer.id"]=l),void 0!==d&&(S["peer.type"]=d),void 0!==p&&(S["peer.name"]=p),void 0!==h&&(S["date.since"]=h),void 0!==y&&(S["date.until"]=y),void 0!==g&&(S.online=g),f.query={...f.query,...S,...A.query},delete f.search;let q=m&&m.headers?m.headers:{};return w.headers={...b,...q,...A.headers},{url:format(f),options:w}},getHistory:async(t,r,i,a,n,s,o,u,c,l={})=>{if(null==t)throw new RequiredError("chatId","Required parameter chatId was null or undefined when calling getHistory.");const d="/chat/dialogs/{chat_id}/messages".replace("{chat_id}",encodeURIComponent(String(t))),p=parse(d,!0);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...l},g={},A={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==r&&(A["offset.id"]=r),void 0!==i&&(A["offset.date"]=i),void 0!==a&&(A.limit=a),void 0!==n&&(A.q=n),s&&(A.fields=s),void 0!==o&&(A["peer.id"]=o),void 0!==u&&(A["peer.type"]=u),void 0!==c&&(A["peer.name"]=c),p.query={...p.query,...A,...l.query},delete p.search;let f=h&&h.headers?h.headers:{};return y.headers={...g,...f,...l.headers},{url:format(p),options:y}},getHistory2:async(t,r,i,a,n,s,o,u,c,l={})=>{if(null==t)throw new RequiredError("peerType","Required parameter peerType was null or undefined when calling getHistory2.");if(null==r)throw new RequiredError("peerId","Required parameter peerId was null or undefined when calling getHistory2.");const d="/chat/{peer.type}/{peer.id}/messages".replace("{peer.type}",encodeURIComponent(String(t))).replace("{peer.id}",encodeURIComponent(String(r))),p=parse(d,!0);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...l},g={},A={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==i&&(A["offset.id"]=i),void 0!==a&&(A["offset.date"]=a),void 0!==n&&(A.limit=n),void 0!==s&&(A.q=s),o&&(A.fields=o),void 0!==u&&(A.chat_id=u),void 0!==c&&(A["peer.name"]=c),p.query={...p.query,...A,...l.query},delete p.search;let f=h&&h.headers?h.headers:{};return y.headers={...g,...f,...l.headers},{url:format(p),options:y}},getMembers:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m={})=>{if(null==t)throw new RequiredError("chatId","Required parameter chatId was null or undefined when calling getMembers.");const w="/chat/dialogs/{chat_id}/members".replace("{chat_id}",encodeURIComponent(String(t))),b=parse(w,!0);let S;e&&(S=e.baseOptions);const q={method:"GET",...S,...m},v={},C={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;v["X-Webitel-Access"]=t}void 0!==r&&(C.page=r),void 0!==i&&(C.size=i),void 0!==a&&(C.q=a),n&&(C.sort=n),s&&(C.fields=s),o&&(C.id=o),void 0!==u&&(C["via.id"]=u),void 0!==c&&(C["via.type"]=c),void 0!==l&&(C["via.name"]=l),void 0!==d&&(C["peer.id"]=d),void 0!==p&&(C["peer.type"]=p),void 0!==h&&(C["peer.name"]=h),void 0!==y&&(C["date.since"]=y),void 0!==g&&(C["date.until"]=g),void 0!==A&&(C.online=A),void 0!==f&&(C.joined=f),b.query={...b.query,...C,...m.query},delete b.search;let R=S&&S.headers?S.headers:{};return q.headers={...v,...R,...m.headers},{url:format(b),options:q}}}},CatalogApiFp=function(e){return{async getCustomers(t,r,i,a,n,s,o,u,c,l,d){const p=await CatalogApiAxiosParamCreator(e).getCustomers(t,r,i,a,n,s,o,u,c,l,d);return(e=globalAxios,t=BASE_PATH)=>{const r={...p.options,url:t+p.url};return e.request(r)}},async getDialogs(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A){const f=await CatalogApiAxiosParamCreator(e).getDialogs(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A);return(e=globalAxios,t=BASE_PATH)=>{const r={...f.options,url:t+f.url};return e.request(r)}},async getHistory(t,r,i,a,n,s,o,u,c,l){const d=await CatalogApiAxiosParamCreator(e).getHistory(t,r,i,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async getHistory2(t,r,i,a,n,s,o,u,c,l){const d=await CatalogApiAxiosParamCreator(e).getHistory2(t,r,i,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async getMembers(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m){const w=await CatalogApiAxiosParamCreator(e).getMembers(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m);return(e=globalAxios,t=BASE_PATH)=>{const r={...w.options,url:t+w.url};return e.request(r)}}}},CatalogApiFactory=function(e,t,r){return{getCustomers:(i,a,n,s,o,u,c,l,d,p,h)=>CatalogApiFp(e).getCustomers(i,a,n,s,o,u,c,l,d,p,h).then(e=>e(r,t)),getDialogs:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m)=>CatalogApiFp(e).getDialogs(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m).then(e=>e(r,t)),getHistory:(i,a,n,s,o,u,c,l,d,p)=>CatalogApiFp(e).getHistory(i,a,n,s,o,u,c,l,d,p).then(e=>e(r,t)),getHistory2:(i,a,n,s,o,u,c,l,d,p)=>CatalogApiFp(e).getHistory2(i,a,n,s,o,u,c,l,d,p).then(e=>e(r,t)),getMembers:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b)=>CatalogApiFp(e).getMembers(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b).then(e=>e(r,t))}};class CatalogApi extends BaseAPI{getCustomers(e,t,r,i,a,n,s,o,u,c,l){return CatalogApiFp(this.configuration).getCustomers(e,t,r,i,a,n,s,o,u,c,l).then(e=>e(this.axios,this.basePath))}getDialogs(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g){return CatalogApiFp(this.configuration).getDialogs(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g).then(e=>e(this.axios,this.basePath))}getHistory(e,t,r,i,a,n,s,o,u,c){return CatalogApiFp(this.configuration).getHistory(e,t,r,i,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}getHistory2(e,t,r,i,a,n,s,o,u,c){return CatalogApiFp(this.configuration).getHistory2(e,t,r,i,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}getMembers(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f){return CatalogApiFp(this.configuration).getMembers(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f).then(e=>e(this.axios,this.basePath))}}const ChatHelperServiceApiAxiosParamCreator=function(e){return{broadcast:async(t,r,i={})=>{if(null==t)throw new RequiredError("profileId","Required parameter profileId was null or undefined when calling broadcast.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling broadcast.");const a="/chat/bots/{profile_id}/broadcast".replace("{profile_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},ChatHelperServiceApiFp=function(e){return{async broadcast(t,r,i){const a=await ChatHelperServiceApiAxiosParamCreator(e).broadcast(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},ChatHelperServiceApiFactory=function(e,t,r){return{broadcast:(i,a,n)=>ChatHelperServiceApiFp(e).broadcast(i,a,n).then(e=>e(r,t))}};class ChatHelperServiceApi extends BaseAPI{broadcast(e,t,r){return ChatHelperServiceApiFp(this.configuration).broadcast(e,t,r).then(e=>e(this.axios,this.basePath))}}const CognitiveProfileServiceApiAxiosParamCreator=function(e){return{createCognitiveProfile:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCognitiveProfile.");const i=parse("/storage/cognitive_profiles",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteCognitiveProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteCognitiveProfile.");const i="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchCognitiveProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchCognitiveProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchCognitiveProfile.");const a="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readCognitiveProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readCognitiveProfile.");const i="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchCognitiveProfile:async(t,r,i,a,n,s,o,u,c={})=>{const l=parse("/storage/cognitive_profiles",!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==t&&(y.page=t),void 0!==r&&(y.size=r),void 0!==i&&(y.q=i),void 0!==a&&(y.sort=a),n&&(y.fields=n),s&&(y.id=s),o&&(y.service=o),void 0!==u&&(y.enabled=u),l.query={...l.query,...y,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},updateCognitiveProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCognitiveProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateCognitiveProfile.");const a="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},CognitiveProfileServiceApiFp=function(e){return{async createCognitiveProfile(t,r){const i=await CognitiveProfileServiceApiAxiosParamCreator(e).createCognitiveProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteCognitiveProfile(t,r){const i=await CognitiveProfileServiceApiAxiosParamCreator(e).deleteCognitiveProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchCognitiveProfile(t,r,i){const a=await CognitiveProfileServiceApiAxiosParamCreator(e).patchCognitiveProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readCognitiveProfile(t,r){const i=await CognitiveProfileServiceApiAxiosParamCreator(e).readCognitiveProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchCognitiveProfile(t,r,i,a,n,s,o,u,c){const l=await CognitiveProfileServiceApiAxiosParamCreator(e).searchCognitiveProfile(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async updateCognitiveProfile(t,r,i){const a=await CognitiveProfileServiceApiAxiosParamCreator(e).updateCognitiveProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},CognitiveProfileServiceApiFactory=function(e,t,r){return{createCognitiveProfile:(i,a)=>CognitiveProfileServiceApiFp(e).createCognitiveProfile(i,a).then(e=>e(r,t)),deleteCognitiveProfile:(i,a)=>CognitiveProfileServiceApiFp(e).deleteCognitiveProfile(i,a).then(e=>e(r,t)),patchCognitiveProfile:(i,a,n)=>CognitiveProfileServiceApiFp(e).patchCognitiveProfile(i,a,n).then(e=>e(r,t)),readCognitiveProfile:(i,a)=>CognitiveProfileServiceApiFp(e).readCognitiveProfile(i,a).then(e=>e(r,t)),searchCognitiveProfile:(i,a,n,s,o,u,c,l,d)=>CognitiveProfileServiceApiFp(e).searchCognitiveProfile(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),updateCognitiveProfile:(i,a,n)=>CognitiveProfileServiceApiFp(e).updateCognitiveProfile(i,a,n).then(e=>e(r,t))}};class CognitiveProfileServiceApi extends BaseAPI{createCognitiveProfile(e,t){return CognitiveProfileServiceApiFp(this.configuration).createCognitiveProfile(e,t).then(e=>e(this.axios,this.basePath))}deleteCognitiveProfile(e,t){return CognitiveProfileServiceApiFp(this.configuration).deleteCognitiveProfile(e,t).then(e=>e(this.axios,this.basePath))}patchCognitiveProfile(e,t,r){return CognitiveProfileServiceApiFp(this.configuration).patchCognitiveProfile(e,t,r).then(e=>e(this.axios,this.basePath))}readCognitiveProfile(e,t){return CognitiveProfileServiceApiFp(this.configuration).readCognitiveProfile(e,t).then(e=>e(this.axios,this.basePath))}searchCognitiveProfile(e,t,r,i,a,n,s,o,u){return CognitiveProfileServiceApiFp(this.configuration).searchCognitiveProfile(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateCognitiveProfile(e,t,r){return CognitiveProfileServiceApiFp(this.configuration).updateCognitiveProfile(e,t,r).then(e=>e(this.axios,this.basePath))}}const CommunicationTypeServiceApiAxiosParamCreator=function(e){return{createCommunicationType:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCommunicationType.");const i=parse("/call_center/communication_type",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteCommunicationType:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteCommunicationType.");const a="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readCommunicationType:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readCommunicationType.");const a="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchCommunicationType:async(t,r,i,a,n,s,o,u={})=>{const c=parse("/call_center/communication_type",!0);let l;e&&(l=e.baseOptions);const d={method:"GET",...l,...u},p={},h={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;p["X-Webitel-Access"]=t}void 0!==t&&(h.page=t),void 0!==r&&(h.size=r),void 0!==i&&(h.q=i),void 0!==a&&(h.sort=a),n&&(h.fields=n),s&&(h.id=s),o&&(h.channel=o),c.query={...c.query,...h,...u.query},delete c.search;let y=l&&l.headers?l.headers:{};return d.headers={...p,...y,...u.headers},{url:format(c),options:d}},updateCommunicationType:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCommunicationType.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateCommunicationType.");const a="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},CommunicationTypeServiceApiFp=function(e){return{async createCommunicationType(t,r){const i=await CommunicationTypeServiceApiAxiosParamCreator(e).createCommunicationType(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteCommunicationType(t,r,i){const a=await CommunicationTypeServiceApiAxiosParamCreator(e).deleteCommunicationType(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readCommunicationType(t,r,i){const a=await CommunicationTypeServiceApiAxiosParamCreator(e).readCommunicationType(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchCommunicationType(t,r,i,a,n,s,o,u){const c=await CommunicationTypeServiceApiAxiosParamCreator(e).searchCommunicationType(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async updateCommunicationType(t,r,i){const a=await CommunicationTypeServiceApiAxiosParamCreator(e).updateCommunicationType(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},CommunicationTypeServiceApiFactory=function(e,t,r){return{createCommunicationType:(i,a)=>CommunicationTypeServiceApiFp(e).createCommunicationType(i,a).then(e=>e(r,t)),deleteCommunicationType:(i,a,n)=>CommunicationTypeServiceApiFp(e).deleteCommunicationType(i,a,n).then(e=>e(r,t)),readCommunicationType:(i,a,n)=>CommunicationTypeServiceApiFp(e).readCommunicationType(i,a,n).then(e=>e(r,t)),searchCommunicationType:(i,a,n,s,o,u,c,l)=>CommunicationTypeServiceApiFp(e).searchCommunicationType(i,a,n,s,o,u,c,l).then(e=>e(r,t)),updateCommunicationType:(i,a,n)=>CommunicationTypeServiceApiFp(e).updateCommunicationType(i,a,n).then(e=>e(r,t))}};class CommunicationTypeServiceApi extends BaseAPI{createCommunicationType(e,t){return CommunicationTypeServiceApiFp(this.configuration).createCommunicationType(e,t).then(e=>e(this.axios,this.basePath))}deleteCommunicationType(e,t,r){return CommunicationTypeServiceApiFp(this.configuration).deleteCommunicationType(e,t,r).then(e=>e(this.axios,this.basePath))}readCommunicationType(e,t,r){return CommunicationTypeServiceApiFp(this.configuration).readCommunicationType(e,t,r).then(e=>e(this.axios,this.basePath))}searchCommunicationType(e,t,r,i,a,n,s,o){return CommunicationTypeServiceApiFp(this.configuration).searchCommunicationType(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateCommunicationType(e,t,r){return CommunicationTypeServiceApiFp(this.configuration).updateCommunicationType(e,t,r).then(e=>e(this.axios,this.basePath))}}const ConfigServiceApiAxiosParamCreator=function(e){return{createConfig:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createConfig.");const i=parse("/logger/config",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteConfig:async(t,r={})=>{if(null==t)throw new RequiredError("configId","Required parameter configId was null or undefined when calling deleteConfig.");const i="/logger/config/{config_id}".replace("{config_id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},deleteConfigBulk:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling deleteConfigBulk.");const i=parse("/logger/config",!0);let a;e&&(a=e.baseOptions);const n={method:"DELETE",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},patchConfig:async(t,r,i={})=>{if(null==t)throw new RequiredError("configId","Required parameter configId was null or undefined when calling patchConfig.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchConfig.");const a="/logger/config/{config_id}".replace("{config_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readConfig:async(t,r={})=>{if(null==t)throw new RequiredError("configId","Required parameter configId was null or undefined when calling readConfig.");const i="/logger/config/{config_id}".replace("{config_id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},readSystemObjects:async(t,r={})=>{const i=parse("/logger/available_objects",!0);let a;e&&(a=e.baseOptions);const n={method:"GET",...a,...r},s={},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}void 0!==t&&(o.include_existing=t),i.query={...i.query,...o,...r.query},delete i.search;let u=a&&a.headers?a.headers:{};return n.headers={...s,...u,...r.headers},{url:format(i),options:n}},searchConfig:async(t,r,i,a,n,s,o={})=>{const u=parse("/logger/config",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.object=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateConfig:async(t,r,i={})=>{if(null==t)throw new RequiredError("configId","Required parameter configId was null or undefined when calling updateConfig.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateConfig.");const a="/logger/config/{config_id}".replace("{config_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},ConfigServiceApiFp=function(e){return{async createConfig(t,r){const i=await ConfigServiceApiAxiosParamCreator(e).createConfig(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteConfig(t,r){const i=await ConfigServiceApiAxiosParamCreator(e).deleteConfig(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteConfigBulk(t,r){const i=await ConfigServiceApiAxiosParamCreator(e).deleteConfigBulk(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchConfig(t,r,i){const a=await ConfigServiceApiAxiosParamCreator(e).patchConfig(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readConfig(t,r){const i=await ConfigServiceApiAxiosParamCreator(e).readConfig(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async readSystemObjects(t,r){const i=await ConfigServiceApiAxiosParamCreator(e).readSystemObjects(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchConfig(t,r,i,a,n,s,o){const u=await ConfigServiceApiAxiosParamCreator(e).searchConfig(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateConfig(t,r,i){const a=await ConfigServiceApiAxiosParamCreator(e).updateConfig(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},ConfigServiceApiFactory=function(e,t,r){return{createConfig:(i,a)=>ConfigServiceApiFp(e).createConfig(i,a).then(e=>e(r,t)),deleteConfig:(i,a)=>ConfigServiceApiFp(e).deleteConfig(i,a).then(e=>e(r,t)),deleteConfigBulk:(i,a)=>ConfigServiceApiFp(e).deleteConfigBulk(i,a).then(e=>e(r,t)),patchConfig:(i,a,n)=>ConfigServiceApiFp(e).patchConfig(i,a,n).then(e=>e(r,t)),readConfig:(i,a)=>ConfigServiceApiFp(e).readConfig(i,a).then(e=>e(r,t)),readSystemObjects:(i,a)=>ConfigServiceApiFp(e).readSystemObjects(i,a).then(e=>e(r,t)),searchConfig:(i,a,n,s,o,u,c)=>ConfigServiceApiFp(e).searchConfig(i,a,n,s,o,u,c).then(e=>e(r,t)),updateConfig:(i,a,n)=>ConfigServiceApiFp(e).updateConfig(i,a,n).then(e=>e(r,t))}};class ConfigServiceApi extends BaseAPI{createConfig(e,t){return ConfigServiceApiFp(this.configuration).createConfig(e,t).then(e=>e(this.axios,this.basePath))}deleteConfig(e,t){return ConfigServiceApiFp(this.configuration).deleteConfig(e,t).then(e=>e(this.axios,this.basePath))}deleteConfigBulk(e,t){return ConfigServiceApiFp(this.configuration).deleteConfigBulk(e,t).then(e=>e(this.axios,this.basePath))}patchConfig(e,t,r){return ConfigServiceApiFp(this.configuration).patchConfig(e,t,r).then(e=>e(this.axios,this.basePath))}readConfig(e,t){return ConfigServiceApiFp(this.configuration).readConfig(e,t).then(e=>e(this.axios,this.basePath))}readSystemObjects(e,t){return ConfigServiceApiFp(this.configuration).readSystemObjects(e,t).then(e=>e(this.axios,this.basePath))}searchConfig(e,t,r,i,a,n,s){return ConfigServiceApiFp(this.configuration).searchConfig(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateConfig(e,t,r){return ConfigServiceApiFp(this.configuration).updateConfig(e,t,r).then(e=>e(this.axios,this.basePath))}}const ContactsApiAxiosParamCreator=function(e){return{createContact:async(t,r,i={})=>{if(null==t)throw new RequiredError("input","Required parameter input was null or undefined when calling createContact.");const a=parse("/contacts",!0);let n;e&&(n=e.baseOptions);const s={method:"POST",...n,...i},o={},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}r&&(u.fields=r),o["Content-Type"]="application/json",a.query={...a.query,...u,...i.query},delete a.search;let c=n&&n.headers?n.headers:{};s.headers={...o,...c,...i.headers};const l="string"!=typeof t||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(a),options:s}},deleteContact:async(t,r,i={})=>{if(null==t)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteContact.");const a="/contacts/{etag}".replace("{etag}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}r&&(c.fields=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},locateContact:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("etag","Required parameter etag was null or undefined when calling locateContact.");const n="/contacts/{etag}".replace("{etag}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}r&&(l.fields=r),void 0!==i&&(l.mode=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchContacts:async(t,r,i,a,n,s,o,u,c={})=>{const l=parse("/contacts",!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==t&&(y.page=t),void 0!==r&&(y.size=r),void 0!==i&&(y.q=i),a&&(y.sort=a),n&&(y.fields=n),s&&(y.id=s),o&&(y.qin=o),void 0!==u&&(y.mode=u),l.query={...l.query,...y,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},updateContact:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updateContact.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling updateContact.");const n="/contacts/{etag}".replace("{etag}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},ContactsApiFp=function(e){return{async createContact(t,r,i){const a=await ContactsApiAxiosParamCreator(e).createContact(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteContact(t,r,i){const a=await ContactsApiAxiosParamCreator(e).deleteContact(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async locateContact(t,r,i,a){const n=await ContactsApiAxiosParamCreator(e).locateContact(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchContacts(t,r,i,a,n,s,o,u,c){const l=await ContactsApiAxiosParamCreator(e).searchContacts(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async updateContact(t,r,i,a){const n=await ContactsApiAxiosParamCreator(e).updateContact(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},ContactsApiFactory=function(e,t,r){return{createContact:(i,a,n)=>ContactsApiFp(e).createContact(i,a,n).then(e=>e(r,t)),deleteContact:(i,a,n)=>ContactsApiFp(e).deleteContact(i,a,n).then(e=>e(r,t)),locateContact:(i,a,n,s)=>ContactsApiFp(e).locateContact(i,a,n,s).then(e=>e(r,t)),searchContacts:(i,a,n,s,o,u,c,l,d)=>ContactsApiFp(e).searchContacts(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),updateContact:(i,a,n,s)=>ContactsApiFp(e).updateContact(i,a,n,s).then(e=>e(r,t))}};class ContactsApi extends BaseAPI{createContact(e,t,r){return ContactsApiFp(this.configuration).createContact(e,t,r).then(e=>e(this.axios,this.basePath))}deleteContact(e,t,r){return ContactsApiFp(this.configuration).deleteContact(e,t,r).then(e=>e(this.axios,this.basePath))}locateContact(e,t,r,i){return ContactsApiFp(this.configuration).locateContact(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchContacts(e,t,r,i,a,n,s,o,u){return ContactsApiFp(this.configuration).searchContacts(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateContact(e,t,r,i){return ContactsApiFp(this.configuration).updateContact(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const EmailProfileServiceApiAxiosParamCreator=function(e){return{createEmailProfile:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createEmailProfile.");const i=parse("/email/profile",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteEmailProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteEmailProfile.");const i="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},loginEmailProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling loginEmailProfile.");const i="/email/profile/{id}/login".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchEmailProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchEmailProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchEmailProfile.");const a="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readEmailProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readEmailProfile.");const i="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchEmailProfile:async(t,r,i,a,n,s={})=>{const o=parse("/email/profile",!0);let u;e&&(u=e.baseOptions);const c={method:"GET",...u,...s},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}void 0!==t&&(d.page=t),void 0!==r&&(d.size=r),void 0!==i&&(d.q=i),void 0!==a&&(d.sort=a),n&&(d.fields=n),o.query={...o.query,...d,...s.query},delete o.search;let p=u&&u.headers?u.headers:{};return c.headers={...l,...p,...s.headers},{url:format(o),options:c}},testEmailProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling testEmailProfile.");const i="/email/profile/{id}/test".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},updateEmailProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateEmailProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateEmailProfile.");const a="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},EmailProfileServiceApiFp=function(e){return{async createEmailProfile(t,r){const i=await EmailProfileServiceApiAxiosParamCreator(e).createEmailProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteEmailProfile(t,r){const i=await EmailProfileServiceApiAxiosParamCreator(e).deleteEmailProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async loginEmailProfile(t,r){const i=await EmailProfileServiceApiAxiosParamCreator(e).loginEmailProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchEmailProfile(t,r,i){const a=await EmailProfileServiceApiAxiosParamCreator(e).patchEmailProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readEmailProfile(t,r){const i=await EmailProfileServiceApiAxiosParamCreator(e).readEmailProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchEmailProfile(t,r,i,a,n,s){const o=await EmailProfileServiceApiAxiosParamCreator(e).searchEmailProfile(t,r,i,a,n,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...o.options,url:t+o.url};return e.request(r)}},async testEmailProfile(t,r){const i=await EmailProfileServiceApiAxiosParamCreator(e).testEmailProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async updateEmailProfile(t,r,i){const a=await EmailProfileServiceApiAxiosParamCreator(e).updateEmailProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},EmailProfileServiceApiFactory=function(e,t,r){return{createEmailProfile:(i,a)=>EmailProfileServiceApiFp(e).createEmailProfile(i,a).then(e=>e(r,t)),deleteEmailProfile:(i,a)=>EmailProfileServiceApiFp(e).deleteEmailProfile(i,a).then(e=>e(r,t)),loginEmailProfile:(i,a)=>EmailProfileServiceApiFp(e).loginEmailProfile(i,a).then(e=>e(r,t)),patchEmailProfile:(i,a,n)=>EmailProfileServiceApiFp(e).patchEmailProfile(i,a,n).then(e=>e(r,t)),readEmailProfile:(i,a)=>EmailProfileServiceApiFp(e).readEmailProfile(i,a).then(e=>e(r,t)),searchEmailProfile:(i,a,n,s,o,u)=>EmailProfileServiceApiFp(e).searchEmailProfile(i,a,n,s,o,u).then(e=>e(r,t)),testEmailProfile:(i,a)=>EmailProfileServiceApiFp(e).testEmailProfile(i,a).then(e=>e(r,t)),updateEmailProfile:(i,a,n)=>EmailProfileServiceApiFp(e).updateEmailProfile(i,a,n).then(e=>e(r,t))}};class EmailProfileServiceApi extends BaseAPI{createEmailProfile(e,t){return EmailProfileServiceApiFp(this.configuration).createEmailProfile(e,t).then(e=>e(this.axios,this.basePath))}deleteEmailProfile(e,t){return EmailProfileServiceApiFp(this.configuration).deleteEmailProfile(e,t).then(e=>e(this.axios,this.basePath))}loginEmailProfile(e,t){return EmailProfileServiceApiFp(this.configuration).loginEmailProfile(e,t).then(e=>e(this.axios,this.basePath))}patchEmailProfile(e,t,r){return EmailProfileServiceApiFp(this.configuration).patchEmailProfile(e,t,r).then(e=>e(this.axios,this.basePath))}readEmailProfile(e,t){return EmailProfileServiceApiFp(this.configuration).readEmailProfile(e,t).then(e=>e(this.axios,this.basePath))}searchEmailProfile(e,t,r,i,a,n){return EmailProfileServiceApiFp(this.configuration).searchEmailProfile(e,t,r,i,a,n).then(e=>e(this.axios,this.basePath))}testEmailProfile(e,t){return EmailProfileServiceApiFp(this.configuration).testEmailProfile(e,t).then(e=>e(this.axios,this.basePath))}updateEmailProfile(e,t,r){return EmailProfileServiceApiFp(this.configuration).updateEmailProfile(e,t,r).then(e=>e(this.axios,this.basePath))}}const EmailsApiAxiosParamCreator=function(e){return{deleteEmail:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deleteEmail.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteEmail.");const n="/contacts/{contact_id}/emails/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},deleteEmails:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deleteEmails.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteEmails.");const n="/contacts/{contact_id}/emails".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),r&&(l.etag=r),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},listEmails:async(t,r,i,a,n,s,o,u,c,l,d,p,h={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling listEmails.");const y="/contacts/{contact_id}/emails".replace("{contact_id}",encodeURIComponent(String(t))),g=parse(y,!0);let A;e&&(A=e.baseOptions);const f={method:"GET",...A,...h},m={},w={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;m["X-Webitel-Access"]=t}void 0!==r&&(w.page=r),void 0!==i&&(w.size=i),void 0!==a&&(w.q=a),n&&(w.sort=n),s&&(w.fields=s),o&&(w.id=o),void 0!==u&&(w.primary=u),void 0!==c&&(w.verified=c),void 0!==l&&(w["type.id"]=l),void 0!==d&&(w["type.type"]=d),void 0!==p&&(w["type.name"]=p),g.query={...g.query,...w,...h.query},delete g.search;let b=A&&A.headers?A.headers:{};return f.headers={...m,...b,...h.headers},{url:format(g),options:f}},locateEmail:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling locateEmail.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling locateEmail.");const n="/contacts/{contact_id}/emails/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},mergeEmails:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling mergeEmails.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling mergeEmails.");const n="/contacts/{contact_id}/emails".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"POST",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},resetEmails:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling resetEmails.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling resetEmails.");const n="/contacts/{contact_id}/emails".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},updateEmail:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updateEmail.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updateEmail.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updateEmail.");const s="/contacts/{contact_id}/emails/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PUT",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}},updateEmail2:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updateEmail2.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updateEmail2.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updateEmail2.");const s="/contacts/{contact_id}/emails/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PATCH",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},EmailsApiFp=function(e){return{async deleteEmail(t,r,i,a){const n=await EmailsApiAxiosParamCreator(e).deleteEmail(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async deleteEmails(t,r,i,a){const n=await EmailsApiAxiosParamCreator(e).deleteEmails(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async listEmails(t,r,i,a,n,s,o,u,c,l,d,p,h){const y=await EmailsApiAxiosParamCreator(e).listEmails(t,r,i,a,n,s,o,u,c,l,d,p,h);return(e=globalAxios,t=BASE_PATH)=>{const r={...y.options,url:t+y.url};return e.request(r)}},async locateEmail(t,r,i,a){const n=await EmailsApiAxiosParamCreator(e).locateEmail(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async mergeEmails(t,r,i,a){const n=await EmailsApiAxiosParamCreator(e).mergeEmails(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async resetEmails(t,r,i,a){const n=await EmailsApiAxiosParamCreator(e).resetEmails(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async updateEmail(t,r,i,a,n){const s=await EmailsApiAxiosParamCreator(e).updateEmail(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async updateEmail2(t,r,i,a,n){const s=await EmailsApiAxiosParamCreator(e).updateEmail2(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}}}},EmailsApiFactory=function(e,t,r){return{deleteEmail:(i,a,n,s)=>EmailsApiFp(e).deleteEmail(i,a,n,s).then(e=>e(r,t)),deleteEmails:(i,a,n,s)=>EmailsApiFp(e).deleteEmails(i,a,n,s).then(e=>e(r,t)),listEmails:(i,a,n,s,o,u,c,l,d,p,h,y,g)=>EmailsApiFp(e).listEmails(i,a,n,s,o,u,c,l,d,p,h,y,g).then(e=>e(r,t)),locateEmail:(i,a,n,s)=>EmailsApiFp(e).locateEmail(i,a,n,s).then(e=>e(r,t)),mergeEmails:(i,a,n,s)=>EmailsApiFp(e).mergeEmails(i,a,n,s).then(e=>e(r,t)),resetEmails:(i,a,n,s)=>EmailsApiFp(e).resetEmails(i,a,n,s).then(e=>e(r,t)),updateEmail:(i,a,n,s,o)=>EmailsApiFp(e).updateEmail(i,a,n,s,o).then(e=>e(r,t)),updateEmail2:(i,a,n,s,o)=>EmailsApiFp(e).updateEmail2(i,a,n,s,o).then(e=>e(r,t))}};class EmailsApi extends BaseAPI{deleteEmail(e,t,r,i){return EmailsApiFp(this.configuration).deleteEmail(e,t,r,i).then(e=>e(this.axios,this.basePath))}deleteEmails(e,t,r,i){return EmailsApiFp(this.configuration).deleteEmails(e,t,r,i).then(e=>e(this.axios,this.basePath))}listEmails(e,t,r,i,a,n,s,o,u,c,l,d,p){return EmailsApiFp(this.configuration).listEmails(e,t,r,i,a,n,s,o,u,c,l,d,p).then(e=>e(this.axios,this.basePath))}locateEmail(e,t,r,i){return EmailsApiFp(this.configuration).locateEmail(e,t,r,i).then(e=>e(this.axios,this.basePath))}mergeEmails(e,t,r,i){return EmailsApiFp(this.configuration).mergeEmails(e,t,r,i).then(e=>e(this.axios,this.basePath))}resetEmails(e,t,r,i){return EmailsApiFp(this.configuration).resetEmails(e,t,r,i).then(e=>e(this.axios,this.basePath))}updateEmail(e,t,r,i,a){return EmailsApiFp(this.configuration).updateEmail(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}updateEmail2(e,t,r,i,a){return EmailsApiFp(this.configuration).updateEmail2(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}}const FileServiceApiAxiosParamCreator=function(e){return{deleteFiles:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling deleteFiles.");const i=parse("/storage/file",!0);let a;e&&(a=e.baseOptions);const n={method:"DELETE",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}}}},FileServiceApiFp=function(e){return{async deleteFiles(t,r){const i=await FileServiceApiAxiosParamCreator(e).deleteFiles(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}}}},FileServiceApiFactory=function(e,t,r){return{deleteFiles:(i,a)=>FileServiceApiFp(e).deleteFiles(i,a).then(e=>e(r,t))}};class FileServiceApi extends BaseAPI{deleteFiles(e,t){return FileServiceApiFp(this.configuration).deleteFiles(e,t).then(e=>e(this.axios,this.basePath))}}const FileTranscriptServiceApiAxiosParamCreator=function(e){return{createFileTranscript:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createFileTranscript.");const i=parse("/storage/transcript_file",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteFileTranscript:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling deleteFileTranscript.");const i=parse("/storage/transcript_file",!0);let a;e&&(a=e.baseOptions);const n={method:"DELETE",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},getFileTranscriptPhrases:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling getFileTranscriptPhrases.");const n="/storage/transcript_file/{id}/phrases".replace("{id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==r&&(l.page=r),void 0!==i&&(l.size=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}}}},FileTranscriptServiceApiFp=function(e){return{async createFileTranscript(t,r){const i=await FileTranscriptServiceApiAxiosParamCreator(e).createFileTranscript(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteFileTranscript(t,r){const i=await FileTranscriptServiceApiAxiosParamCreator(e).deleteFileTranscript(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async getFileTranscriptPhrases(t,r,i,a){const n=await FileTranscriptServiceApiAxiosParamCreator(e).getFileTranscriptPhrases(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},FileTranscriptServiceApiFactory=function(e,t,r){return{createFileTranscript:(i,a)=>FileTranscriptServiceApiFp(e).createFileTranscript(i,a).then(e=>e(r,t)),deleteFileTranscript:(i,a)=>FileTranscriptServiceApiFp(e).deleteFileTranscript(i,a).then(e=>e(r,t)),getFileTranscriptPhrases:(i,a,n,s)=>FileTranscriptServiceApiFp(e).getFileTranscriptPhrases(i,a,n,s).then(e=>e(r,t))}};class FileTranscriptServiceApi extends BaseAPI{createFileTranscript(e,t){return FileTranscriptServiceApiFp(this.configuration).createFileTranscript(e,t).then(e=>e(this.axios,this.basePath))}deleteFileTranscript(e,t){return FileTranscriptServiceApiFp(this.configuration).deleteFileTranscript(e,t).then(e=>e(this.axios,this.basePath))}getFileTranscriptPhrases(e,t,r,i){return FileTranscriptServiceApiFp(this.configuration).getFileTranscriptPhrases(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const ImportTemplateServiceApiAxiosParamCreator=function(e){return{createImportTemplate:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createImportTemplate.");const i=parse("/storage/import_templates",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteImportTemplate:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteImportTemplate.");const i="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchImportTemplate:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchImportTemplate.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchImportTemplate.");const a="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readImportTemplate:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readImportTemplate.");const i="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchImportTemplate:async(t,r,i,a,n,s,o={})=>{const u=parse("/storage/import_templates",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateImportTemplate:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateImportTemplate.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateImportTemplate.");const a="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},ImportTemplateServiceApiFp=function(e){return{async createImportTemplate(t,r){const i=await ImportTemplateServiceApiAxiosParamCreator(e).createImportTemplate(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteImportTemplate(t,r){const i=await ImportTemplateServiceApiAxiosParamCreator(e).deleteImportTemplate(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchImportTemplate(t,r,i){const a=await ImportTemplateServiceApiAxiosParamCreator(e).patchImportTemplate(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readImportTemplate(t,r){const i=await ImportTemplateServiceApiAxiosParamCreator(e).readImportTemplate(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchImportTemplate(t,r,i,a,n,s,o){const u=await ImportTemplateServiceApiAxiosParamCreator(e).searchImportTemplate(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateImportTemplate(t,r,i){const a=await ImportTemplateServiceApiAxiosParamCreator(e).updateImportTemplate(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},ImportTemplateServiceApiFactory=function(e,t,r){return{createImportTemplate:(i,a)=>ImportTemplateServiceApiFp(e).createImportTemplate(i,a).then(e=>e(r,t)),deleteImportTemplate:(i,a)=>ImportTemplateServiceApiFp(e).deleteImportTemplate(i,a).then(e=>e(r,t)),patchImportTemplate:(i,a,n)=>ImportTemplateServiceApiFp(e).patchImportTemplate(i,a,n).then(e=>e(r,t)),readImportTemplate:(i,a)=>ImportTemplateServiceApiFp(e).readImportTemplate(i,a).then(e=>e(r,t)),searchImportTemplate:(i,a,n,s,o,u,c)=>ImportTemplateServiceApiFp(e).searchImportTemplate(i,a,n,s,o,u,c).then(e=>e(r,t)),updateImportTemplate:(i,a,n)=>ImportTemplateServiceApiFp(e).updateImportTemplate(i,a,n).then(e=>e(r,t))}};class ImportTemplateServiceApi extends BaseAPI{createImportTemplate(e,t){return ImportTemplateServiceApiFp(this.configuration).createImportTemplate(e,t).then(e=>e(this.axios,this.basePath))}deleteImportTemplate(e,t){return ImportTemplateServiceApiFp(this.configuration).deleteImportTemplate(e,t).then(e=>e(this.axios,this.basePath))}patchImportTemplate(e,t,r){return ImportTemplateServiceApiFp(this.configuration).patchImportTemplate(e,t,r).then(e=>e(this.axios,this.basePath))}readImportTemplate(e,t){return ImportTemplateServiceApiFp(this.configuration).readImportTemplate(e,t).then(e=>e(this.axios,this.basePath))}searchImportTemplate(e,t,r,i,a,n,s){return ImportTemplateServiceApiFp(this.configuration).searchImportTemplate(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateImportTemplate(e,t,r){return ImportTemplateServiceApiFp(this.configuration).updateImportTemplate(e,t,r).then(e=>e(this.axios,this.basePath))}}const LabelsApiAxiosParamCreator=function(e){return{deleteLabels:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deleteLabels.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteLabels.");const n="/contacts/{contact_id}/labels".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),r&&(l.etag=r),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},getLabels:async(t,r,i,a={})=>{const n=parse("/contacts/labels",!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...a},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==t&&(c.page=t),void 0!==r&&(c.size=r),void 0!==i&&(c.q=i),n.query={...n.query,...c,...a.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...a.headers},{url:format(n),options:o}},listLabels:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling listLabels.");const c="/contacts/{contact_id}/labels".replace("{contact_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.q=a),n&&(y.sort=n),s&&(y.fields=s),o&&(y.id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},mergeLabels:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling mergeLabels.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling mergeLabels.");const n="/contacts/{contact_id}/labels".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"POST",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},resetLabels:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling resetLabels.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling resetLabels.");const n="/contacts/{contact_id}/labels".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},LabelsApiFp=function(e){return{async deleteLabels(t,r,i,a){const n=await LabelsApiAxiosParamCreator(e).deleteLabels(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async getLabels(t,r,i,a){const n=await LabelsApiAxiosParamCreator(e).getLabels(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async listLabels(t,r,i,a,n,s,o,u){const c=await LabelsApiAxiosParamCreator(e).listLabels(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async mergeLabels(t,r,i,a){const n=await LabelsApiAxiosParamCreator(e).mergeLabels(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async resetLabels(t,r,i,a){const n=await LabelsApiAxiosParamCreator(e).resetLabels(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},LabelsApiFactory=function(e,t,r){return{deleteLabels:(i,a,n,s)=>LabelsApiFp(e).deleteLabels(i,a,n,s).then(e=>e(r,t)),getLabels:(i,a,n,s)=>LabelsApiFp(e).getLabels(i,a,n,s).then(e=>e(r,t)),listLabels:(i,a,n,s,o,u,c,l)=>LabelsApiFp(e).listLabels(i,a,n,s,o,u,c,l).then(e=>e(r,t)),mergeLabels:(i,a,n,s)=>LabelsApiFp(e).mergeLabels(i,a,n,s).then(e=>e(r,t)),resetLabels:(i,a,n,s)=>LabelsApiFp(e).resetLabels(i,a,n,s).then(e=>e(r,t))}};class LabelsApi extends BaseAPI{deleteLabels(e,t,r,i){return LabelsApiFp(this.configuration).deleteLabels(e,t,r,i).then(e=>e(this.axios,this.basePath))}getLabels(e,t,r,i){return LabelsApiFp(this.configuration).getLabels(e,t,r,i).then(e=>e(this.axios,this.basePath))}listLabels(e,t,r,i,a,n,s,o){return LabelsApiFp(this.configuration).listLabels(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}mergeLabels(e,t,r,i){return LabelsApiFp(this.configuration).mergeLabels(e,t,r,i).then(e=>e(this.axios,this.basePath))}resetLabels(e,t,r,i){return LabelsApiFp(this.configuration).resetLabels(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const ListServiceApiAxiosParamCreator=function(e){return{createList:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createList.");const i=parse("/call_center/list",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},createListCommunication:async(t,r,i={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling createListCommunication.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createListCommunication.");const a="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteList:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteList.");const a="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},deleteListCommunication:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling deleteListCommunication.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteListCommunication.");const n="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},readList:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readList.");const a="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readListCommunication:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling readListCommunication.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readListCommunication.");const n="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchList:async(t,r,i,a,n,s,o={})=>{const u=parse("/call_center/list",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},searchListCommunication:async(t,r,i,a,n,s,o,u,c,l={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling searchListCommunication.");const d="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(t))),p=parse(d,!0);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...l},g={},A={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==r&&(A.page=r),void 0!==i&&(A.size=i),void 0!==a&&(A.q=a),void 0!==n&&(A.sort=n),s&&(A.fields=s),o&&(A.id=o),void 0!==u&&(A["expire_at.from"]=u),void 0!==c&&(A["expire_at.to"]=c),p.query={...p.query,...A,...l.query},delete p.search;let f=h&&h.headers?h.headers:{};return y.headers={...g,...f,...l.headers},{url:format(p),options:y}},updateList:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateList.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateList.");const a="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},updateListCommunication:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling updateListCommunication.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateListCommunication.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateListCommunication.");const n="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},ListServiceApiFp=function(e){return{async createList(t,r){const i=await ListServiceApiAxiosParamCreator(e).createList(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createListCommunication(t,r,i){const a=await ListServiceApiAxiosParamCreator(e).createListCommunication(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteList(t,r,i){const a=await ListServiceApiAxiosParamCreator(e).deleteList(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteListCommunication(t,r,i,a){const n=await ListServiceApiAxiosParamCreator(e).deleteListCommunication(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readList(t,r,i){const a=await ListServiceApiAxiosParamCreator(e).readList(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readListCommunication(t,r,i,a){const n=await ListServiceApiAxiosParamCreator(e).readListCommunication(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchList(t,r,i,a,n,s,o){const u=await ListServiceApiAxiosParamCreator(e).searchList(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async searchListCommunication(t,r,i,a,n,s,o,u,c,l){const d=await ListServiceApiAxiosParamCreator(e).searchListCommunication(t,r,i,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async updateList(t,r,i){const a=await ListServiceApiAxiosParamCreator(e).updateList(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async updateListCommunication(t,r,i,a){const n=await ListServiceApiAxiosParamCreator(e).updateListCommunication(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},ListServiceApiFactory=function(e,t,r){return{createList:(i,a)=>ListServiceApiFp(e).createList(i,a).then(e=>e(r,t)),createListCommunication:(i,a,n)=>ListServiceApiFp(e).createListCommunication(i,a,n).then(e=>e(r,t)),deleteList:(i,a,n)=>ListServiceApiFp(e).deleteList(i,a,n).then(e=>e(r,t)),deleteListCommunication:(i,a,n,s)=>ListServiceApiFp(e).deleteListCommunication(i,a,n,s).then(e=>e(r,t)),readList:(i,a,n)=>ListServiceApiFp(e).readList(i,a,n).then(e=>e(r,t)),readListCommunication:(i,a,n,s)=>ListServiceApiFp(e).readListCommunication(i,a,n,s).then(e=>e(r,t)),searchList:(i,a,n,s,o,u,c)=>ListServiceApiFp(e).searchList(i,a,n,s,o,u,c).then(e=>e(r,t)),searchListCommunication:(i,a,n,s,o,u,c,l,d,p)=>ListServiceApiFp(e).searchListCommunication(i,a,n,s,o,u,c,l,d,p).then(e=>e(r,t)),updateList:(i,a,n)=>ListServiceApiFp(e).updateList(i,a,n).then(e=>e(r,t)),updateListCommunication:(i,a,n,s)=>ListServiceApiFp(e).updateListCommunication(i,a,n,s).then(e=>e(r,t))}};class ListServiceApi extends BaseAPI{createList(e,t){return ListServiceApiFp(this.configuration).createList(e,t).then(e=>e(this.axios,this.basePath))}createListCommunication(e,t,r){return ListServiceApiFp(this.configuration).createListCommunication(e,t,r).then(e=>e(this.axios,this.basePath))}deleteList(e,t,r){return ListServiceApiFp(this.configuration).deleteList(e,t,r).then(e=>e(this.axios,this.basePath))}deleteListCommunication(e,t,r,i){return ListServiceApiFp(this.configuration).deleteListCommunication(e,t,r,i).then(e=>e(this.axios,this.basePath))}readList(e,t,r){return ListServiceApiFp(this.configuration).readList(e,t,r).then(e=>e(this.axios,this.basePath))}readListCommunication(e,t,r,i){return ListServiceApiFp(this.configuration).readListCommunication(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchList(e,t,r,i,a,n,s){return ListServiceApiFp(this.configuration).searchList(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}searchListCommunication(e,t,r,i,a,n,s,o,u,c){return ListServiceApiFp(this.configuration).searchListCommunication(e,t,r,i,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}updateList(e,t,r){return ListServiceApiFp(this.configuration).updateList(e,t,r).then(e=>e(this.axios,this.basePath))}updateListCommunication(e,t,r,i){return ListServiceApiFp(this.configuration).updateListCommunication(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const LoggerServiceApiAxiosParamCreator=function(e){return{searchLogByConfigId:async(t,r,i,a,n,s,o,u,c,l,d,p={})=>{if(null==t)throw new RequiredError("configId","Required parameter configId was null or undefined when calling searchLogByConfigId.");const h="/logger/config/{config_id}/logs".replace("{config_id}",encodeURIComponent(String(t))),y=parse(h,!0);let g;e&&(g=e.baseOptions);const A={method:"GET",...g,...p},f={},m={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;f["X-Webitel-Access"]=t}void 0!==r&&(m.page=r),void 0!==i&&(m.size=i),void 0!==a&&(m.q=a),void 0!==n&&(m.sort=n),s&&(m.fields=s),o&&(m.user_id=o),u&&(m.action=u),void 0!==c&&(m.user_ip=c),void 0!==l&&(m.date_from=l),void 0!==d&&(m.date_to=d),y.query={...y.query,...m,...p.query},delete y.search;let w=g&&g.headers?g.headers:{};return A.headers={...f,...w,...p.headers},{url:format(y),options:A}},searchLogByRecordId:async(t,r,i,a,n,s,o,u,c,l,d,p,h={})=>{if(null==t)throw new RequiredError("object","Required parameter object was null or undefined when calling searchLogByRecordId.");if(null==r)throw new RequiredError("recordId","Required parameter recordId was null or undefined when calling searchLogByRecordId.");const y="/logger/{object}/record/{record_id}/logs".replace("{object}",encodeURIComponent(String(t))).replace("{record_id}",encodeURIComponent(String(r))),g=parse(y,!0);let A;e&&(A=e.baseOptions);const f={method:"GET",...A,...h},m={},w={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;m["X-Webitel-Access"]=t}void 0!==i&&(w.page=i),void 0!==a&&(w.size=a),void 0!==n&&(w.q=n),void 0!==s&&(w.sort=s),o&&(w.fields=o),u&&(w.action=u),c&&(w.user_id=c),void 0!==l&&(w.user_ip=l),void 0!==d&&(w.date_from=d),void 0!==p&&(w.date_to=p),g.query={...g.query,...w,...h.query},delete g.search;let b=A&&A.headers?A.headers:{};return f.headers={...m,...b,...h.headers},{url:format(g),options:f}},searchLogByUserId:async(t,r,i,a,n,s,o,u,c,l,d,p={})=>{if(null==t)throw new RequiredError("userId","Required parameter userId was null or undefined when calling searchLogByUserId.");const h="/logger/user/{user_id}/logs".replace("{user_id}",encodeURIComponent(String(t))),y=parse(h,!0);let g;e&&(g=e.baseOptions);const A={method:"GET",...g,...p},f={},m={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;f["X-Webitel-Access"]=t}void 0!==r&&(m.page=r),void 0!==i&&(m.size=i),void 0!==a&&(m.q=a),void 0!==n&&(m.sort=n),s&&(m.fields=s),o&&(m.object_id=o),u&&(m.action=u),void 0!==c&&(m.user_ip=c),void 0!==l&&(m.date_from=l),void 0!==d&&(m.date_to=d),y.query={...y.query,...m,...p.query},delete y.search;let w=g&&g.headers?g.headers:{};return A.headers={...f,...w,...p.headers},{url:format(y),options:A}}}},LoggerServiceApiFp=function(e){return{async searchLogByConfigId(t,r,i,a,n,s,o,u,c,l,d,p){const h=await LoggerServiceApiAxiosParamCreator(e).searchLogByConfigId(t,r,i,a,n,s,o,u,c,l,d,p);return(e=globalAxios,t=BASE_PATH)=>{const r={...h.options,url:t+h.url};return e.request(r)}},async searchLogByRecordId(t,r,i,a,n,s,o,u,c,l,d,p,h){const y=await LoggerServiceApiAxiosParamCreator(e).searchLogByRecordId(t,r,i,a,n,s,o,u,c,l,d,p,h);return(e=globalAxios,t=BASE_PATH)=>{const r={...y.options,url:t+y.url};return e.request(r)}},async searchLogByUserId(t,r,i,a,n,s,o,u,c,l,d,p){const h=await LoggerServiceApiAxiosParamCreator(e).searchLogByUserId(t,r,i,a,n,s,o,u,c,l,d,p);return(e=globalAxios,t=BASE_PATH)=>{const r={...h.options,url:t+h.url};return e.request(r)}}}},LoggerServiceApiFactory=function(e,t,r){return{searchLogByConfigId:(i,a,n,s,o,u,c,l,d,p,h,y)=>LoggerServiceApiFp(e).searchLogByConfigId(i,a,n,s,o,u,c,l,d,p,h,y).then(e=>e(r,t)),searchLogByRecordId:(i,a,n,s,o,u,c,l,d,p,h,y,g)=>LoggerServiceApiFp(e).searchLogByRecordId(i,a,n,s,o,u,c,l,d,p,h,y,g).then(e=>e(r,t)),searchLogByUserId:(i,a,n,s,o,u,c,l,d,p,h,y)=>LoggerServiceApiFp(e).searchLogByUserId(i,a,n,s,o,u,c,l,d,p,h,y).then(e=>e(r,t))}};class LoggerServiceApi extends BaseAPI{searchLogByConfigId(e,t,r,i,a,n,s,o,u,c,l,d){return LoggerServiceApiFp(this.configuration).searchLogByConfigId(e,t,r,i,a,n,s,o,u,c,l,d).then(e=>e(this.axios,this.basePath))}searchLogByRecordId(e,t,r,i,a,n,s,o,u,c,l,d,p){return LoggerServiceApiFp(this.configuration).searchLogByRecordId(e,t,r,i,a,n,s,o,u,c,l,d,p).then(e=>e(this.axios,this.basePath))}searchLogByUserId(e,t,r,i,a,n,s,o,u,c,l,d){return LoggerServiceApiFp(this.configuration).searchLogByUserId(e,t,r,i,a,n,s,o,u,c,l,d).then(e=>e(this.axios,this.basePath))}}const ManagersApiAxiosParamCreator=function(e){return{deleteManager:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deleteManager.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteManager.");const n="/contacts/{contact_id}/managers/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},deleteManagers:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deleteManagers.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteManagers.");const n="/contacts/{contact_id}/managers".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),r&&(l.etag=r),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},listManagers:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling listManagers.");const c="/contacts/{contact_id}/managers".replace("{contact_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.q=a),n&&(y.sort=n),s&&(y.fields=s),o&&(y.id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},locateManager:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling locateManager.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling locateManager.");const n="/contacts/{contact_id}/managers/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},mergeManagers:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling mergeManagers.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling mergeManagers.");const n="/contacts/{contact_id}/managers".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"POST",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},resetManagers:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling resetManagers.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling resetManagers.");const n="/contacts/{contact_id}/managers".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},updateManager:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updateManager.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updateManager.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updateManager.");const s="/contacts/{contact_id}/managers/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PUT",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}},updateManager2:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updateManager2.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updateManager2.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updateManager2.");const s="/contacts/{contact_id}/managers/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PATCH",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},ManagersApiFp=function(e){return{async deleteManager(t,r,i,a){const n=await ManagersApiAxiosParamCreator(e).deleteManager(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async deleteManagers(t,r,i,a){const n=await ManagersApiAxiosParamCreator(e).deleteManagers(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async listManagers(t,r,i,a,n,s,o,u){const c=await ManagersApiAxiosParamCreator(e).listManagers(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async locateManager(t,r,i,a){const n=await ManagersApiAxiosParamCreator(e).locateManager(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async mergeManagers(t,r,i,a){const n=await ManagersApiAxiosParamCreator(e).mergeManagers(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async resetManagers(t,r,i,a){const n=await ManagersApiAxiosParamCreator(e).resetManagers(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async updateManager(t,r,i,a,n){const s=await ManagersApiAxiosParamCreator(e).updateManager(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async updateManager2(t,r,i,a,n){const s=await ManagersApiAxiosParamCreator(e).updateManager2(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}}}},ManagersApiFactory=function(e,t,r){return{deleteManager:(i,a,n,s)=>ManagersApiFp(e).deleteManager(i,a,n,s).then(e=>e(r,t)),deleteManagers:(i,a,n,s)=>ManagersApiFp(e).deleteManagers(i,a,n,s).then(e=>e(r,t)),listManagers:(i,a,n,s,o,u,c,l)=>ManagersApiFp(e).listManagers(i,a,n,s,o,u,c,l).then(e=>e(r,t)),locateManager:(i,a,n,s)=>ManagersApiFp(e).locateManager(i,a,n,s).then(e=>e(r,t)),mergeManagers:(i,a,n,s)=>ManagersApiFp(e).mergeManagers(i,a,n,s).then(e=>e(r,t)),resetManagers:(i,a,n,s)=>ManagersApiFp(e).resetManagers(i,a,n,s).then(e=>e(r,t)),updateManager:(i,a,n,s,o)=>ManagersApiFp(e).updateManager(i,a,n,s,o).then(e=>e(r,t)),updateManager2:(i,a,n,s,o)=>ManagersApiFp(e).updateManager2(i,a,n,s,o).then(e=>e(r,t))}};class ManagersApi extends BaseAPI{deleteManager(e,t,r,i){return ManagersApiFp(this.configuration).deleteManager(e,t,r,i).then(e=>e(this.axios,this.basePath))}deleteManagers(e,t,r,i){return ManagersApiFp(this.configuration).deleteManagers(e,t,r,i).then(e=>e(this.axios,this.basePath))}listManagers(e,t,r,i,a,n,s,o){return ManagersApiFp(this.configuration).listManagers(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}locateManager(e,t,r,i){return ManagersApiFp(this.configuration).locateManager(e,t,r,i).then(e=>e(this.axios,this.basePath))}mergeManagers(e,t,r,i){return ManagersApiFp(this.configuration).mergeManagers(e,t,r,i).then(e=>e(this.axios,this.basePath))}resetManagers(e,t,r,i){return ManagersApiFp(this.configuration).resetManagers(e,t,r,i).then(e=>e(this.axios,this.basePath))}updateManager(e,t,r,i,a){return ManagersApiFp(this.configuration).updateManager(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}updateManager2(e,t,r,i,a){return ManagersApiFp(this.configuration).updateManager2(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}}const MediaFileServiceApiAxiosParamCreator=function(e){return{deleteMediaFile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteMediaFile.");const a="/storage/media/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readMediaFile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readMediaFile.");const a="/storage/media/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchMediaFile:async(t,r,i,a,n,s,o={})=>{const u=parse("/storage/media",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}}}},MediaFileServiceApiFp=function(e){return{async deleteMediaFile(t,r,i){const a=await MediaFileServiceApiAxiosParamCreator(e).deleteMediaFile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readMediaFile(t,r,i){const a=await MediaFileServiceApiAxiosParamCreator(e).readMediaFile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchMediaFile(t,r,i,a,n,s,o){const u=await MediaFileServiceApiAxiosParamCreator(e).searchMediaFile(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}}}},MediaFileServiceApiFactory=function(e,t,r){return{deleteMediaFile:(i,a,n)=>MediaFileServiceApiFp(e).deleteMediaFile(i,a,n).then(e=>e(r,t)),readMediaFile:(i,a,n)=>MediaFileServiceApiFp(e).readMediaFile(i,a,n).then(e=>e(r,t)),searchMediaFile:(i,a,n,s,o,u,c)=>MediaFileServiceApiFp(e).searchMediaFile(i,a,n,s,o,u,c).then(e=>e(r,t))}};class MediaFileServiceApi extends BaseAPI{deleteMediaFile(e,t,r){return MediaFileServiceApiFp(this.configuration).deleteMediaFile(e,t,r).then(e=>e(this.axios,this.basePath))}readMediaFile(e,t,r){return MediaFileServiceApiFp(this.configuration).readMediaFile(e,t,r).then(e=>e(this.axios,this.basePath))}searchMediaFile(e,t,r,i,a,n,s){return MediaFileServiceApiFp(this.configuration).searchMediaFile(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}}const MemberServiceApiAxiosParamCreator=function(e){return{attemptCallback:async(t,r,i={})=>{if(null==t)throw new RequiredError("attemptId","Required parameter attemptId was null or undefined when calling attemptCallback.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling attemptCallback.");const a="/call_center/attempts/{attempt_id}".replace("{attempt_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},attemptResult:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling attemptResult.");if(null==r)throw new RequiredError("memberId","Required parameter memberId was null or undefined when calling attemptResult.");if(null==i)throw new RequiredError("attemptId","Required parameter attemptId was null or undefined when calling attemptResult.");if(null==a)throw new RequiredError("body","Required parameter body was null or undefined when calling attemptResult.");const s="/call_center/queues/{queue_id}/members/{member_id}/attempts/{attempt_id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{member_id}",encodeURIComponent(String(r))).replace("{attempt_id}",encodeURIComponent(String(i))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PATCH",...u,...n},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}l["Content-Type"]="application/json",o.query={...o.query,...n.query},delete o.search;let d=u&&u.headers?u.headers:{};c.headers={...l,...d,...n.headers};const p="string"!=typeof a||"application/json"===c.headers["Content-Type"];return c.data=p?JSON.stringify(void 0!==a?a:{}):a||"",{url:format(o),options:c}},attemptsRenewalResult:async(t,r,i={})=>{if(null==t)throw new RequiredError("attemptId","Required parameter attemptId was null or undefined when calling attemptsRenewalResult.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling attemptsRenewalResult.");const a="/call_center/queues/attempts/{attempt_id}/renewal".replace("{attempt_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},createAttempt:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createAttempt.");if(null==r)throw new RequiredError("memberId","Required parameter memberId was null or undefined when calling createAttempt.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling createAttempt.");const n="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(t))).replace("{member_id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"POST",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},createMember:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createMember.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createMember.");const a="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},createMemberBulk:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createMemberBulk.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createMemberBulk.");const a="/call_center/queues/{queue_id}/members/bulk".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteMember:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteMember.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteMember.");const n="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},deleteMembers:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteMembers.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling deleteMembers.");const a="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},patchMember:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchMember.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling patchMember.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling patchMember.");const n="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},readMember:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readMember.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readMember.");const n="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},resetMembers:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling resetMembers.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling resetMembers.");const a="/call_center/queues/{queue_id}/members/reset".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},searchAttempts:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b={})=>{const S=parse("/call_center/queues/attempts/active",!0);let q;e&&(q=e.baseOptions);const v={method:"GET",...q,...b},C={},R={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;C["X-Webitel-Access"]=t}void 0!==t&&(R.page=t),void 0!==r&&(R.size=r),void 0!==i&&(R.q=i),void 0!==a&&(R.sort=a),n&&(R.fields=n),void 0!==s&&(R["joined_at.from"]=s),void 0!==o&&(R["joined_at.to"]=o),u&&(R.id=u),c&&(R.queue_id=c),l&&(R.bucket_id=l),d&&(R.member_id=d),p&&(R.agent_id=p),h&&(R.result=h),void 0!==y&&(R["leaving_at.from"]=y),void 0!==g&&(R["leaving_at.to"]=g),void 0!==A&&(R["offering_at.from"]=A),void 0!==f&&(R["offering_at.to"]=f),void 0!==m&&(R["duration.from"]=m),void 0!==w&&(R["duration.to"]=w),S.query={...S.query,...R,...b.query},delete S.search;let P=q&&q.headers?q.headers:{};return v.headers={...C,...P,...b.headers},{url:format(S),options:v}},searchAttemptsHistory:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b={})=>{const S=parse("/call_center/queues/attempts/history",!0);let q;e&&(q=e.baseOptions);const v={method:"GET",...q,...b},C={},R={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;C["X-Webitel-Access"]=t}void 0!==t&&(R.page=t),void 0!==r&&(R.size=r),void 0!==i&&(R.q=i),void 0!==a&&(R.sort=a),n&&(R.fields=n),void 0!==s&&(R["joined_at.from"]=s),void 0!==o&&(R["joined_at.to"]=o),u&&(R.id=u),c&&(R.queue_id=c),l&&(R.bucket_id=l),d&&(R.member_id=d),p&&(R.agent_id=p),h&&(R.result=h),void 0!==y&&(R["leaving_at.from"]=y),void 0!==g&&(R["leaving_at.to"]=g),void 0!==A&&(R["offering_at.from"]=A),void 0!==f&&(R["offering_at.to"]=f),void 0!==m&&(R["duration.from"]=m),void 0!==w&&(R["duration.to"]=w),S.query={...S.query,...R,...b.query},delete S.search;let P=q&&q.headers?q.headers:{};return v.headers={...C,...P,...b.headers},{url:format(S),options:v}},searchMemberAttempts:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchMemberAttempts.");if(null==r)throw new RequiredError("memberId","Required parameter memberId was null or undefined when calling searchMemberAttempts.");const n="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(t))).replace("{member_id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchMemberInQueue:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchMemberInQueue.");const q="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(t))),v=parse(q,!0);let C;e&&(C=e.baseOptions);const R={method:"GET",...C,...S},P={},T={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;P["X-Webitel-Access"]=t}void 0!==r&&(T.page=r),void 0!==i&&(T.size=i),void 0!==a&&(T.q=a),void 0!==n&&(T.sort=n),s&&(T.fields=s),o&&(T.id=o),u&&(T.bucket_id=u),void 0!==c&&(T.destination=c),void 0!==l&&(T["created_at.from"]=l),void 0!==d&&(T["created_at.to"]=d),void 0!==p&&(T["offering_at.from"]=p),void 0!==h&&(T["offering_at.to"]=h),y&&(T.stop_cause=y),void 0!==g&&(T["priority.from"]=g),void 0!==A&&(T["priority.to"]=A),void 0!==f&&(T.name=f),void 0!==m&&(T["attempts.from"]=m),void 0!==w&&(T["attempts.to"]=w),b&&(T.agent_id=b),v.query={...v.query,...T,...S.query},delete v.search;let E=C&&C.headers?C.headers:{};return R.headers={...P,...E,...S.headers},{url:format(v),options:R}},searchMembers:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S={})=>{const q=parse("/call_center/members",!0);let v;e&&(v=e.baseOptions);const C={method:"GET",...v,...S},R={},P={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;R["X-Webitel-Access"]=t}void 0!==t&&(P.page=t),void 0!==r&&(P.size=r),void 0!==i&&(P.q=i),void 0!==a&&(P.sort=a),n&&(P.fields=n),s&&(P.id=s),o&&(P.queue_id=o),u&&(P.bucket_id=u),void 0!==c&&(P.destination=c),void 0!==l&&(P["created_at.from"]=l),void 0!==d&&(P["created_at.to"]=d),void 0!==p&&(P["offering_at.from"]=p),void 0!==h&&(P["offering_at.to"]=h),y&&(P.stop_cause=y),void 0!==g&&(P["priority.from"]=g),void 0!==A&&(P["priority.to"]=A),void 0!==f&&(P.name=f),void 0!==m&&(P["attempts.from"]=m),void 0!==w&&(P["attempts.to"]=w),b&&(P.agent_id=b),q.query={...q.query,...P,...S.query},delete q.search;let T=v&&v.headers?v.headers:{};return C.headers={...R,...T,...S.headers},{url:format(q),options:C}},updateMember:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateMember.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateMember.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateMember.");const n="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},MemberServiceApiFp=function(e){return{async attemptCallback(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).attemptCallback(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async attemptResult(t,r,i,a,n){const s=await MemberServiceApiAxiosParamCreator(e).attemptResult(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async attemptsRenewalResult(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).attemptsRenewalResult(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async createAttempt(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).createAttempt(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async createMember(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).createMember(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async createMemberBulk(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).createMemberBulk(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteMember(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).deleteMember(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async deleteMembers(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).deleteMembers(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchMember(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).patchMember(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readMember(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).readMember(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async resetMembers(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).resetMembers(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchAttempts(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b){const S=await MemberServiceApiAxiosParamCreator(e).searchAttempts(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b);return(e=globalAxios,t=BASE_PATH)=>{const r={...S.options,url:t+S.url};return e.request(r)}},async searchAttemptsHistory(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b){const S=await MemberServiceApiAxiosParamCreator(e).searchAttemptsHistory(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b);return(e=globalAxios,t=BASE_PATH)=>{const r={...S.options,url:t+S.url};return e.request(r)}},async searchMemberAttempts(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).searchMemberAttempts(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchMemberInQueue(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S){const q=await MemberServiceApiAxiosParamCreator(e).searchMemberInQueue(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S);return(e=globalAxios,t=BASE_PATH)=>{const r={...q.options,url:t+q.url};return e.request(r)}},async searchMembers(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S){const q=await MemberServiceApiAxiosParamCreator(e).searchMembers(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S);return(e=globalAxios,t=BASE_PATH)=>{const r={...q.options,url:t+q.url};return e.request(r)}},async updateMember(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).updateMember(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},MemberServiceApiFactory=function(e,t,r){return{attemptCallback:(i,a,n)=>MemberServiceApiFp(e).attemptCallback(i,a,n).then(e=>e(r,t)),attemptResult:(i,a,n,s,o)=>MemberServiceApiFp(e).attemptResult(i,a,n,s,o).then(e=>e(r,t)),attemptsRenewalResult:(i,a,n)=>MemberServiceApiFp(e).attemptsRenewalResult(i,a,n).then(e=>e(r,t)),createAttempt:(i,a,n,s)=>MemberServiceApiFp(e).createAttempt(i,a,n,s).then(e=>e(r,t)),createMember:(i,a,n)=>MemberServiceApiFp(e).createMember(i,a,n).then(e=>e(r,t)),createMemberBulk:(i,a,n)=>MemberServiceApiFp(e).createMemberBulk(i,a,n).then(e=>e(r,t)),deleteMember:(i,a,n,s)=>MemberServiceApiFp(e).deleteMember(i,a,n,s).then(e=>e(r,t)),deleteMembers:(i,a,n)=>MemberServiceApiFp(e).deleteMembers(i,a,n).then(e=>e(r,t)),patchMember:(i,a,n,s)=>MemberServiceApiFp(e).patchMember(i,a,n,s).then(e=>e(r,t)),readMember:(i,a,n,s)=>MemberServiceApiFp(e).readMember(i,a,n,s).then(e=>e(r,t)),resetMembers:(i,a,n)=>MemberServiceApiFp(e).resetMembers(i,a,n).then(e=>e(r,t)),searchAttempts:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q)=>MemberServiceApiFp(e).searchAttempts(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q).then(e=>e(r,t)),searchAttemptsHistory:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q)=>MemberServiceApiFp(e).searchAttemptsHistory(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q).then(e=>e(r,t)),searchMemberAttempts:(i,a,n,s)=>MemberServiceApiFp(e).searchMemberAttempts(i,a,n,s).then(e=>e(r,t)),searchMemberInQueue:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q,v)=>MemberServiceApiFp(e).searchMemberInQueue(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q,v).then(e=>e(r,t)),searchMembers:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q,v)=>MemberServiceApiFp(e).searchMembers(i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b,S,q,v).then(e=>e(r,t)),updateMember:(i,a,n,s)=>MemberServiceApiFp(e).updateMember(i,a,n,s).then(e=>e(r,t))}};class MemberServiceApi extends BaseAPI{attemptCallback(e,t,r){return MemberServiceApiFp(this.configuration).attemptCallback(e,t,r).then(e=>e(this.axios,this.basePath))}attemptResult(e,t,r,i,a){return MemberServiceApiFp(this.configuration).attemptResult(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}attemptsRenewalResult(e,t,r){return MemberServiceApiFp(this.configuration).attemptsRenewalResult(e,t,r).then(e=>e(this.axios,this.basePath))}createAttempt(e,t,r,i){return MemberServiceApiFp(this.configuration).createAttempt(e,t,r,i).then(e=>e(this.axios,this.basePath))}createMember(e,t,r){return MemberServiceApiFp(this.configuration).createMember(e,t,r).then(e=>e(this.axios,this.basePath))}createMemberBulk(e,t,r){return MemberServiceApiFp(this.configuration).createMemberBulk(e,t,r).then(e=>e(this.axios,this.basePath))}deleteMember(e,t,r,i){return MemberServiceApiFp(this.configuration).deleteMember(e,t,r,i).then(e=>e(this.axios,this.basePath))}deleteMembers(e,t,r){return MemberServiceApiFp(this.configuration).deleteMembers(e,t,r).then(e=>e(this.axios,this.basePath))}patchMember(e,t,r,i){return MemberServiceApiFp(this.configuration).patchMember(e,t,r,i).then(e=>e(this.axios,this.basePath))}readMember(e,t,r,i){return MemberServiceApiFp(this.configuration).readMember(e,t,r,i).then(e=>e(this.axios,this.basePath))}resetMembers(e,t,r){return MemberServiceApiFp(this.configuration).resetMembers(e,t,r).then(e=>e(this.axios,this.basePath))}searchAttempts(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w){return MemberServiceApiFp(this.configuration).searchAttempts(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w).then(e=>e(this.axios,this.basePath))}searchAttemptsHistory(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w){return MemberServiceApiFp(this.configuration).searchAttemptsHistory(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w).then(e=>e(this.axios,this.basePath))}searchMemberAttempts(e,t,r,i){return MemberServiceApiFp(this.configuration).searchMemberAttempts(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchMemberInQueue(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b){return MemberServiceApiFp(this.configuration).searchMemberInQueue(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b).then(e=>e(this.axios,this.basePath))}searchMembers(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b){return MemberServiceApiFp(this.configuration).searchMembers(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,f,m,w,b).then(e=>e(this.axios,this.basePath))}updateMember(e,t,r,i){return MemberServiceApiFp(this.configuration).updateMember(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const OutboundResourceGroupServiceApiAxiosParamCreator=function(e){return{createOutboundResourceGroup:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createOutboundResourceGroup.");const i=parse("/call_center/resource_group",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},createOutboundResourceInGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling createOutboundResourceInGroup.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createOutboundResourceInGroup.");const a="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteOutboundResourceGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteOutboundResourceGroup.");const a="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},deleteOutboundResourceInGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling deleteOutboundResourceInGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteOutboundResourceInGroup.");const n="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},readOutboundResourceGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readOutboundResourceGroup.");const a="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readOutboundResourceInGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling readOutboundResourceInGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readOutboundResourceInGroup.");const n="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchOutboundResourceGroup:async(t,r,i,a,n,s,o={})=>{const u=parse("/call_center/resource_group",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},searchOutboundResourceInGroup:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling searchOutboundResourceInGroup.");const c="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.q=a),void 0!==n&&(y.sort=n),s&&(y.fields=s),o&&(y.id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},updateOutboundResourceGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResourceGroup.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateOutboundResourceGroup.");const a="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},updateOutboundResourceInGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling updateOutboundResourceInGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResourceInGroup.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateOutboundResourceInGroup.");const n="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},OutboundResourceGroupServiceApiFp=function(e){return{async createOutboundResourceGroup(t,r){const i=await OutboundResourceGroupServiceApiAxiosParamCreator(e).createOutboundResourceGroup(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createOutboundResourceInGroup(t,r,i){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).createOutboundResourceInGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteOutboundResourceGroup(t,r,i){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).deleteOutboundResourceGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteOutboundResourceInGroup(t,r,i,a){const n=await OutboundResourceGroupServiceApiAxiosParamCreator(e).deleteOutboundResourceInGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readOutboundResourceGroup(t,r,i){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).readOutboundResourceGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readOutboundResourceInGroup(t,r,i,a){const n=await OutboundResourceGroupServiceApiAxiosParamCreator(e).readOutboundResourceInGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchOutboundResourceGroup(t,r,i,a,n,s,o){const u=await OutboundResourceGroupServiceApiAxiosParamCreator(e).searchOutboundResourceGroup(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async searchOutboundResourceInGroup(t,r,i,a,n,s,o,u){const c=await OutboundResourceGroupServiceApiAxiosParamCreator(e).searchOutboundResourceInGroup(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async updateOutboundResourceGroup(t,r,i){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).updateOutboundResourceGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async updateOutboundResourceInGroup(t,r,i,a){const n=await OutboundResourceGroupServiceApiAxiosParamCreator(e).updateOutboundResourceInGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},OutboundResourceGroupServiceApiFactory=function(e,t,r){return{createOutboundResourceGroup:(i,a)=>OutboundResourceGroupServiceApiFp(e).createOutboundResourceGroup(i,a).then(e=>e(r,t)),createOutboundResourceInGroup:(i,a,n)=>OutboundResourceGroupServiceApiFp(e).createOutboundResourceInGroup(i,a,n).then(e=>e(r,t)),deleteOutboundResourceGroup:(i,a,n)=>OutboundResourceGroupServiceApiFp(e).deleteOutboundResourceGroup(i,a,n).then(e=>e(r,t)),deleteOutboundResourceInGroup:(i,a,n,s)=>OutboundResourceGroupServiceApiFp(e).deleteOutboundResourceInGroup(i,a,n,s).then(e=>e(r,t)),readOutboundResourceGroup:(i,a,n)=>OutboundResourceGroupServiceApiFp(e).readOutboundResourceGroup(i,a,n).then(e=>e(r,t)),readOutboundResourceInGroup:(i,a,n,s)=>OutboundResourceGroupServiceApiFp(e).readOutboundResourceInGroup(i,a,n,s).then(e=>e(r,t)),searchOutboundResourceGroup:(i,a,n,s,o,u,c)=>OutboundResourceGroupServiceApiFp(e).searchOutboundResourceGroup(i,a,n,s,o,u,c).then(e=>e(r,t)),searchOutboundResourceInGroup:(i,a,n,s,o,u,c,l)=>OutboundResourceGroupServiceApiFp(e).searchOutboundResourceInGroup(i,a,n,s,o,u,c,l).then(e=>e(r,t)),updateOutboundResourceGroup:(i,a,n)=>OutboundResourceGroupServiceApiFp(e).updateOutboundResourceGroup(i,a,n).then(e=>e(r,t)),updateOutboundResourceInGroup:(i,a,n,s)=>OutboundResourceGroupServiceApiFp(e).updateOutboundResourceInGroup(i,a,n,s).then(e=>e(r,t))}};class OutboundResourceGroupServiceApi extends BaseAPI{createOutboundResourceGroup(e,t){return OutboundResourceGroupServiceApiFp(this.configuration).createOutboundResourceGroup(e,t).then(e=>e(this.axios,this.basePath))}createOutboundResourceInGroup(e,t,r){return OutboundResourceGroupServiceApiFp(this.configuration).createOutboundResourceInGroup(e,t,r).then(e=>e(this.axios,this.basePath))}deleteOutboundResourceGroup(e,t,r){return OutboundResourceGroupServiceApiFp(this.configuration).deleteOutboundResourceGroup(e,t,r).then(e=>e(this.axios,this.basePath))}deleteOutboundResourceInGroup(e,t,r,i){return OutboundResourceGroupServiceApiFp(this.configuration).deleteOutboundResourceInGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}readOutboundResourceGroup(e,t,r){return OutboundResourceGroupServiceApiFp(this.configuration).readOutboundResourceGroup(e,t,r).then(e=>e(this.axios,this.basePath))}readOutboundResourceInGroup(e,t,r,i){return OutboundResourceGroupServiceApiFp(this.configuration).readOutboundResourceInGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchOutboundResourceGroup(e,t,r,i,a,n,s){return OutboundResourceGroupServiceApiFp(this.configuration).searchOutboundResourceGroup(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}searchOutboundResourceInGroup(e,t,r,i,a,n,s,o){return OutboundResourceGroupServiceApiFp(this.configuration).searchOutboundResourceInGroup(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateOutboundResourceGroup(e,t,r){return OutboundResourceGroupServiceApiFp(this.configuration).updateOutboundResourceGroup(e,t,r).then(e=>e(this.axios,this.basePath))}updateOutboundResourceInGroup(e,t,r,i){return OutboundResourceGroupServiceApiFp(this.configuration).updateOutboundResourceInGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const OutboundResourceServiceApiAxiosParamCreator=function(e){return{createOutboundResource:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createOutboundResource.");const i=parse("/call_center/resources",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},createOutboundResourceDisplay:async(t,r,i={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling createOutboundResourceDisplay.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createOutboundResourceDisplay.");const a="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},createOutboundResourceDisplayBulk:async(t,r,i={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling createOutboundResourceDisplayBulk.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createOutboundResourceDisplayBulk.");const a="/call_center/resources/{resource_id}/display/bulk".replace("{resource_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteOutboundResource:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteOutboundResource.");const a="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},deleteOutboundResourceDisplay:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling deleteOutboundResourceDisplay.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteOutboundResourceDisplay.");const n="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},deleteOutboundResourceDisplays:async(t,r,i={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling deleteOutboundResourceDisplays.");const a="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}r&&(c.items=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},patchOutboundResource:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchOutboundResource.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchOutboundResource.");const a="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readOutboundResource:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readOutboundResource.");const a="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readOutboundResourceDisplay:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling readOutboundResourceDisplay.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readOutboundResourceDisplay.");const n="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchOutboundResource:async(t,r,i,a,n,s,o={})=>{const u=parse("/call_center/resources",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},searchOutboundResourceDisplay:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling searchOutboundResourceDisplay.");const c="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.q=a),void 0!==n&&(y.sort=n),s&&(y.fields=s),o&&(y.id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},updateOutboundResource:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResource.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateOutboundResource.");const a="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},updateOutboundResourceDisplay:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling updateOutboundResourceDisplay.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResourceDisplay.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateOutboundResourceDisplay.");const n="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},OutboundResourceServiceApiFp=function(e){return{async createOutboundResource(t,r){const i=await OutboundResourceServiceApiAxiosParamCreator(e).createOutboundResource(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createOutboundResourceDisplay(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).createOutboundResourceDisplay(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async createOutboundResourceDisplayBulk(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).createOutboundResourceDisplayBulk(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteOutboundResource(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).deleteOutboundResource(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteOutboundResourceDisplay(t,r,i,a){const n=await OutboundResourceServiceApiAxiosParamCreator(e).deleteOutboundResourceDisplay(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async deleteOutboundResourceDisplays(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).deleteOutboundResourceDisplays(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchOutboundResource(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).patchOutboundResource(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readOutboundResource(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).readOutboundResource(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readOutboundResourceDisplay(t,r,i,a){const n=await OutboundResourceServiceApiAxiosParamCreator(e).readOutboundResourceDisplay(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchOutboundResource(t,r,i,a,n,s,o){const u=await OutboundResourceServiceApiAxiosParamCreator(e).searchOutboundResource(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async searchOutboundResourceDisplay(t,r,i,a,n,s,o,u){const c=await OutboundResourceServiceApiAxiosParamCreator(e).searchOutboundResourceDisplay(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async updateOutboundResource(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).updateOutboundResource(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async updateOutboundResourceDisplay(t,r,i,a){const n=await OutboundResourceServiceApiAxiosParamCreator(e).updateOutboundResourceDisplay(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},OutboundResourceServiceApiFactory=function(e,t,r){return{createOutboundResource:(i,a)=>OutboundResourceServiceApiFp(e).createOutboundResource(i,a).then(e=>e(r,t)),createOutboundResourceDisplay:(i,a,n)=>OutboundResourceServiceApiFp(e).createOutboundResourceDisplay(i,a,n).then(e=>e(r,t)),createOutboundResourceDisplayBulk:(i,a,n)=>OutboundResourceServiceApiFp(e).createOutboundResourceDisplayBulk(i,a,n).then(e=>e(r,t)),deleteOutboundResource:(i,a,n)=>OutboundResourceServiceApiFp(e).deleteOutboundResource(i,a,n).then(e=>e(r,t)),deleteOutboundResourceDisplay:(i,a,n,s)=>OutboundResourceServiceApiFp(e).deleteOutboundResourceDisplay(i,a,n,s).then(e=>e(r,t)),deleteOutboundResourceDisplays:(i,a,n)=>OutboundResourceServiceApiFp(e).deleteOutboundResourceDisplays(i,a,n).then(e=>e(r,t)),patchOutboundResource:(i,a,n)=>OutboundResourceServiceApiFp(e).patchOutboundResource(i,a,n).then(e=>e(r,t)),readOutboundResource:(i,a,n)=>OutboundResourceServiceApiFp(e).readOutboundResource(i,a,n).then(e=>e(r,t)),readOutboundResourceDisplay:(i,a,n,s)=>OutboundResourceServiceApiFp(e).readOutboundResourceDisplay(i,a,n,s).then(e=>e(r,t)),searchOutboundResource:(i,a,n,s,o,u,c)=>OutboundResourceServiceApiFp(e).searchOutboundResource(i,a,n,s,o,u,c).then(e=>e(r,t)),searchOutboundResourceDisplay:(i,a,n,s,o,u,c,l)=>OutboundResourceServiceApiFp(e).searchOutboundResourceDisplay(i,a,n,s,o,u,c,l).then(e=>e(r,t)),updateOutboundResource:(i,a,n)=>OutboundResourceServiceApiFp(e).updateOutboundResource(i,a,n).then(e=>e(r,t)),updateOutboundResourceDisplay:(i,a,n,s)=>OutboundResourceServiceApiFp(e).updateOutboundResourceDisplay(i,a,n,s).then(e=>e(r,t))}};class OutboundResourceServiceApi extends BaseAPI{createOutboundResource(e,t){return OutboundResourceServiceApiFp(this.configuration).createOutboundResource(e,t).then(e=>e(this.axios,this.basePath))}createOutboundResourceDisplay(e,t,r){return OutboundResourceServiceApiFp(this.configuration).createOutboundResourceDisplay(e,t,r).then(e=>e(this.axios,this.basePath))}createOutboundResourceDisplayBulk(e,t,r){return OutboundResourceServiceApiFp(this.configuration).createOutboundResourceDisplayBulk(e,t,r).then(e=>e(this.axios,this.basePath))}deleteOutboundResource(e,t,r){return OutboundResourceServiceApiFp(this.configuration).deleteOutboundResource(e,t,r).then(e=>e(this.axios,this.basePath))}deleteOutboundResourceDisplay(e,t,r,i){return OutboundResourceServiceApiFp(this.configuration).deleteOutboundResourceDisplay(e,t,r,i).then(e=>e(this.axios,this.basePath))}deleteOutboundResourceDisplays(e,t,r){return OutboundResourceServiceApiFp(this.configuration).deleteOutboundResourceDisplays(e,t,r).then(e=>e(this.axios,this.basePath))}patchOutboundResource(e,t,r){return OutboundResourceServiceApiFp(this.configuration).patchOutboundResource(e,t,r).then(e=>e(this.axios,this.basePath))}readOutboundResource(e,t,r){return OutboundResourceServiceApiFp(this.configuration).readOutboundResource(e,t,r).then(e=>e(this.axios,this.basePath))}readOutboundResourceDisplay(e,t,r,i){return OutboundResourceServiceApiFp(this.configuration).readOutboundResourceDisplay(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchOutboundResource(e,t,r,i,a,n,s){return OutboundResourceServiceApiFp(this.configuration).searchOutboundResource(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}searchOutboundResourceDisplay(e,t,r,i,a,n,s,o){return OutboundResourceServiceApiFp(this.configuration).searchOutboundResourceDisplay(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateOutboundResource(e,t,r){return OutboundResourceServiceApiFp(this.configuration).updateOutboundResource(e,t,r).then(e=>e(this.axios,this.basePath))}updateOutboundResourceDisplay(e,t,r,i){return OutboundResourceServiceApiFp(this.configuration).updateOutboundResourceDisplay(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const PhonesApiAxiosParamCreator=function(e){return{deletePhone:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deletePhone.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deletePhone.");const n="/contacts/{contact_id}/phones/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},deletePhones:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deletePhones.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deletePhones.");const n="/contacts/{contact_id}/phones".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),r&&(l.etag=r),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},listPhones:async(t,r,i,a,n,s,o,u,c,l,d,p,h={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling listPhones.");const y="/contacts/{contact_id}/phones".replace("{contact_id}",encodeURIComponent(String(t))),g=parse(y,!0);let A;e&&(A=e.baseOptions);const f={method:"GET",...A,...h},m={},w={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;m["X-Webitel-Access"]=t}void 0!==r&&(w.page=r),void 0!==i&&(w.size=i),void 0!==a&&(w.q=a),n&&(w.sort=n),s&&(w.fields=s),o&&(w.id=o),void 0!==u&&(w.primary=u),void 0!==c&&(w.verified=c),void 0!==l&&(w["type.id"]=l),void 0!==d&&(w["type.type"]=d),void 0!==p&&(w["type.name"]=p),g.query={...g.query,...w,...h.query},delete g.search;let b=A&&A.headers?A.headers:{};return f.headers={...m,...b,...h.headers},{url:format(g),options:f}},locatePhone:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling locatePhone.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling locatePhone.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling locatePhone.");const s="/contacts/{contact_id}/phones/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"GET",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),void 0!==i&&(d.id=i),o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};return c.headers={...l,...p,...n.headers},{url:format(o),options:c}},mergePhones:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling mergePhones.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling mergePhones.");const n="/contacts/{contact_id}/phones".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"POST",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},resetPhones:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling resetPhones.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling resetPhones.");const n="/contacts/{contact_id}/phones".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},updatePhone:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updatePhone.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updatePhone.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updatePhone.");const s="/contacts/{contact_id}/phones/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PUT",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}},updatePhone2:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updatePhone2.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updatePhone2.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updatePhone2.");const s="/contacts/{contact_id}/phones/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PATCH",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},PhonesApiFp=function(e){return{async deletePhone(t,r,i,a){const n=await PhonesApiAxiosParamCreator(e).deletePhone(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async deletePhones(t,r,i,a){const n=await PhonesApiAxiosParamCreator(e).deletePhones(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async listPhones(t,r,i,a,n,s,o,u,c,l,d,p,h){const y=await PhonesApiAxiosParamCreator(e).listPhones(t,r,i,a,n,s,o,u,c,l,d,p,h);return(e=globalAxios,t=BASE_PATH)=>{const r={...y.options,url:t+y.url};return e.request(r)}},async locatePhone(t,r,i,a,n){const s=await PhonesApiAxiosParamCreator(e).locatePhone(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async mergePhones(t,r,i,a){const n=await PhonesApiAxiosParamCreator(e).mergePhones(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async resetPhones(t,r,i,a){const n=await PhonesApiAxiosParamCreator(e).resetPhones(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async updatePhone(t,r,i,a,n){const s=await PhonesApiAxiosParamCreator(e).updatePhone(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async updatePhone2(t,r,i,a,n){const s=await PhonesApiAxiosParamCreator(e).updatePhone2(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}}}},PhonesApiFactory=function(e,t,r){return{deletePhone:(i,a,n,s)=>PhonesApiFp(e).deletePhone(i,a,n,s).then(e=>e(r,t)),deletePhones:(i,a,n,s)=>PhonesApiFp(e).deletePhones(i,a,n,s).then(e=>e(r,t)),listPhones:(i,a,n,s,o,u,c,l,d,p,h,y,g)=>PhonesApiFp(e).listPhones(i,a,n,s,o,u,c,l,d,p,h,y,g).then(e=>e(r,t)),locatePhone:(i,a,n,s,o)=>PhonesApiFp(e).locatePhone(i,a,n,s,o).then(e=>e(r,t)),mergePhones:(i,a,n,s)=>PhonesApiFp(e).mergePhones(i,a,n,s).then(e=>e(r,t)),resetPhones:(i,a,n,s)=>PhonesApiFp(e).resetPhones(i,a,n,s).then(e=>e(r,t)),updatePhone:(i,a,n,s,o)=>PhonesApiFp(e).updatePhone(i,a,n,s,o).then(e=>e(r,t)),updatePhone2:(i,a,n,s,o)=>PhonesApiFp(e).updatePhone2(i,a,n,s,o).then(e=>e(r,t))}};class PhonesApi extends BaseAPI{deletePhone(e,t,r,i){return PhonesApiFp(this.configuration).deletePhone(e,t,r,i).then(e=>e(this.axios,this.basePath))}deletePhones(e,t,r,i){return PhonesApiFp(this.configuration).deletePhones(e,t,r,i).then(e=>e(this.axios,this.basePath))}listPhones(e,t,r,i,a,n,s,o,u,c,l,d,p){return PhonesApiFp(this.configuration).listPhones(e,t,r,i,a,n,s,o,u,c,l,d,p).then(e=>e(this.axios,this.basePath))}locatePhone(e,t,r,i,a){return PhonesApiFp(this.configuration).locatePhone(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}mergePhones(e,t,r,i){return PhonesApiFp(this.configuration).mergePhones(e,t,r,i).then(e=>e(this.axios,this.basePath))}resetPhones(e,t,r,i){return PhonesApiFp(this.configuration).resetPhones(e,t,r,i).then(e=>e(this.axios,this.basePath))}updatePhone(e,t,r,i,a){return PhonesApiFp(this.configuration).updatePhone(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}updatePhone2(e,t,r,i,a){return PhonesApiFp(this.configuration).updatePhone2(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}}const PresetQueryServiceApiAxiosParamCreator=function(e){return{createPresetQuery:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createPresetQuery.");const i=parse("/call_center/preset/query",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deletePresetQuery:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deletePresetQuery.");const i="/call_center/preset/query/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchPresetQuery:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchPresetQuery.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchPresetQuery.");const a="/call_center/preset/query/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readPresetQuery:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readPresetQuery.");const i="/call_center/preset/query/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchPresetQuery:async(t,r,i,a,n,s,o,u={})=>{const c=parse("/call_center/preset/query",!0);let l;e&&(l=e.baseOptions);const d={method:"GET",...l,...u},p={},h={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;p["X-Webitel-Access"]=t}void 0!==t&&(h.page=t),void 0!==r&&(h.size=r),void 0!==i&&(h.q=i),void 0!==a&&(h.sort=a),n&&(h.fields=n),s&&(h.id=s),o&&(h.section=o),c.query={...c.query,...h,...u.query},delete c.search;let y=l&&l.headers?l.headers:{};return d.headers={...p,...y,...u.headers},{url:format(c),options:d}},updatePresetQuery:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updatePresetQuery.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updatePresetQuery.");const a="/call_center/preset/query/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},PresetQueryServiceApiFp=function(e){return{async createPresetQuery(t,r){const i=await PresetQueryServiceApiAxiosParamCreator(e).createPresetQuery(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deletePresetQuery(t,r){const i=await PresetQueryServiceApiAxiosParamCreator(e).deletePresetQuery(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchPresetQuery(t,r,i){const a=await PresetQueryServiceApiAxiosParamCreator(e).patchPresetQuery(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readPresetQuery(t,r){const i=await PresetQueryServiceApiAxiosParamCreator(e).readPresetQuery(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchPresetQuery(t,r,i,a,n,s,o,u){const c=await PresetQueryServiceApiAxiosParamCreator(e).searchPresetQuery(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async updatePresetQuery(t,r,i){const a=await PresetQueryServiceApiAxiosParamCreator(e).updatePresetQuery(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},PresetQueryServiceApiFactory=function(e,t,r){return{createPresetQuery:(i,a)=>PresetQueryServiceApiFp(e).createPresetQuery(i,a).then(e=>e(r,t)),deletePresetQuery:(i,a)=>PresetQueryServiceApiFp(e).deletePresetQuery(i,a).then(e=>e(r,t)),patchPresetQuery:(i,a,n)=>PresetQueryServiceApiFp(e).patchPresetQuery(i,a,n).then(e=>e(r,t)),readPresetQuery:(i,a)=>PresetQueryServiceApiFp(e).readPresetQuery(i,a).then(e=>e(r,t)),searchPresetQuery:(i,a,n,s,o,u,c,l)=>PresetQueryServiceApiFp(e).searchPresetQuery(i,a,n,s,o,u,c,l).then(e=>e(r,t)),updatePresetQuery:(i,a,n)=>PresetQueryServiceApiFp(e).updatePresetQuery(i,a,n).then(e=>e(r,t))}};class PresetQueryServiceApi extends BaseAPI{createPresetQuery(e,t){return PresetQueryServiceApiFp(this.configuration).createPresetQuery(e,t).then(e=>e(this.axios,this.basePath))}deletePresetQuery(e,t){return PresetQueryServiceApiFp(this.configuration).deletePresetQuery(e,t).then(e=>e(this.axios,this.basePath))}patchPresetQuery(e,t,r){return PresetQueryServiceApiFp(this.configuration).patchPresetQuery(e,t,r).then(e=>e(this.axios,this.basePath))}readPresetQuery(e,t){return PresetQueryServiceApiFp(this.configuration).readPresetQuery(e,t).then(e=>e(this.axios,this.basePath))}searchPresetQuery(e,t,r,i,a,n,s,o){return PresetQueryServiceApiFp(this.configuration).searchPresetQuery(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}updatePresetQuery(e,t,r){return PresetQueryServiceApiFp(this.configuration).updatePresetQuery(e,t,r).then(e=>e(this.axios,this.basePath))}}const QueueBucketServiceApiAxiosParamCreator=function(e){return{createQueueBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueBucket.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createQueueBucket.");const a="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteQueueBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueBucket.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteQueueBucket.");const a="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},patchQueueBucket:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchQueueBucket.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueueBucket.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling patchQueueBucket.");const n="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},readQueueBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueBucket.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readQueueBucket.");const a="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},searchQueueBucket:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchQueueBucket.");const c="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.q=a),void 0!==n&&(y.sort=n),s&&(y.fields=s),o&&(y.id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},updateQueueBucket:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueBucket.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueBucket.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateQueueBucket.");const n="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},QueueBucketServiceApiFp=function(e){return{async createQueueBucket(t,r,i){const a=await QueueBucketServiceApiAxiosParamCreator(e).createQueueBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteQueueBucket(t,r,i){const a=await QueueBucketServiceApiAxiosParamCreator(e).deleteQueueBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchQueueBucket(t,r,i,a){const n=await QueueBucketServiceApiAxiosParamCreator(e).patchQueueBucket(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readQueueBucket(t,r,i){const a=await QueueBucketServiceApiAxiosParamCreator(e).readQueueBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchQueueBucket(t,r,i,a,n,s,o,u){const c=await QueueBucketServiceApiAxiosParamCreator(e).searchQueueBucket(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async updateQueueBucket(t,r,i,a){const n=await QueueBucketServiceApiAxiosParamCreator(e).updateQueueBucket(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},QueueBucketServiceApiFactory=function(e,t,r){return{createQueueBucket:(i,a,n)=>QueueBucketServiceApiFp(e).createQueueBucket(i,a,n).then(e=>e(r,t)),deleteQueueBucket:(i,a,n)=>QueueBucketServiceApiFp(e).deleteQueueBucket(i,a,n).then(e=>e(r,t)),patchQueueBucket:(i,a,n,s)=>QueueBucketServiceApiFp(e).patchQueueBucket(i,a,n,s).then(e=>e(r,t)),readQueueBucket:(i,a,n)=>QueueBucketServiceApiFp(e).readQueueBucket(i,a,n).then(e=>e(r,t)),searchQueueBucket:(i,a,n,s,o,u,c,l)=>QueueBucketServiceApiFp(e).searchQueueBucket(i,a,n,s,o,u,c,l).then(e=>e(r,t)),updateQueueBucket:(i,a,n,s)=>QueueBucketServiceApiFp(e).updateQueueBucket(i,a,n,s).then(e=>e(r,t))}};class QueueBucketServiceApi extends BaseAPI{createQueueBucket(e,t,r){return QueueBucketServiceApiFp(this.configuration).createQueueBucket(e,t,r).then(e=>e(this.axios,this.basePath))}deleteQueueBucket(e,t,r){return QueueBucketServiceApiFp(this.configuration).deleteQueueBucket(e,t,r).then(e=>e(this.axios,this.basePath))}patchQueueBucket(e,t,r,i){return QueueBucketServiceApiFp(this.configuration).patchQueueBucket(e,t,r,i).then(e=>e(this.axios,this.basePath))}readQueueBucket(e,t,r){return QueueBucketServiceApiFp(this.configuration).readQueueBucket(e,t,r).then(e=>e(this.axios,this.basePath))}searchQueueBucket(e,t,r,i,a,n,s,o){return QueueBucketServiceApiFp(this.configuration).searchQueueBucket(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateQueueBucket(e,t,r,i){return QueueBucketServiceApiFp(this.configuration).updateQueueBucket(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const QueueHookServiceApiAxiosParamCreator=function(e){return{createQueueHook:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueHook.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createQueueHook.");const a="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteQueueHook:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueHook.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteQueueHook.");const a="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},patchQueueHook:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchQueueHook.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueueHook.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling patchQueueHook.");const n="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},readQueueHook:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueHook.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readQueueHook.");const a="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},searchQueueHook:async(t,r,i,a,n,s,o,u,c,l={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchQueueHook.");const d="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(t))),p=parse(d,!0);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...l},g={},A={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==r&&(A.page=r),void 0!==i&&(A.size=i),void 0!==a&&(A.q=a),void 0!==n&&(A.sort=n),s&&(A.fields=s),o&&(A.id=o),u&&(A.schema_id=u),c&&(A.event=c),p.query={...p.query,...A,...l.query},delete p.search;let f=h&&h.headers?h.headers:{};return y.headers={...g,...f,...l.headers},{url:format(p),options:y}},updateQueueHook:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueHook.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueHook.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateQueueHook.");const n="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},QueueHookServiceApiFp=function(e){return{async createQueueHook(t,r,i){const a=await QueueHookServiceApiAxiosParamCreator(e).createQueueHook(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteQueueHook(t,r,i){const a=await QueueHookServiceApiAxiosParamCreator(e).deleteQueueHook(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchQueueHook(t,r,i,a){const n=await QueueHookServiceApiAxiosParamCreator(e).patchQueueHook(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readQueueHook(t,r,i){const a=await QueueHookServiceApiAxiosParamCreator(e).readQueueHook(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchQueueHook(t,r,i,a,n,s,o,u,c,l){const d=await QueueHookServiceApiAxiosParamCreator(e).searchQueueHook(t,r,i,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async updateQueueHook(t,r,i,a){const n=await QueueHookServiceApiAxiosParamCreator(e).updateQueueHook(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},QueueHookServiceApiFactory=function(e,t,r){return{createQueueHook:(i,a,n)=>QueueHookServiceApiFp(e).createQueueHook(i,a,n).then(e=>e(r,t)),deleteQueueHook:(i,a,n)=>QueueHookServiceApiFp(e).deleteQueueHook(i,a,n).then(e=>e(r,t)),patchQueueHook:(i,a,n,s)=>QueueHookServiceApiFp(e).patchQueueHook(i,a,n,s).then(e=>e(r,t)),readQueueHook:(i,a,n)=>QueueHookServiceApiFp(e).readQueueHook(i,a,n).then(e=>e(r,t)),searchQueueHook:(i,a,n,s,o,u,c,l,d,p)=>QueueHookServiceApiFp(e).searchQueueHook(i,a,n,s,o,u,c,l,d,p).then(e=>e(r,t)),updateQueueHook:(i,a,n,s)=>QueueHookServiceApiFp(e).updateQueueHook(i,a,n,s).then(e=>e(r,t))}};class QueueHookServiceApi extends BaseAPI{createQueueHook(e,t,r){return QueueHookServiceApiFp(this.configuration).createQueueHook(e,t,r).then(e=>e(this.axios,this.basePath))}deleteQueueHook(e,t,r){return QueueHookServiceApiFp(this.configuration).deleteQueueHook(e,t,r).then(e=>e(this.axios,this.basePath))}patchQueueHook(e,t,r,i){return QueueHookServiceApiFp(this.configuration).patchQueueHook(e,t,r,i).then(e=>e(this.axios,this.basePath))}readQueueHook(e,t,r){return QueueHookServiceApiFp(this.configuration).readQueueHook(e,t,r).then(e=>e(this.axios,this.basePath))}searchQueueHook(e,t,r,i,a,n,s,o,u,c){return QueueHookServiceApiFp(this.configuration).searchQueueHook(e,t,r,i,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}updateQueueHook(e,t,r,i){return QueueHookServiceApiFp(this.configuration).updateQueueHook(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const QueueResourcesServiceApiAxiosParamCreator=function(e){return{createQueueResourceGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueResourceGroup.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createQueueResourceGroup.");const a="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteQueueResourceGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueResourceGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteQueueResourceGroup.");const n="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},readQueueResourceGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueResourceGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readQueueResourceGroup.");const n="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchQueueResourceGroup:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchQueueResourceGroup.");const c="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.q=a),void 0!==n&&(y.sort=n),s&&(y.fields=s),o&&(y.id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},updateQueueResourceGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueResourceGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueResourceGroup.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateQueueResourceGroup.");const n="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},QueueResourcesServiceApiFp=function(e){return{async createQueueResourceGroup(t,r,i){const a=await QueueResourcesServiceApiAxiosParamCreator(e).createQueueResourceGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteQueueResourceGroup(t,r,i,a){const n=await QueueResourcesServiceApiAxiosParamCreator(e).deleteQueueResourceGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readQueueResourceGroup(t,r,i,a){const n=await QueueResourcesServiceApiAxiosParamCreator(e).readQueueResourceGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchQueueResourceGroup(t,r,i,a,n,s,o,u){const c=await QueueResourcesServiceApiAxiosParamCreator(e).searchQueueResourceGroup(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async updateQueueResourceGroup(t,r,i,a){const n=await QueueResourcesServiceApiAxiosParamCreator(e).updateQueueResourceGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},QueueResourcesServiceApiFactory=function(e,t,r){return{createQueueResourceGroup:(i,a,n)=>QueueResourcesServiceApiFp(e).createQueueResourceGroup(i,a,n).then(e=>e(r,t)),deleteQueueResourceGroup:(i,a,n,s)=>QueueResourcesServiceApiFp(e).deleteQueueResourceGroup(i,a,n,s).then(e=>e(r,t)),readQueueResourceGroup:(i,a,n,s)=>QueueResourcesServiceApiFp(e).readQueueResourceGroup(i,a,n,s).then(e=>e(r,t)),searchQueueResourceGroup:(i,a,n,s,o,u,c,l)=>QueueResourcesServiceApiFp(e).searchQueueResourceGroup(i,a,n,s,o,u,c,l).then(e=>e(r,t)),updateQueueResourceGroup:(i,a,n,s)=>QueueResourcesServiceApiFp(e).updateQueueResourceGroup(i,a,n,s).then(e=>e(r,t))}};class QueueResourcesServiceApi extends BaseAPI{createQueueResourceGroup(e,t,r){return QueueResourcesServiceApiFp(this.configuration).createQueueResourceGroup(e,t,r).then(e=>e(this.axios,this.basePath))}deleteQueueResourceGroup(e,t,r,i){return QueueResourcesServiceApiFp(this.configuration).deleteQueueResourceGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}readQueueResourceGroup(e,t,r,i){return QueueResourcesServiceApiFp(this.configuration).readQueueResourceGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchQueueResourceGroup(e,t,r,i,a,n,s,o){return QueueResourcesServiceApiFp(this.configuration).searchQueueResourceGroup(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateQueueResourceGroup(e,t,r,i){return QueueResourcesServiceApiFp(this.configuration).updateQueueResourceGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const QueueServiceApiAxiosParamCreator=function(e){return{createQueue:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createQueue.");const i=parse("/call_center/queues",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteQueue:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteQueue.");const a="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},patchQueue:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueue.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchQueue.");const a="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readQueue:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readQueue.");const a="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchQueue:async(t,r,i,a,n,s,o,u={})=>{const c=parse("/call_center/queues",!0);let l;e&&(l=e.baseOptions);const d={method:"GET",...l,...u},p={},h={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;p["X-Webitel-Access"]=t}void 0!==t&&(h.page=t),void 0!==r&&(h.size=r),void 0!==i&&(h.q=i),void 0!==a&&(h.sort=a),n&&(h.fields=n),s&&(h.id=s),o&&(h.type=o),c.query={...c.query,...h,...u.query},delete c.search;let y=l&&l.headers?l.headers:{};return d.headers={...p,...y,...u.headers},{url:format(c),options:d}},searchQueueReportGeneral:async(t,r,i,a,n,s,o,u,c,l,d,p={})=>{const h=parse("/call_center/queues/reports/general",!0);let y;e&&(y=e.baseOptions);const g={method:"GET",...y,...p},A={},f={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;A["X-Webitel-Access"]=t}void 0!==t&&(f.page=t),void 0!==r&&(f.size=r),void 0!==i&&(f["joined_at.from"]=i),void 0!==a&&(f["joined_at.to"]=a),void 0!==n&&(f.domain_id=n),s&&(f.fields=s),void 0!==o&&(f.sort=o),void 0!==u&&(f.q=u),c&&(f.queue_id=c),l&&(f.team_id=l),d&&(f.type=d),h.query={...h.query,...f,...p.query},delete h.search;let m=y&&y.headers?y.headers:{};return g.headers={...A,...m,...p.headers},{url:format(h),options:g}},updateQueue:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueue.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateQueue.");const a="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},QueueServiceApiFp=function(e){return{async createQueue(t,r){const i=await QueueServiceApiAxiosParamCreator(e).createQueue(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteQueue(t,r,i){const a=await QueueServiceApiAxiosParamCreator(e).deleteQueue(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchQueue(t,r,i){const a=await QueueServiceApiAxiosParamCreator(e).patchQueue(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readQueue(t,r,i){const a=await QueueServiceApiAxiosParamCreator(e).readQueue(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchQueue(t,r,i,a,n,s,o,u){const c=await QueueServiceApiAxiosParamCreator(e).searchQueue(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async searchQueueReportGeneral(t,r,i,a,n,s,o,u,c,l,d,p){const h=await QueueServiceApiAxiosParamCreator(e).searchQueueReportGeneral(t,r,i,a,n,s,o,u,c,l,d,p);return(e=globalAxios,t=BASE_PATH)=>{const r={...h.options,url:t+h.url};return e.request(r)}},async updateQueue(t,r,i){const a=await QueueServiceApiAxiosParamCreator(e).updateQueue(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},QueueServiceApiFactory=function(e,t,r){return{createQueue:(i,a)=>QueueServiceApiFp(e).createQueue(i,a).then(e=>e(r,t)),deleteQueue:(i,a,n)=>QueueServiceApiFp(e).deleteQueue(i,a,n).then(e=>e(r,t)),patchQueue:(i,a,n)=>QueueServiceApiFp(e).patchQueue(i,a,n).then(e=>e(r,t)),readQueue:(i,a,n)=>QueueServiceApiFp(e).readQueue(i,a,n).then(e=>e(r,t)),searchQueue:(i,a,n,s,o,u,c,l)=>QueueServiceApiFp(e).searchQueue(i,a,n,s,o,u,c,l).then(e=>e(r,t)),searchQueueReportGeneral:(i,a,n,s,o,u,c,l,d,p,h,y)=>QueueServiceApiFp(e).searchQueueReportGeneral(i,a,n,s,o,u,c,l,d,p,h,y).then(e=>e(r,t)),updateQueue:(i,a,n)=>QueueServiceApiFp(e).updateQueue(i,a,n).then(e=>e(r,t))}};class QueueServiceApi extends BaseAPI{createQueue(e,t){return QueueServiceApiFp(this.configuration).createQueue(e,t).then(e=>e(this.axios,this.basePath))}deleteQueue(e,t,r){return QueueServiceApiFp(this.configuration).deleteQueue(e,t,r).then(e=>e(this.axios,this.basePath))}patchQueue(e,t,r){return QueueServiceApiFp(this.configuration).patchQueue(e,t,r).then(e=>e(this.axios,this.basePath))}readQueue(e,t,r){return QueueServiceApiFp(this.configuration).readQueue(e,t,r).then(e=>e(this.axios,this.basePath))}searchQueue(e,t,r,i,a,n,s,o){return QueueServiceApiFp(this.configuration).searchQueue(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}searchQueueReportGeneral(e,t,r,i,a,n,s,o,u,c,l,d){return QueueServiceApiFp(this.configuration).searchQueueReportGeneral(e,t,r,i,a,n,s,o,u,c,l,d).then(e=>e(this.axios,this.basePath))}updateQueue(e,t,r){return QueueServiceApiFp(this.configuration).updateQueue(e,t,r).then(e=>e(this.axios,this.basePath))}}const QueueSkillServiceApiAxiosParamCreator=function(e){return{createQueueSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueSkill.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createQueueSkill.");const a="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteQueueSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteQueueSkill.");const a="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},patchQueueSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchQueueSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueueSkill.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling patchQueueSkill.");const n="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},readQueueSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readQueueSkill.");const a="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},searchQueueSkill:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchQueueSkill.");const g="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(t))),A=parse(g,!0);let f;e&&(f=e.baseOptions);const m={method:"GET",...f,...y},w={},b={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;w["X-Webitel-Access"]=t}void 0!==r&&(b.page=r),void 0!==i&&(b.size=i),void 0!==a&&(b.q=a),void 0!==n&&(b.sort=n),s&&(b.fields=s),o&&(b.id=o),u&&(b.skill_id=u),c&&(b.bucket_id=c),l&&(b.lvl=l),d&&(b.min_capacity=d),p&&(b.max_capacity=p),void 0!==h&&(b.enabled=h),A.query={...A.query,...b,...y.query},delete A.search;let S=f&&f.headers?f.headers:{};return m.headers={...w,...S,...y.headers},{url:format(A),options:m}},updateQueueSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueSkill.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateQueueSkill.");const n="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},QueueSkillServiceApiFp=function(e){return{async createQueueSkill(t,r,i){const a=await QueueSkillServiceApiAxiosParamCreator(e).createQueueSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteQueueSkill(t,r,i){const a=await QueueSkillServiceApiAxiosParamCreator(e).deleteQueueSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchQueueSkill(t,r,i,a){const n=await QueueSkillServiceApiAxiosParamCreator(e).patchQueueSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readQueueSkill(t,r,i){const a=await QueueSkillServiceApiAxiosParamCreator(e).readQueueSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchQueueSkill(t,r,i,a,n,s,o,u,c,l,d,p,h,y){const g=await QueueSkillServiceApiAxiosParamCreator(e).searchQueueSkill(t,r,i,a,n,s,o,u,c,l,d,p,h,y);return(e=globalAxios,t=BASE_PATH)=>{const r={...g.options,url:t+g.url};return e.request(r)}},async updateQueueSkill(t,r,i,a){const n=await QueueSkillServiceApiAxiosParamCreator(e).updateQueueSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},QueueSkillServiceApiFactory=function(e,t,r){return{createQueueSkill:(i,a,n)=>QueueSkillServiceApiFp(e).createQueueSkill(i,a,n).then(e=>e(r,t)),deleteQueueSkill:(i,a,n)=>QueueSkillServiceApiFp(e).deleteQueueSkill(i,a,n).then(e=>e(r,t)),patchQueueSkill:(i,a,n,s)=>QueueSkillServiceApiFp(e).patchQueueSkill(i,a,n,s).then(e=>e(r,t)),readQueueSkill:(i,a,n)=>QueueSkillServiceApiFp(e).readQueueSkill(i,a,n).then(e=>e(r,t)),searchQueueSkill:(i,a,n,s,o,u,c,l,d,p,h,y,g,A)=>QueueSkillServiceApiFp(e).searchQueueSkill(i,a,n,s,o,u,c,l,d,p,h,y,g,A).then(e=>e(r,t)),updateQueueSkill:(i,a,n,s)=>QueueSkillServiceApiFp(e).updateQueueSkill(i,a,n,s).then(e=>e(r,t))}};class QueueSkillServiceApi extends BaseAPI{createQueueSkill(e,t,r){return QueueSkillServiceApiFp(this.configuration).createQueueSkill(e,t,r).then(e=>e(this.axios,this.basePath))}deleteQueueSkill(e,t,r){return QueueSkillServiceApiFp(this.configuration).deleteQueueSkill(e,t,r).then(e=>e(this.axios,this.basePath))}patchQueueSkill(e,t,r,i){return QueueSkillServiceApiFp(this.configuration).patchQueueSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}readQueueSkill(e,t,r){return QueueSkillServiceApiFp(this.configuration).readQueueSkill(e,t,r).then(e=>e(this.axios,this.basePath))}searchQueueSkill(e,t,r,i,a,n,s,o,u,c,l,d,p,h){return QueueSkillServiceApiFp(this.configuration).searchQueueSkill(e,t,r,i,a,n,s,o,u,c,l,d,p,h).then(e=>e(this.axios,this.basePath))}updateQueueSkill(e,t,r,i){return QueueSkillServiceApiFp(this.configuration).updateQueueSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const RegionServiceApiAxiosParamCreator=function(e){return{createRegion:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRegion.");const i=parse("/regions",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteRegion:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteRegion.");const i="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchRegion:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchRegion.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchRegion.");const a="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readRegion:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readRegion.");const i="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchRegion:async(t,r,i,a,n,s,o,u,c,l={})=>{const d=parse("/regions",!0);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...l},y={},g={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;y["X-Webitel-Access"]=t}void 0!==t&&(g.page=t),void 0!==r&&(g.size=r),void 0!==i&&(g.q=i),void 0!==a&&(g.sort=a),n&&(g.fields=n),s&&(g.id=s),void 0!==o&&(g.name=o),void 0!==u&&(g.description=u),c&&(g.timezone_id=c),d.query={...d.query,...g,...l.query},delete d.search;let A=p&&p.headers?p.headers:{};return h.headers={...y,...A,...l.headers},{url:format(d),options:h}},updateRegion:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRegion.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateRegion.");const a="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},RegionServiceApiFp=function(e){return{async createRegion(t,r){const i=await RegionServiceApiAxiosParamCreator(e).createRegion(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteRegion(t,r){const i=await RegionServiceApiAxiosParamCreator(e).deleteRegion(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchRegion(t,r,i){const a=await RegionServiceApiAxiosParamCreator(e).patchRegion(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readRegion(t,r){const i=await RegionServiceApiAxiosParamCreator(e).readRegion(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchRegion(t,r,i,a,n,s,o,u,c,l){const d=await RegionServiceApiAxiosParamCreator(e).searchRegion(t,r,i,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async updateRegion(t,r,i){const a=await RegionServiceApiAxiosParamCreator(e).updateRegion(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RegionServiceApiFactory=function(e,t,r){return{createRegion:(i,a)=>RegionServiceApiFp(e).createRegion(i,a).then(e=>e(r,t)),deleteRegion:(i,a)=>RegionServiceApiFp(e).deleteRegion(i,a).then(e=>e(r,t)),patchRegion:(i,a,n)=>RegionServiceApiFp(e).patchRegion(i,a,n).then(e=>e(r,t)),readRegion:(i,a)=>RegionServiceApiFp(e).readRegion(i,a).then(e=>e(r,t)),searchRegion:(i,a,n,s,o,u,c,l,d,p)=>RegionServiceApiFp(e).searchRegion(i,a,n,s,o,u,c,l,d,p).then(e=>e(r,t)),updateRegion:(i,a,n)=>RegionServiceApiFp(e).updateRegion(i,a,n).then(e=>e(r,t))}};class RegionServiceApi extends BaseAPI{createRegion(e,t){return RegionServiceApiFp(this.configuration).createRegion(e,t).then(e=>e(this.axios,this.basePath))}deleteRegion(e,t){return RegionServiceApiFp(this.configuration).deleteRegion(e,t).then(e=>e(this.axios,this.basePath))}patchRegion(e,t,r){return RegionServiceApiFp(this.configuration).patchRegion(e,t,r).then(e=>e(this.axios,this.basePath))}readRegion(e,t){return RegionServiceApiFp(this.configuration).readRegion(e,t).then(e=>e(this.axios,this.basePath))}searchRegion(e,t,r,i,a,n,s,o,u,c){return RegionServiceApiFp(this.configuration).searchRegion(e,t,r,i,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}updateRegion(e,t,r){return RegionServiceApiFp(this.configuration).updateRegion(e,t,r).then(e=>e(this.axios,this.basePath))}}const RoutingChatPlanServiceApiAxiosParamCreator=function(e){return{createChatPlan:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createChatPlan.");const i=parse("/routing/outbound/chat",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteChatPlan:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteChatPlan.");const i="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchChatPlan:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchChatPlan.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchChatPlan.");const a="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readChatPlan:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readChatPlan.");const i="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchChatPlan:async(t,r,i,a,n,s,o,u,c={})=>{const l=parse("/routing/outbound/chat",!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==t&&(y.page=t),void 0!==r&&(y.size=r),void 0!==i&&(y.q=i),void 0!==a&&(y.sort=a),n&&(y.fields=n),s&&(y.id=s),void 0!==o&&(y.name=o),void 0!==u&&(y.enabled=u),l.query={...l.query,...y,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},updateChatPlan:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateChatPlan.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateChatPlan.");const a="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},RoutingChatPlanServiceApiFp=function(e){return{async createChatPlan(t,r){const i=await RoutingChatPlanServiceApiAxiosParamCreator(e).createChatPlan(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteChatPlan(t,r){const i=await RoutingChatPlanServiceApiAxiosParamCreator(e).deleteChatPlan(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchChatPlan(t,r,i){const a=await RoutingChatPlanServiceApiAxiosParamCreator(e).patchChatPlan(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readChatPlan(t,r){const i=await RoutingChatPlanServiceApiAxiosParamCreator(e).readChatPlan(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchChatPlan(t,r,i,a,n,s,o,u,c){const l=await RoutingChatPlanServiceApiAxiosParamCreator(e).searchChatPlan(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async updateChatPlan(t,r,i){const a=await RoutingChatPlanServiceApiAxiosParamCreator(e).updateChatPlan(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RoutingChatPlanServiceApiFactory=function(e,t,r){return{createChatPlan:(i,a)=>RoutingChatPlanServiceApiFp(e).createChatPlan(i,a).then(e=>e(r,t)),deleteChatPlan:(i,a)=>RoutingChatPlanServiceApiFp(e).deleteChatPlan(i,a).then(e=>e(r,t)),patchChatPlan:(i,a,n)=>RoutingChatPlanServiceApiFp(e).patchChatPlan(i,a,n).then(e=>e(r,t)),readChatPlan:(i,a)=>RoutingChatPlanServiceApiFp(e).readChatPlan(i,a).then(e=>e(r,t)),searchChatPlan:(i,a,n,s,o,u,c,l,d)=>RoutingChatPlanServiceApiFp(e).searchChatPlan(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),updateChatPlan:(i,a,n)=>RoutingChatPlanServiceApiFp(e).updateChatPlan(i,a,n).then(e=>e(r,t))}};class RoutingChatPlanServiceApi extends BaseAPI{createChatPlan(e,t){return RoutingChatPlanServiceApiFp(this.configuration).createChatPlan(e,t).then(e=>e(this.axios,this.basePath))}deleteChatPlan(e,t){return RoutingChatPlanServiceApiFp(this.configuration).deleteChatPlan(e,t).then(e=>e(this.axios,this.basePath))}patchChatPlan(e,t,r){return RoutingChatPlanServiceApiFp(this.configuration).patchChatPlan(e,t,r).then(e=>e(this.axios,this.basePath))}readChatPlan(e,t){return RoutingChatPlanServiceApiFp(this.configuration).readChatPlan(e,t).then(e=>e(this.axios,this.basePath))}searchChatPlan(e,t,r,i,a,n,s,o,u){return RoutingChatPlanServiceApiFp(this.configuration).searchChatPlan(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateChatPlan(e,t,r){return RoutingChatPlanServiceApiFp(this.configuration).updateChatPlan(e,t,r).then(e=>e(this.axios,this.basePath))}}const RoutingOutboundCallServiceApiAxiosParamCreator=function(e){return{createRoutingOutboundCall:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRoutingOutboundCall.");const i=parse("/routing/outbound/calls",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteRoutingOutboundCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteRoutingOutboundCall.");const a="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},movePositionRoutingOutboundCall:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("fromId","Required parameter fromId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==r)throw new RequiredError("toId","Required parameter toId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling movePositionRoutingOutboundCall.");const n="/routing/outbound/calls/{from_id}/to/{to_id}".replace("{from_id}",encodeURIComponent(String(t))).replace("{to_id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},patchRoutingOutboundCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchRoutingOutboundCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchRoutingOutboundCall.");const a="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readRoutingOutboundCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readRoutingOutboundCall.");const a="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchRoutingOutboundCall:async(t,r,i,a,n,s,o,u,c,l,d={})=>{const p=parse("/routing/outbound/calls",!0);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...d},g={},A={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==t&&(A.page=t),void 0!==r&&(A.size=r),void 0!==i&&(A.q=i),void 0!==a&&(A.sort=a),n&&(A.fields=n),s&&(A.id=s),void 0!==o&&(A.name=o),u&&(A.schema_id=u),void 0!==c&&(A.pattern=c),void 0!==l&&(A.description=l),p.query={...p.query,...A,...d.query},delete p.search;let f=h&&h.headers?h.headers:{};return y.headers={...g,...f,...d.headers},{url:format(p),options:y}},updateRoutingOutboundCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRoutingOutboundCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateRoutingOutboundCall.");const a="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},RoutingOutboundCallServiceApiFp=function(e){return{async createRoutingOutboundCall(t,r){const i=await RoutingOutboundCallServiceApiAxiosParamCreator(e).createRoutingOutboundCall(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteRoutingOutboundCall(t,r,i){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).deleteRoutingOutboundCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async movePositionRoutingOutboundCall(t,r,i,a){const n=await RoutingOutboundCallServiceApiAxiosParamCreator(e).movePositionRoutingOutboundCall(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async patchRoutingOutboundCall(t,r,i){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).patchRoutingOutboundCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readRoutingOutboundCall(t,r,i){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).readRoutingOutboundCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchRoutingOutboundCall(t,r,i,a,n,s,o,u,c,l,d){const p=await RoutingOutboundCallServiceApiAxiosParamCreator(e).searchRoutingOutboundCall(t,r,i,a,n,s,o,u,c,l,d);return(e=globalAxios,t=BASE_PATH)=>{const r={...p.options,url:t+p.url};return e.request(r)}},async updateRoutingOutboundCall(t,r,i){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).updateRoutingOutboundCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RoutingOutboundCallServiceApiFactory=function(e,t,r){return{createRoutingOutboundCall:(i,a)=>RoutingOutboundCallServiceApiFp(e).createRoutingOutboundCall(i,a).then(e=>e(r,t)),deleteRoutingOutboundCall:(i,a,n)=>RoutingOutboundCallServiceApiFp(e).deleteRoutingOutboundCall(i,a,n).then(e=>e(r,t)),movePositionRoutingOutboundCall:(i,a,n,s)=>RoutingOutboundCallServiceApiFp(e).movePositionRoutingOutboundCall(i,a,n,s).then(e=>e(r,t)),patchRoutingOutboundCall:(i,a,n)=>RoutingOutboundCallServiceApiFp(e).patchRoutingOutboundCall(i,a,n).then(e=>e(r,t)),readRoutingOutboundCall:(i,a,n)=>RoutingOutboundCallServiceApiFp(e).readRoutingOutboundCall(i,a,n).then(e=>e(r,t)),searchRoutingOutboundCall:(i,a,n,s,o,u,c,l,d,p,h)=>RoutingOutboundCallServiceApiFp(e).searchRoutingOutboundCall(i,a,n,s,o,u,c,l,d,p,h).then(e=>e(r,t)),updateRoutingOutboundCall:(i,a,n)=>RoutingOutboundCallServiceApiFp(e).updateRoutingOutboundCall(i,a,n).then(e=>e(r,t))}};class RoutingOutboundCallServiceApi extends BaseAPI{createRoutingOutboundCall(e,t){return RoutingOutboundCallServiceApiFp(this.configuration).createRoutingOutboundCall(e,t).then(e=>e(this.axios,this.basePath))}deleteRoutingOutboundCall(e,t,r){return RoutingOutboundCallServiceApiFp(this.configuration).deleteRoutingOutboundCall(e,t,r).then(e=>e(this.axios,this.basePath))}movePositionRoutingOutboundCall(e,t,r,i){return RoutingOutboundCallServiceApiFp(this.configuration).movePositionRoutingOutboundCall(e,t,r,i).then(e=>e(this.axios,this.basePath))}patchRoutingOutboundCall(e,t,r){return RoutingOutboundCallServiceApiFp(this.configuration).patchRoutingOutboundCall(e,t,r).then(e=>e(this.axios,this.basePath))}readRoutingOutboundCall(e,t,r){return RoutingOutboundCallServiceApiFp(this.configuration).readRoutingOutboundCall(e,t,r).then(e=>e(this.axios,this.basePath))}searchRoutingOutboundCall(e,t,r,i,a,n,s,o,u,c,l){return RoutingOutboundCallServiceApiFp(this.configuration).searchRoutingOutboundCall(e,t,r,i,a,n,s,o,u,c,l).then(e=>e(this.axios,this.basePath))}updateRoutingOutboundCall(e,t,r){return RoutingOutboundCallServiceApiFp(this.configuration).updateRoutingOutboundCall(e,t,r).then(e=>e(this.axios,this.basePath))}}const RoutingSchemaServiceApiAxiosParamCreator=function(e){return{createRoutingSchema:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRoutingSchema.");const i=parse("/routing/schema",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteRoutingSchema:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteRoutingSchema.");const a="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},patchRoutingSchema:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchRoutingSchema.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchRoutingSchema.");const a="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readRoutingSchema:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readRoutingSchema.");const a="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchRoutingSchema:async(t,r,i,a,n,s,o,u,c,l,d={})=>{const p=parse("/routing/schema",!0);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...d},g={},A={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==t&&(A.page=t),void 0!==r&&(A.size=r),void 0!==i&&(A.q=i),void 0!==a&&(A.sort=a),n&&(A.fields=n),s&&(A.id=s),void 0!==o&&(A.name=o),u&&(A.type=u),void 0!==c&&(A.editor=c),l&&(A.tags=l),p.query={...p.query,...A,...d.query},delete p.search;let f=h&&h.headers?h.headers:{};return y.headers={...g,...f,...d.headers},{url:format(p),options:y}},searchRoutingSchemaTags:async(t,r,i,a,n,s,o={})=>{const u=parse("/routing/schema/tags",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.type=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateRoutingSchema:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRoutingSchema.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateRoutingSchema.");const a="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},RoutingSchemaServiceApiFp=function(e){return{async createRoutingSchema(t,r){const i=await RoutingSchemaServiceApiAxiosParamCreator(e).createRoutingSchema(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteRoutingSchema(t,r,i){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).deleteRoutingSchema(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchRoutingSchema(t,r,i){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).patchRoutingSchema(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readRoutingSchema(t,r,i){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).readRoutingSchema(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchRoutingSchema(t,r,i,a,n,s,o,u,c,l,d){const p=await RoutingSchemaServiceApiAxiosParamCreator(e).searchRoutingSchema(t,r,i,a,n,s,o,u,c,l,d);return(e=globalAxios,t=BASE_PATH)=>{const r={...p.options,url:t+p.url};return e.request(r)}},async searchRoutingSchemaTags(t,r,i,a,n,s,o){const u=await RoutingSchemaServiceApiAxiosParamCreator(e).searchRoutingSchemaTags(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateRoutingSchema(t,r,i){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).updateRoutingSchema(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RoutingSchemaServiceApiFactory=function(e,t,r){return{createRoutingSchema:(i,a)=>RoutingSchemaServiceApiFp(e).createRoutingSchema(i,a).then(e=>e(r,t)),deleteRoutingSchema:(i,a,n)=>RoutingSchemaServiceApiFp(e).deleteRoutingSchema(i,a,n).then(e=>e(r,t)),patchRoutingSchema:(i,a,n)=>RoutingSchemaServiceApiFp(e).patchRoutingSchema(i,a,n).then(e=>e(r,t)),readRoutingSchema:(i,a,n)=>RoutingSchemaServiceApiFp(e).readRoutingSchema(i,a,n).then(e=>e(r,t)),searchRoutingSchema:(i,a,n,s,o,u,c,l,d,p,h)=>RoutingSchemaServiceApiFp(e).searchRoutingSchema(i,a,n,s,o,u,c,l,d,p,h).then(e=>e(r,t)),searchRoutingSchemaTags:(i,a,n,s,o,u,c)=>RoutingSchemaServiceApiFp(e).searchRoutingSchemaTags(i,a,n,s,o,u,c).then(e=>e(r,t)),updateRoutingSchema:(i,a,n)=>RoutingSchemaServiceApiFp(e).updateRoutingSchema(i,a,n).then(e=>e(r,t))}};class RoutingSchemaServiceApi extends BaseAPI{createRoutingSchema(e,t){return RoutingSchemaServiceApiFp(this.configuration).createRoutingSchema(e,t).then(e=>e(this.axios,this.basePath))}deleteRoutingSchema(e,t,r){return RoutingSchemaServiceApiFp(this.configuration).deleteRoutingSchema(e,t,r).then(e=>e(this.axios,this.basePath))}patchRoutingSchema(e,t,r){return RoutingSchemaServiceApiFp(this.configuration).patchRoutingSchema(e,t,r).then(e=>e(this.axios,this.basePath))}readRoutingSchema(e,t,r){return RoutingSchemaServiceApiFp(this.configuration).readRoutingSchema(e,t,r).then(e=>e(this.axios,this.basePath))}searchRoutingSchema(e,t,r,i,a,n,s,o,u,c,l){return RoutingSchemaServiceApiFp(this.configuration).searchRoutingSchema(e,t,r,i,a,n,s,o,u,c,l).then(e=>e(this.axios,this.basePath))}searchRoutingSchemaTags(e,t,r,i,a,n,s){return RoutingSchemaServiceApiFp(this.configuration).searchRoutingSchemaTags(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateRoutingSchema(e,t,r){return RoutingSchemaServiceApiFp(this.configuration).updateRoutingSchema(e,t,r).then(e=>e(this.axios,this.basePath))}}const RoutingVariableServiceApiAxiosParamCreator=function(e){return{createRoutingVariable:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRoutingVariable.");const i=parse("/routing/variables",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteRoutingVariable:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteRoutingVariable.");const a="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readRoutingVariable:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readRoutingVariable.");const a="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchRoutingVariable:async(t,r,i,a={})=>{const n=parse("/routing/variables",!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...a},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==t&&(c.page=t),void 0!==r&&(c.size=r),void 0!==i&&(c.domain_id=i),n.query={...n.query,...c,...a.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...a.headers},{url:format(n),options:o}},updateRoutingVariable:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRoutingVariable.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateRoutingVariable.");const a="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},RoutingVariableServiceApiFp=function(e){return{async createRoutingVariable(t,r){const i=await RoutingVariableServiceApiAxiosParamCreator(e).createRoutingVariable(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteRoutingVariable(t,r,i){const a=await RoutingVariableServiceApiAxiosParamCreator(e).deleteRoutingVariable(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readRoutingVariable(t,r,i){const a=await RoutingVariableServiceApiAxiosParamCreator(e).readRoutingVariable(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchRoutingVariable(t,r,i,a){const n=await RoutingVariableServiceApiAxiosParamCreator(e).searchRoutingVariable(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async updateRoutingVariable(t,r,i){const a=await RoutingVariableServiceApiAxiosParamCreator(e).updateRoutingVariable(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RoutingVariableServiceApiFactory=function(e,t,r){return{createRoutingVariable:(i,a)=>RoutingVariableServiceApiFp(e).createRoutingVariable(i,a).then(e=>e(r,t)),deleteRoutingVariable:(i,a,n)=>RoutingVariableServiceApiFp(e).deleteRoutingVariable(i,a,n).then(e=>e(r,t)),readRoutingVariable:(i,a,n)=>RoutingVariableServiceApiFp(e).readRoutingVariable(i,a,n).then(e=>e(r,t)),searchRoutingVariable:(i,a,n,s)=>RoutingVariableServiceApiFp(e).searchRoutingVariable(i,a,n,s).then(e=>e(r,t)),updateRoutingVariable:(i,a,n)=>RoutingVariableServiceApiFp(e).updateRoutingVariable(i,a,n).then(e=>e(r,t))}};class RoutingVariableServiceApi extends BaseAPI{createRoutingVariable(e,t){return RoutingVariableServiceApiFp(this.configuration).createRoutingVariable(e,t).then(e=>e(this.axios,this.basePath))}deleteRoutingVariable(e,t,r){return RoutingVariableServiceApiFp(this.configuration).deleteRoutingVariable(e,t,r).then(e=>e(this.axios,this.basePath))}readRoutingVariable(e,t,r){return RoutingVariableServiceApiFp(this.configuration).readRoutingVariable(e,t,r).then(e=>e(this.axios,this.basePath))}searchRoutingVariable(e,t,r,i){return RoutingVariableServiceApiFp(this.configuration).searchRoutingVariable(e,t,r,i).then(e=>e(this.axios,this.basePath))}updateRoutingVariable(e,t,r){return RoutingVariableServiceApiFp(this.configuration).updateRoutingVariable(e,t,r).then(e=>e(this.axios,this.basePath))}}const SkillServiceApiAxiosParamCreator=function(e){return{createSkill:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createSkill.");const i=parse("/call_center/skills",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},createSkillAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("skillId","Required parameter skillId was null or undefined when calling createSkillAgent.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createSkillAgent.");const a="/call_center/skills/{skill_id}/agents".replace("{skill_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteSkill.");const a="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},deleteSkillAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("skillId","Required parameter skillId was null or undefined when calling deleteSkillAgent.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling deleteSkillAgent.");const a="/call_center/skills/{skill_id}/agents".replace("{skill_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},patchSkillAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("skillId","Required parameter skillId was null or undefined when calling patchSkillAgent.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchSkillAgent.");const a="/call_center/skills/{skill_id}/agents".replace("{skill_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readSkill.");const a="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchSkill:async(t,r,i,a,n,s,o={})=>{const u=parse("/call_center/skills",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},searchSkillAgent:async(t,r,i,a,n,s,o,u,c={})=>{if(null==t)throw new RequiredError("skillId","Required parameter skillId was null or undefined when calling searchSkillAgent.");const l="/call_center/skills/{skill_id}/agents".replace("{skill_id}",encodeURIComponent(String(t))),d=parse(l,!0);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...c},y={},g={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;y["X-Webitel-Access"]=t}void 0!==r&&(g.page=r),void 0!==i&&(g.size=i),void 0!==a&&(g.q=a),void 0!==n&&(g.sort=n),s&&(g.fields=s),o&&(g.id=o),u&&(g.agent_id=u),d.query={...d.query,...g,...c.query},delete d.search;let A=p&&p.headers?p.headers:{};return h.headers={...y,...A,...c.headers},{url:format(d),options:h}},updateSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateSkill.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateSkill.");const a="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},SkillServiceApiFp=function(e){return{async createSkill(t,r){const i=await SkillServiceApiAxiosParamCreator(e).createSkill(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createSkillAgent(t,r,i){const a=await SkillServiceApiAxiosParamCreator(e).createSkillAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteSkill(t,r,i){const a=await SkillServiceApiAxiosParamCreator(e).deleteSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteSkillAgent(t,r,i){const a=await SkillServiceApiAxiosParamCreator(e).deleteSkillAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchSkillAgent(t,r,i){const a=await SkillServiceApiAxiosParamCreator(e).patchSkillAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readSkill(t,r,i){const a=await SkillServiceApiAxiosParamCreator(e).readSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchSkill(t,r,i,a,n,s,o){const u=await SkillServiceApiAxiosParamCreator(e).searchSkill(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async searchSkillAgent(t,r,i,a,n,s,o,u,c){const l=await SkillServiceApiAxiosParamCreator(e).searchSkillAgent(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async updateSkill(t,r,i){const a=await SkillServiceApiAxiosParamCreator(e).updateSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},SkillServiceApiFactory=function(e,t,r){return{createSkill:(i,a)=>SkillServiceApiFp(e).createSkill(i,a).then(e=>e(r,t)),createSkillAgent:(i,a,n)=>SkillServiceApiFp(e).createSkillAgent(i,a,n).then(e=>e(r,t)),deleteSkill:(i,a,n)=>SkillServiceApiFp(e).deleteSkill(i,a,n).then(e=>e(r,t)),deleteSkillAgent:(i,a,n)=>SkillServiceApiFp(e).deleteSkillAgent(i,a,n).then(e=>e(r,t)),patchSkillAgent:(i,a,n)=>SkillServiceApiFp(e).patchSkillAgent(i,a,n).then(e=>e(r,t)),readSkill:(i,a,n)=>SkillServiceApiFp(e).readSkill(i,a,n).then(e=>e(r,t)),searchSkill:(i,a,n,s,o,u,c)=>SkillServiceApiFp(e).searchSkill(i,a,n,s,o,u,c).then(e=>e(r,t)),searchSkillAgent:(i,a,n,s,o,u,c,l,d)=>SkillServiceApiFp(e).searchSkillAgent(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),updateSkill:(i,a,n)=>SkillServiceApiFp(e).updateSkill(i,a,n).then(e=>e(r,t))}};class SkillServiceApi extends BaseAPI{createSkill(e,t){return SkillServiceApiFp(this.configuration).createSkill(e,t).then(e=>e(this.axios,this.basePath))}createSkillAgent(e,t,r){return SkillServiceApiFp(this.configuration).createSkillAgent(e,t,r).then(e=>e(this.axios,this.basePath))}deleteSkill(e,t,r){return SkillServiceApiFp(this.configuration).deleteSkill(e,t,r).then(e=>e(this.axios,this.basePath))}deleteSkillAgent(e,t,r){return SkillServiceApiFp(this.configuration).deleteSkillAgent(e,t,r).then(e=>e(this.axios,this.basePath))}patchSkillAgent(e,t,r){return SkillServiceApiFp(this.configuration).patchSkillAgent(e,t,r).then(e=>e(this.axios,this.basePath))}readSkill(e,t,r){return SkillServiceApiFp(this.configuration).readSkill(e,t,r).then(e=>e(this.axios,this.basePath))}searchSkill(e,t,r,i,a,n,s){return SkillServiceApiFp(this.configuration).searchSkill(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}searchSkillAgent(e,t,r,i,a,n,s,o,u){return SkillServiceApiFp(this.configuration).searchSkillAgent(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateSkill(e,t,r){return SkillServiceApiFp(this.configuration).updateSkill(e,t,r).then(e=>e(this.axios,this.basePath))}}const SystemSettingServiceApiAxiosParamCreator=function(e){return{createSystemSetting:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createSystemSetting.");const i=parse("/settings",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteSystemSetting:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteSystemSetting.");const i="/settings/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchSystemSetting:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchSystemSetting.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchSystemSetting.");const a="/settings/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readSystemSetting:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readSystemSetting.");const i="/settings/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchSystemSetting:async(t,r,i,a,n,s={})=>{const o=parse("/settings",!0);let u;e&&(u=e.baseOptions);const c={method:"GET",...u,...s},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}void 0!==t&&(d.page=t),void 0!==r&&(d.size=r),void 0!==i&&(d.q=i),void 0!==a&&(d.sort=a),n&&(d.fields=n),o.query={...o.query,...d,...s.query},delete o.search;let p=u&&u.headers?u.headers:{};return c.headers={...l,...p,...s.headers},{url:format(o),options:c}},updateSystemSetting:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateSystemSetting.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateSystemSetting.");const a="/settings/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},SystemSettingServiceApiFp=function(e){return{async createSystemSetting(t,r){const i=await SystemSettingServiceApiAxiosParamCreator(e).createSystemSetting(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteSystemSetting(t,r){const i=await SystemSettingServiceApiAxiosParamCreator(e).deleteSystemSetting(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchSystemSetting(t,r,i){const a=await SystemSettingServiceApiAxiosParamCreator(e).patchSystemSetting(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readSystemSetting(t,r){const i=await SystemSettingServiceApiAxiosParamCreator(e).readSystemSetting(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchSystemSetting(t,r,i,a,n,s){const o=await SystemSettingServiceApiAxiosParamCreator(e).searchSystemSetting(t,r,i,a,n,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...o.options,url:t+o.url};return e.request(r)}},async updateSystemSetting(t,r,i){const a=await SystemSettingServiceApiAxiosParamCreator(e).updateSystemSetting(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},SystemSettingServiceApiFactory=function(e,t,r){return{createSystemSetting:(i,a)=>SystemSettingServiceApiFp(e).createSystemSetting(i,a).then(e=>e(r,t)),deleteSystemSetting:(i,a)=>SystemSettingServiceApiFp(e).deleteSystemSetting(i,a).then(e=>e(r,t)),patchSystemSetting:(i,a,n)=>SystemSettingServiceApiFp(e).patchSystemSetting(i,a,n).then(e=>e(r,t)),readSystemSetting:(i,a)=>SystemSettingServiceApiFp(e).readSystemSetting(i,a).then(e=>e(r,t)),searchSystemSetting:(i,a,n,s,o,u)=>SystemSettingServiceApiFp(e).searchSystemSetting(i,a,n,s,o,u).then(e=>e(r,t)),updateSystemSetting:(i,a,n)=>SystemSettingServiceApiFp(e).updateSystemSetting(i,a,n).then(e=>e(r,t))}};class SystemSettingServiceApi extends BaseAPI{createSystemSetting(e,t){return SystemSettingServiceApiFp(this.configuration).createSystemSetting(e,t).then(e=>e(this.axios,this.basePath))}deleteSystemSetting(e,t){return SystemSettingServiceApiFp(this.configuration).deleteSystemSetting(e,t).then(e=>e(this.axios,this.basePath))}patchSystemSetting(e,t,r){return SystemSettingServiceApiFp(this.configuration).patchSystemSetting(e,t,r).then(e=>e(this.axios,this.basePath))}readSystemSetting(e,t){return SystemSettingServiceApiFp(this.configuration).readSystemSetting(e,t).then(e=>e(this.axios,this.basePath))}searchSystemSetting(e,t,r,i,a,n){return SystemSettingServiceApiFp(this.configuration).searchSystemSetting(e,t,r,i,a,n).then(e=>e(this.axios,this.basePath))}updateSystemSetting(e,t,r){return SystemSettingServiceApiFp(this.configuration).updateSystemSetting(e,t,r).then(e=>e(this.axios,this.basePath))}}const TimezonesApiAxiosParamCreator=function(e){return{deleteTimezone:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deleteTimezone.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteTimezone.");const n="/contacts/{contact_id}/timezones/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},deleteTimezones:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deleteTimezones.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteTimezones.");const n="/contacts/{contact_id}/timezones".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),r&&(l.etag=r),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},listTimezones:async(t,r,i,a,n,s,o,u,c={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling listTimezones.");const l="/contacts/{contact_id}/timezones".replace("{contact_id}",encodeURIComponent(String(t))),d=parse(l,!0);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...c},y={},g={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;y["X-Webitel-Access"]=t}void 0!==r&&(g.page=r),void 0!==i&&(g.size=i),void 0!==a&&(g.q=a),n&&(g.sort=n),s&&(g.fields=s),o&&(g.id=o),void 0!==u&&(g.primary=u),d.query={...d.query,...g,...c.query},delete d.search;let A=p&&p.headers?p.headers:{};return h.headers={...y,...A,...c.headers},{url:format(d),options:h}},locateTimezone:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling locateTimezone.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling locateTimezone.");const n="/contacts/{contact_id}/timezones/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},mergeTimezones:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling mergeTimezones.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling mergeTimezones.");const n="/contacts/{contact_id}/timezones".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"POST",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},resetTimezones:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling resetTimezones.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling resetTimezones.");const n="/contacts/{contact_id}/timezones".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},updateTimezone:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updateTimezone.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updateTimezone.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updateTimezone.");const s="/contacts/{contact_id}/timezones/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PUT",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}},updateTimezone2:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updateTimezone2.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updateTimezone2.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updateTimezone2.");const s="/contacts/{contact_id}/timezones/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PATCH",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},TimezonesApiFp=function(e){return{async deleteTimezone(t,r,i,a){const n=await TimezonesApiAxiosParamCreator(e).deleteTimezone(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async deleteTimezones(t,r,i,a){const n=await TimezonesApiAxiosParamCreator(e).deleteTimezones(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async listTimezones(t,r,i,a,n,s,o,u,c){const l=await TimezonesApiAxiosParamCreator(e).listTimezones(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async locateTimezone(t,r,i,a){const n=await TimezonesApiAxiosParamCreator(e).locateTimezone(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async mergeTimezones(t,r,i,a){const n=await TimezonesApiAxiosParamCreator(e).mergeTimezones(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async resetTimezones(t,r,i,a){const n=await TimezonesApiAxiosParamCreator(e).resetTimezones(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async updateTimezone(t,r,i,a,n){const s=await TimezonesApiAxiosParamCreator(e).updateTimezone(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async updateTimezone2(t,r,i,a,n){const s=await TimezonesApiAxiosParamCreator(e).updateTimezone2(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}}}},TimezonesApiFactory=function(e,t,r){return{deleteTimezone:(i,a,n,s)=>TimezonesApiFp(e).deleteTimezone(i,a,n,s).then(e=>e(r,t)),deleteTimezones:(i,a,n,s)=>TimezonesApiFp(e).deleteTimezones(i,a,n,s).then(e=>e(r,t)),listTimezones:(i,a,n,s,o,u,c,l,d)=>TimezonesApiFp(e).listTimezones(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),locateTimezone:(i,a,n,s)=>TimezonesApiFp(e).locateTimezone(i,a,n,s).then(e=>e(r,t)),mergeTimezones:(i,a,n,s)=>TimezonesApiFp(e).mergeTimezones(i,a,n,s).then(e=>e(r,t)),resetTimezones:(i,a,n,s)=>TimezonesApiFp(e).resetTimezones(i,a,n,s).then(e=>e(r,t)),updateTimezone:(i,a,n,s,o)=>TimezonesApiFp(e).updateTimezone(i,a,n,s,o).then(e=>e(r,t)),updateTimezone2:(i,a,n,s,o)=>TimezonesApiFp(e).updateTimezone2(i,a,n,s,o).then(e=>e(r,t))}};class TimezonesApi extends BaseAPI{deleteTimezone(e,t,r,i){return TimezonesApiFp(this.configuration).deleteTimezone(e,t,r,i).then(e=>e(this.axios,this.basePath))}deleteTimezones(e,t,r,i){return TimezonesApiFp(this.configuration).deleteTimezones(e,t,r,i).then(e=>e(this.axios,this.basePath))}listTimezones(e,t,r,i,a,n,s,o,u){return TimezonesApiFp(this.configuration).listTimezones(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}locateTimezone(e,t,r,i){return TimezonesApiFp(this.configuration).locateTimezone(e,t,r,i).then(e=>e(this.axios,this.basePath))}mergeTimezones(e,t,r,i){return TimezonesApiFp(this.configuration).mergeTimezones(e,t,r,i).then(e=>e(this.axios,this.basePath))}resetTimezones(e,t,r,i){return TimezonesApiFp(this.configuration).resetTimezones(e,t,r,i).then(e=>e(this.axios,this.basePath))}updateTimezone(e,t,r,i,a){return TimezonesApiFp(this.configuration).updateTimezone(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}updateTimezone2(e,t,r,i,a){return TimezonesApiFp(this.configuration).updateTimezone2(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}}const TriggerServiceApiAxiosParamCreator=function(e){return{createTrigger:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createTrigger.");const i=parse("/trigger",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},createTriggerJob:async(t,r,i={})=>{if(null==t)throw new RequiredError("triggerId","Required parameter triggerId was null or undefined when calling createTriggerJob.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createTriggerJob.");const a="/trigger/{trigger_id}/job".replace("{trigger_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteTrigger:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteTrigger.");const i="/trigger/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchTrigger:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchTrigger.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchTrigger.");const a="/trigger/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readTrigger:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readTrigger.");const i="/trigger/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchTrigger:async(t,r,i,a,n,s,o,u={})=>{const c=parse("/trigger",!0);let l;e&&(l=e.baseOptions);const d={method:"GET",...l,...u},p={},h={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;p["X-Webitel-Access"]=t}void 0!==t&&(h.page=t),void 0!==r&&(h.size=r),void 0!==i&&(h.q=i),void 0!==a&&(h.sort=a),n&&(h.fields=n),s&&(h.id=s),o&&(h.schema_id=o),c.query={...c.query,...h,...u.query},delete c.search;let y=l&&l.headers?l.headers:{};return d.headers={...p,...y,...u.headers},{url:format(c),options:d}},searchTriggerJob:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y={})=>{if(null==t)throw new RequiredError("triggerId","Required parameter triggerId was null or undefined when calling searchTriggerJob.");const g="/trigger/{trigger_id}/job".replace("{trigger_id}",encodeURIComponent(String(t))),A=parse(g,!0);let f;e&&(f=e.baseOptions);const m={method:"GET",...f,...y},w={},b={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;w["X-Webitel-Access"]=t}void 0!==r&&(b.page=r),void 0!==i&&(b.size=i),void 0!==a&&(b.q=a),void 0!==n&&(b.sort=n),s&&(b.fields=s),void 0!==o&&(b["created_at.from"]=o),void 0!==u&&(b["created_at.to"]=u),void 0!==c&&(b["started_at.from"]=c),void 0!==l&&(b["started_at.to"]=l),void 0!==d&&(b["duration.from"]=d),void 0!==p&&(b["duration.to"]=p),h&&(b.state=h),A.query={...A.query,...b,...y.query},delete A.search;let S=f&&f.headers?f.headers:{};return m.headers={...w,...S,...y.headers},{url:format(A),options:m}},updateTrigger:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateTrigger.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateTrigger.");const a="/trigger/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},TriggerServiceApiFp=function(e){return{async createTrigger(t,r){const i=await TriggerServiceApiAxiosParamCreator(e).createTrigger(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createTriggerJob(t,r,i){const a=await TriggerServiceApiAxiosParamCreator(e).createTriggerJob(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteTrigger(t,r){const i=await TriggerServiceApiAxiosParamCreator(e).deleteTrigger(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchTrigger(t,r,i){const a=await TriggerServiceApiAxiosParamCreator(e).patchTrigger(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readTrigger(t,r){const i=await TriggerServiceApiAxiosParamCreator(e).readTrigger(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchTrigger(t,r,i,a,n,s,o,u){const c=await TriggerServiceApiAxiosParamCreator(e).searchTrigger(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async searchTriggerJob(t,r,i,a,n,s,o,u,c,l,d,p,h,y){const g=await TriggerServiceApiAxiosParamCreator(e).searchTriggerJob(t,r,i,a,n,s,o,u,c,l,d,p,h,y);return(e=globalAxios,t=BASE_PATH)=>{const r={...g.options,url:t+g.url};return e.request(r)}},async updateTrigger(t,r,i){const a=await TriggerServiceApiAxiosParamCreator(e).updateTrigger(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},TriggerServiceApiFactory=function(e,t,r){return{createTrigger:(i,a)=>TriggerServiceApiFp(e).createTrigger(i,a).then(e=>e(r,t)),createTriggerJob:(i,a,n)=>TriggerServiceApiFp(e).createTriggerJob(i,a,n).then(e=>e(r,t)),deleteTrigger:(i,a)=>TriggerServiceApiFp(e).deleteTrigger(i,a).then(e=>e(r,t)),patchTrigger:(i,a,n)=>TriggerServiceApiFp(e).patchTrigger(i,a,n).then(e=>e(r,t)),readTrigger:(i,a)=>TriggerServiceApiFp(e).readTrigger(i,a).then(e=>e(r,t)),searchTrigger:(i,a,n,s,o,u,c,l)=>TriggerServiceApiFp(e).searchTrigger(i,a,n,s,o,u,c,l).then(e=>e(r,t)),searchTriggerJob:(i,a,n,s,o,u,c,l,d,p,h,y,g,A)=>TriggerServiceApiFp(e).searchTriggerJob(i,a,n,s,o,u,c,l,d,p,h,y,g,A).then(e=>e(r,t)),updateTrigger:(i,a,n)=>TriggerServiceApiFp(e).updateTrigger(i,a,n).then(e=>e(r,t))}};class TriggerServiceApi extends BaseAPI{createTrigger(e,t){return TriggerServiceApiFp(this.configuration).createTrigger(e,t).then(e=>e(this.axios,this.basePath))}createTriggerJob(e,t,r){return TriggerServiceApiFp(this.configuration).createTriggerJob(e,t,r).then(e=>e(this.axios,this.basePath))}deleteTrigger(e,t){return TriggerServiceApiFp(this.configuration).deleteTrigger(e,t).then(e=>e(this.axios,this.basePath))}patchTrigger(e,t,r){return TriggerServiceApiFp(this.configuration).patchTrigger(e,t,r).then(e=>e(this.axios,this.basePath))}readTrigger(e,t){return TriggerServiceApiFp(this.configuration).readTrigger(e,t).then(e=>e(this.axios,this.basePath))}searchTrigger(e,t,r,i,a,n,s,o){return TriggerServiceApiFp(this.configuration).searchTrigger(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}searchTriggerJob(e,t,r,i,a,n,s,o,u,c,l,d,p,h){return TriggerServiceApiFp(this.configuration).searchTriggerJob(e,t,r,i,a,n,s,o,u,c,l,d,p,h).then(e=>e(this.axios,this.basePath))}updateTrigger(e,t,r){return TriggerServiceApiFp(this.configuration).updateTrigger(e,t,r).then(e=>e(this.axios,this.basePath))}}const UserHelperServiceApiAxiosParamCreator=function(e){return{defaultDeviceConfig:async(t,r={})=>{if(null==t)throw new RequiredError("type","Required parameter type was null or undefined when calling defaultDeviceConfig.");const i="/user/device/config/{type}".replace("{type}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}}}},UserHelperServiceApiFp=function(e){return{async defaultDeviceConfig(t,r){const i=await UserHelperServiceApiAxiosParamCreator(e).defaultDeviceConfig(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}}}},UserHelperServiceApiFactory=function(e,t,r){return{defaultDeviceConfig:(i,a)=>UserHelperServiceApiFp(e).defaultDeviceConfig(i,a).then(e=>e(r,t))}};class UserHelperServiceApi extends BaseAPI{defaultDeviceConfig(e,t){return UserHelperServiceApiFp(this.configuration).defaultDeviceConfig(e,t).then(e=>e(this.axios,this.basePath))}}const VariablesApiAxiosParamCreator=function(e){return{deleteVariable:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deleteVariable.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteVariable.");const n="/contacts/{contact_id}/variables/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},deleteVariables:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deleteVariables.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteVariables.");const n="/contacts/{contact_id}/variables".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),r&&(l.etag=r),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},listVariables:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling listVariables.");const c="/contacts/{contact_id}/variables".replace("{contact_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.q=a),n&&(y.sort=n),s&&(y.fields=s),o&&(y.id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},mergeVariables:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling mergeVariables.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling mergeVariables.");const n="/contacts/{contact_id}/variables".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"POST",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},resetVariables:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling resetVariables.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling resetVariables.");const n="/contacts/{contact_id}/variables".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},updateVariable:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updateVariable.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updateVariable.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updateVariable.");const s="/contacts/{contact_id}/variables/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PUT",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}},updateVariable2:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updateVariable2.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updateVariable2.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updateVariable2.");const s="/contacts/{contact_id}/variables/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PATCH",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},VariablesApiFp=function(e){return{async deleteVariable(t,r,i,a){const n=await VariablesApiAxiosParamCreator(e).deleteVariable(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async deleteVariables(t,r,i,a){const n=await VariablesApiAxiosParamCreator(e).deleteVariables(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async listVariables(t,r,i,a,n,s,o,u){const c=await VariablesApiAxiosParamCreator(e).listVariables(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async mergeVariables(t,r,i,a){const n=await VariablesApiAxiosParamCreator(e).mergeVariables(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async resetVariables(t,r,i,a){const n=await VariablesApiAxiosParamCreator(e).resetVariables(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async updateVariable(t,r,i,a,n){const s=await VariablesApiAxiosParamCreator(e).updateVariable(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async updateVariable2(t,r,i,a,n){const s=await VariablesApiAxiosParamCreator(e).updateVariable2(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}}}},VariablesApiFactory=function(e,t,r){return{deleteVariable:(i,a,n,s)=>VariablesApiFp(e).deleteVariable(i,a,n,s).then(e=>e(r,t)),deleteVariables:(i,a,n,s)=>VariablesApiFp(e).deleteVariables(i,a,n,s).then(e=>e(r,t)),listVariables:(i,a,n,s,o,u,c,l)=>VariablesApiFp(e).listVariables(i,a,n,s,o,u,c,l).then(e=>e(r,t)),mergeVariables:(i,a,n,s)=>VariablesApiFp(e).mergeVariables(i,a,n,s).then(e=>e(r,t)),resetVariables:(i,a,n,s)=>VariablesApiFp(e).resetVariables(i,a,n,s).then(e=>e(r,t)),updateVariable:(i,a,n,s,o)=>VariablesApiFp(e).updateVariable(i,a,n,s,o).then(e=>e(r,t)),updateVariable2:(i,a,n,s,o)=>VariablesApiFp(e).updateVariable2(i,a,n,s,o).then(e=>e(r,t))}};class VariablesApi extends BaseAPI{deleteVariable(e,t,r,i){return VariablesApiFp(this.configuration).deleteVariable(e,t,r,i).then(e=>e(this.axios,this.basePath))}deleteVariables(e,t,r,i){return VariablesApiFp(this.configuration).deleteVariables(e,t,r,i).then(e=>e(this.axios,this.basePath))}listVariables(e,t,r,i,a,n,s,o){return VariablesApiFp(this.configuration).listVariables(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}mergeVariables(e,t,r,i){return VariablesApiFp(this.configuration).mergeVariables(e,t,r,i).then(e=>e(this.axios,this.basePath))}resetVariables(e,t,r,i){return VariablesApiFp(this.configuration).resetVariables(e,t,r,i).then(e=>e(this.axios,this.basePath))}updateVariable(e,t,r,i,a){return VariablesApiFp(this.configuration).updateVariable(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}updateVariable2(e,t,r,i,a){return VariablesApiFp(this.configuration).updateVariable2(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}}class Configuration{constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions}}var EngineAuditQuestionType,EngineBoolFilter,EngineCommunicationChannels,EnginePresetQuerySection,EngineRoutingSchemaType,EngineTriggerJobState,EngineTriggerType,GoogleProtobufNullValue,HistoryFileJobHistoryFileJobAction,HistoryFileJobHistoryFileJobState,LoggerAction,LoggerAvailableSystemObjects,ProtobufNullValue,StorageImportSourceType,StorageProviderType,StorageServiceType,StorageUploadStatusCode,WebitelContactsAccessMode;!function(e){e.Default="question_default",e.Score="question_score",e.Option="question_option"}(EngineAuditQuestionType||(EngineAuditQuestionType={})),function(e){e.Undefined="undefined",e.True="true",e.False="false"}(EngineBoolFilter||(EngineBoolFilter={})),function(e){e.Undefined="Undefined",e.Phone="Phone",e.Email="Email",e.Messaging="Messaging"}(EngineCommunicationChannels||(EngineCommunicationChannels={})),function(e){e.Default="section_default",e.Calls="section_calls"}(EnginePresetQuerySection||(EnginePresetQuerySection={})),function(e){e.Default="default",e.Voice="voice",e.Chat="chat",e.Processing="processing",e.Service="service"}(EngineRoutingSchemaType||(EngineRoutingSchemaType={})),function(e){e.Idle="idle",e.Active="active",e.Done="done",e.Error="error"}(EngineTriggerJobState||(EngineTriggerJobState={})),function(e){e.DefaultTriggerType="default_trigger_type",e.Cron="cron"}(EngineTriggerType||(EngineTriggerType={})),function(e){e.NULLVALUE="NULL_VALUE"}(GoogleProtobufNullValue||(GoogleProtobufNullValue={})),function(e){e.Undefined="undefined",e.STT="STT",e.Delete="delete"}(HistoryFileJobHistoryFileJobAction||(HistoryFileJobHistoryFileJobAction={})),function(e){e.Idle="idle",e.Active="active",e.Finished="finished",e.Error="error"}(HistoryFileJobHistoryFileJobState||(HistoryFileJobHistoryFileJobState={})),function(e){e.DefaultNoAction="default_no_action",e.Create="create",e.Update="update",e.Read="read",e.Delete="delete"}(LoggerAction||(LoggerAction={})),function(e){e.CcQueue="cc_queue",e.Schema="schema"}(LoggerAvailableSystemObjects||(LoggerAvailableSystemObjects={})),function(e){e.NULLVALUE="NULL_VALUE"}(ProtobufNullValue||(ProtobufNullValue={})),function(e){e.DefaultSourceType="DefaultSourceType",e.Dialer="Dialer"}(StorageImportSourceType||(StorageImportSourceType={})),function(e){e.DefaultProvider="DefaultProvider",e.Microsoft="Microsoft",e.Google="Google"}(StorageProviderType||(StorageProviderType={})),function(e){e.DefaultService="DefaultService",e.STT="STT",e.TTS="TTS"}(StorageServiceType||(StorageServiceType={})),function(e){e.Unknown="Unknown",e.Ok="Ok",e.Failed="Failed"}(StorageUploadStatusCode||(StorageUploadStatusCode={})),function(e){e.READ="READ",e.WRITE="WRITE",e.DELETE="DELETE"}(WebitelContactsAccessMode||(WebitelContactsAccessMode={}));class Log{debug(e,...t){this.emitLogMessage("debug",e,t)}info(e,...t){this.emitLogMessage("info",e,t)}warn(e,...t){this.emitLogMessage("warn",e,t)}error(e,...t){this.emitLogMessage("error",e,t)}emitLogMessage(e,t,r){r.length>0?console[e](t,...r):console[e](t)}}class Session{constructor(e){this.session=e.session,this.callId=e.request.getHeader("X-Webitel-Uuid"),this.incoming="incoming"===e.session.direction,this.instanceId=e.request.getHeader("X-Webitel-Sock-Id")}get id(){return this.session.id}getLocalMedia(){if(this.session.connection){const e=this.session.connection.getLocalStreams();if(e.length)return e}return[]}getPeerMedia(){if(this.session.connection){const e=this.session.connection.getRemoteStreams();if(e.length)return e}return[]}answer(e){return new Promise(()=>{this.session.answer(e)})}}class SipPhone extends EventEmitter{constructor(e,t){super(),this.instanceId=e,this.type="webrtc",this.sessionCache=new Map,this.log=new Log,t?(this.log.info(`JsSip version: ${version}`),debug.enable("*")):debug.disable(),this.on("unregistered",()=>{this.sessionCache.clear()})}async callOption(e={}){const t=await this.getUserCallStream(e);return{sessionTimersExpires:120,pcConfig:e.disableStun?void 0:{iceServers:[{urls:["stun:stun.l.google.com:19302"]}]},mediaStream:t}}async answer(e,t){if(this.sessionCache.has(e)){const r=this.sessionCache.get(e),i=await this.callOption(t);return r.answer(i)}return!1}async call(e){const t={};let r=null;if(e.params&&(t.audio=e.params.audio,t.video=e.params.video||!1,t.screen=e.params.screen||!1,t.disableStun=e.params.disableStun||!1),"string"!=typeof e.destination)throw new Error("bad destination type");const i=await this.callOption(t);e.params&&e.params.display&&(r={extraHeaders:[`X-Webitel-Display: ${e.params.display}`]}),await this.ua.call(e.destination,{...i,...r})}async register(e){const t=new WebSocketInterface(e.server),r={realm:e.realm,uri:e.uri,authorization_user:e.authorization_user,ha1:e.ha1,user_agent:SipPhone.userAgent,sockets:[t],session_timers:!0,display_name:e.display_name,register_expires:e.register_expires||90,connection_recovery_min_interval:5,connection_recovery_max_interval:60},i=this.ua=new UA(r);i.on("newRTCSession",e=>{const t=e.session,r=t.id,i=new Session(e);this.storeSession(r,i),t.on("connecting",()=>{this.emit("localStreams",i,t.connection.getLocalStreams())}),t.connection&&t.connection.addEventListener("addstream",e=>{this.emit("peerStreams",i,new Array(e.stream))}),t.on("peerconnection",e=>{e.peerconnection.addEventListener("addstream",async e=>{this.emit("peerStreams",i,new Array(e.stream))})}),t.on("ended",()=>{this.removeSession(r,t.connection)}),t.on("failed",()=>{this.removeSession(r,t.connection)}),t.on("accepted",()=>{i.incoming||this.emit("peerStreams",i,t.connection.getRemoteStreams())}),t.on("confirmed",()=>{}),this.emit("newSession",i)}),i.on("disconnected",e=>{this.emit("unregistered")}),i.on("unregistered",e=>{this.emit("unregistered")}),i.on("registrationFailed",e=>{this.log.error("registrationFailed",e)}),i.on("registered",e=>{this.emit("registered")}),i.start()}async unregister(){this.ua&&(this.ua.terminateSessions(),this.ua.removeAllListeners(),await this.ua.stop(),delete this.ua)}isRegistered(){return!!this.ua&&this.ua.isRegistered()}sipSessionByCallId(e){for(const t of this.allSession)if(t.callId===e)return t;return null}sipSessionBySipId(e){for(const t of this.allSession)if(t.id.startsWith(e))return t;return null}removeSession(e,t){if(t){const e=t.getLocalStreams(),r=t.getRemoteStreams();e&&e.forEach(e=>{e.getTracks().forEach(e=>{e.stop()})}),r&&r.forEach(e=>{e.getTracks().forEach(e=>{e.stop()})})}return!!this.sessionCache.has(e)&&(this.sessionCache.delete(e),!0)}storeSession(e,t){if(this.sessionCache.has(e))throw new Error("Session already store");this.sessionCache.set(e,t)}get allSession(){return Array.from(this.sessionCache.values())}getMediaConstraints(e){return e.screen?{video:!1,audio:!1,screen:!0}:{video:e.video||!1,audio:!0}}getSession(e){return this.sessionCache.has(e)?this.sessionCache.get(e):null}hasSession(e){return this.sessionCache.has(e)}async getUserScreen(){return new Promise(async(e,t)=>{try{e(await navigator.mediaDevices.getDisplayMedia())}catch(e){t(e)}})}async getUserCallStream(e){let t;if(!0===e.screen&&(t=await this.getUserScreen()),!1!==e.audio||e.video){const r=await this.getUserMedia(e.audio,e.video);t?r.getTracks().forEach(e=>{t.addTrack(e)}):t=r}if(!t)throw new Error("bad stream request");return t}async getUserMedia(e,t){return new Promise(async(r,i)=>{const a={audio:!(!1===e),video:void 0};return t&&(a.video={width:{min:10,ideal:1280,max:1920},height:{min:10,ideal:720,max:1080},frameRate:{ideal:10,max:15}}),getMediaStream(a).then(r).catch(i)})}}async function getMediaStream(e){return new Promise((t,r)=>{if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)navigator.mediaDevices.getUserMedia(e).then(e=>t(e)).catch(e=>r(e));else{(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)(e,e=>t(e),e=>r(e))}})}SipPhone.userAgent=`Webitel-Phone/${version}`,SipPhone.sipVersion=version;const VERSION="0.0.2",getVersion=()=>"0.0.2";var TypeErrors,JobState,ChannelName,AgentStatus,ChannelState,ChannelType,CallReportingStatus,EavesdropState,EavesdropType,CallActions,CallDirection,version$1="0.0.2";!function(e){e.RolePermission="api.context.permissions.app_error",e.LicencePermission="api.context.permissions.license",e.PauseNotAllow="app.agent.set_pause.not_allow"}(TypeErrors||(TypeErrors={}));class DeviceNotFoundError extends Error{constructor(e){super(e),this.id=DeviceNotFoundError.id}}DeviceNotFoundError.id="device_not_found";class DeviceNotAllowPermissionError extends Error{constructor(e){super(e),this.id=DeviceNotAllowPermissionError.id}}DeviceNotAllowPermissionError.id="device_not_allow";class RolePermissionError extends Error{constructor(e){super(e),this.id=RolePermissionError.id}}RolePermissionError.id=TypeErrors.RolePermission;class LicencePermissionError extends Error{constructor(e){super(e),this.id=LicencePermissionError.id}}LicencePermissionError.id=TypeErrors.LicencePermission;class PauseNotAllowedError extends Error{constructor(e){super(e),this.id=PauseNotAllowedError.id}}PauseNotAllowedError.id=TypeErrors.PauseNotAllow,function(e){e.Distribute="distribute",e.Offering="offering",e.Bridged="bridged",e.Missed="missed",e.Processing="processing",e.Closed="closed",e.Destroy="destroy"}(JobState||(JobState={})),function(e){e.Call="call",e.Chat="chat",e.Task="task"}(ChannelName||(ChannelName={}));class Task{constructor(e,t,r){this.client=e,this.distribute=r,this.id=t.attempt_id,this.state=JobState.Offering,this.setState(t.status),this.lastStatusChange=t.timestamp,this.createdAt=t.timestamp,this._processing=null,this.offeringAt=0,this.answeredAt=0,this.bridgedAt=0,this.reportedAt=0,this.startProcessingAt=0,this.stopAt=0,this.closedAt=0,this.form=null,this.autoAnswered=!1,this._autoAnswerParam=!1,this._autoAnswerTimerId=null,this.communication=r.communication,this.history=[r]}get queue(){return{id:this.distribute.queue_id,name:this.distribute.queue_name}}get duration(){return Math.round((Date.now()-this.lastStatusChange)/1e3)}get hasForm(){return this.distribute.has_form||!1}get channel(){return this.distribute.channel}get allowAccept(){return this.channel===ChannelName.Task&&0===this.bridgedAt&&0===this.closedAt}get allowDecline(){return this.allowAccept}get allowClose(){return this.channel===ChannelName.Task&&0===this.closedAt&&this.bridgedAt>0}get memberId(){return this.distribute.member_id}get queueId(){return this.distribute.queue_id}get hasReporting(){return this.distribute.has_reporting}get allowReporting(){return this.hasReporting&&this.bridgedAt>0}get agentChannelId(){return this.distribute.agent_channel_id}setState(e){this.state=e}setAnswered(e){this.answeredAt=e,this.lastStatusChange=Date.now(),this._autoAnswerTimerId&&(clearTimeout(this._autoAnswerTimerId),this._autoAnswerTimerId=null)}setOffering(e){this.offeringAt=e.timestamp,e.offering.auto_answer&&this.channel===ChannelType.Job&&(this._autoAnswerParam=e.offering.auto_answer,this.acceptDelay().catch(e=>{this.client.emit("error",e)}))}setBridged(e){this.bridgedAt=e.timestamp,this.lastStatusChange=Date.now(),e.form&&(this.form=e.form),this._autoAnswerTimerId&&(clearTimeout(this._autoAnswerTimerId),this._autoAnswerTimerId=null)}setProcessing(e,t){this.state=JobState.Processing,this.closedAt=e,this.startProcessingAt||(this.startProcessingAt=Date.now()),t.sec&&!t.timeout&&(t.timeout=Date.now()+1e3*t.sec),this._processing=t}setClosed(e){this.stopAt=e,this.state=JobState.Closed}setTransferred(e){this.distribute=e,this.history.push(e)}setMissed(){this.state=JobState.Missed}get processingTimeoutAt(){return this._processing&&this._processing.timeout?this._processing.timeout:null}get processingSec(){return this._processing&&this._processing.sec?this._processing.sec:null}get attempt(){return this}get variables(){const e={};for(const t in this.distribute.variables)t.startsWith("cc_")||(e[t]=this.distribute.variables[t]);return e}get isMember(){return!!this.memberId}get displayNumber(){return this.communication.destination}get displayName(){return this.distribute.member_name||null}get display(){return`${this.displayName} (${this.displayNumber})`}get renewalSec(){return this._processing&&this._processing.renewal_sec?this._processing.renewal_sec:null}get autoAnswer(){return this.autoAnswerDelay>0}get autoAnswerDelay(){return this._autoAnswerParam&&"false"!==`${this._autoAnswerParam}`?isFinite(+this._autoAnswerParam)?+this._autoAnswerParam:this.client.autoAnswerDelayTime:0}async accept(){return this.client.request("cc_agent_task_accept",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})}async acceptDelay(){this._autoAnswerTimerId=setTimeout(async()=>{this.autoAnswered||this.answeredAt||(this.autoAnswered=!0,await this.accept())},this.autoAnswerDelay)}async close(){return this.client.request("cc_agent_task_close",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})}async decline(){return this.client.request("cc_agent_task_close",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})}async reporting(e){const t=await this.client.request("cc_reporting",{attempt_id:this.id,...e});return this.reportedAt=Date.now(),t}async renew(e){return this.client.request("cc_renewal",{attempt_id:this.id,renewal_sec:e||this.processingSec})}async formAction(e,t){if(!this.form)throw new Error("not found active form");const r={};for(const[e,i]of Object.entries(t))r[e]="object"==typeof i?JSON.stringify(i):i;return this.client.request("cc_form_action",{attempt_id:this.id,app_id:this.distribute.app_id,action:e,fields:r})}}!function(e){e.Online="online",e.Offline="offline",e.Pause="pause",e.BreakOut="break_out"}(AgentStatus||(AgentStatus={})),function(e){e.Waiting="waiting",e.Distribute="distribute",e.Offering="offering",e.Answered="answered",e.Active="active",e.Bridged="bridged",e.Hold="hold",e.Missed="missed",e.WrapTime="wrap_time",e.Processing="processing",e.Transfer="transfer",e.Form="form"}(ChannelState||(ChannelState={})),function(e){e.Call="call",e.Email="email",e.Chat="chat",e.Job="task"}(ChannelType||(ChannelType={}));class Agent{constructor(e,t){this.client=e,this.info=t,this.task=new Map,this._channels=new Map,this.initChannels(t.channels),this._listOfflineMembers=null,this.waitingListChats=[],this.waitingListCalls=[],this.lastStatusChange=Date.now()-1e3*this.info.status_duration}get agentId(){return this.info.agent_id}get onDemand(){return this.info.on_demand}get status(){return this.info.status}get statusPayload(){return this.info.status_payload}get isAdmin(){return this.info.is_admin}get isSupervisor(){return this.info.is_supervisor}get team(){return this.info.team}get supervisor(){return this.info.supervisor}get auditor(){return this.info.auditor}get channels(){return Array.from(this._channels.values())}get channel(){return this._channels.get(ChannelType.Call)}get stateDuration(){return Math.round((Date.now()-this.lastStatusChange)/1e3)}setWaitingList(e){if(e){if(this.waitingListCalls.length=0,this.waitingListChats.length=0,this.status!==AgentStatus.Online)return;for(const t of e.calls||[])this.waitingListCalls.push({displayName:t.communication.name||"",displayNumber:t.communication.destination||"",attemptId:t.attempt_id,sessionId:t.session_id,deadline:t.deadline,queue:t.queue,wait:t.wait});for(const t of e.chats||[])this.waitingListChats.push({chat:t.communication.chat||"",displayName:t.communication.name||"",message:t.communication.msg||"",peer:t.communication.destination||"",attemptId:t.attempt_id,sessionId:t.session_id,deadline:t.deadline,queue:t.queue,wait:t.wait})}}deleteWaitingAttempt(e){if(e){const t=e.attempt_id;removeWaitingList(this.waitingListCalls,t)||removeWaitingList(this.waitingListChats,t)}}async interceptAttempt(e){return this.client.request("cc_intercept_attempt",{attempt_id:e,agent_id:this.agentId})}onChannelEvent(e){let t;switch(e.status){case ChannelState.Distribute:const r=e;if(!r)throw new Error("bad event");if(t=new Task(this.client,e,r.distribute),this.task.set(t.id,t),t.agentChannelId)switch(t.channel){case ChannelType.Call:const e=this.client.callById(t.agentChannelId);e&&!e.task&&(e.task=t);break;case ChannelType.Chat:const r=this.client.conversationById(t.agentChannelId);r&&!r.task&&(r.task=t)}break;case ChannelState.Offering:const i=e;(t=this.task.get(e.attempt_id))&&t.setOffering(i);break;case ChannelState.Bridged:const a=e;(t=this.task.get(a.attempt_id))&&t.setBridged(a);break;case ChannelState.Transfer:const n=e;(t=this.task.get(n.to_attempt_id))&&(this.task.delete(t.id),t.id=n.attempt_id,t.setTransferred(n.distribute),this.task.set(t.id,t));break;case ChannelState.Answered:(t=this.task.get(e.attempt_id))&&(t.answeredAt=e.timestamp);break;case ChannelState.Form:const s=e;return void((t=this.task.get(e.attempt_id))&&(t.form=s.form||null));case ChannelState.Missed:if(e.attempt_id&&(t=this.task.get(e.attempt_id))){t.stopAt=e.timestamp;const r=e;if(!r)throw new Error("bad event");return t.setMissed(),this.setChannelStateTimeout(e,r.missed.timeout),this.task.delete(e.attempt_id),this.client.reportingChannelTask(t),t}break;case ChannelState.WrapTime:if(e.attempt_id){if(!e)throw new Error("bad event");t=this.task.get(e.attempt_id),this.task.delete(e.attempt_id),this.client.reportingChannelTask(t)}break;case ChannelState.Processing:if(e.attempt_id){const r=e;if(!r)throw new Error("bad event");if(t=this.task.get(e.attempt_id))return t.setProcessing(e.timestamp,r.processing),this.setChannelStateTimeout(e,r.processing.timeout||0),t}break;case ChannelState.Waiting:e.attempt_id&&(t=this.task.get(e.attempt_id))&&(t.setClosed(e.timestamp),this.task.delete(e.attempt_id),this.client.reportingChannelTask(t))}return this.setChannelState(e),t?(t.setState(e.status),t):void 0}async online(e,t){return this.client.agentSetOnline(this.agentId,e,t)}async waiting(e){return this.client.agentSetWaiting(this.agentId,e)}async pause(e){try{return await this.client.agentSetPause(this.agentId,e)}catch(e){return e.id===TypeErrors.PauseNotAllow?new PauseNotAllowedError(e.detail):e}}async offline(){return this.client.agentSetOffline(this.agentId)}setStatus(e){e.status===AgentStatus.Online?(this.info.on_demand=e.on_demand||!1,this.initChannels(e.channels)):(this.waitingListCalls.length=0,this.waitingListChats.length=0),this.info.status=e.status,this.info.status_payload=e.status_payload?e.status_payload:null,this.lastStatusChange=Date.now()}async directMember(e,t){return this.client.request("cc_member_direct",{agent_id:this.agentId,member_id:e,communication_id:t})}async offlineMembers(e,t,r){return this._listOfflineMembers=await this.client.request("cc_fetch_offline_members",{agent_id:this.agentId,page:t,q:e,per_page:r}),this._listOfflineMembers}hasTask(e){return this.task.has(e.id)}initChannels(e){for(const t of e)this._channels.set(t.channel,t)}getChannel(e){return this._channels.get(e)}setChannelState(e){const t=this.getChannel(e.channel);t&&(t.state=e.status,t.joined_at=e.timestamp,t.timeout=void 0)}setChannelStateTimeout(e,t){const r=this.getChannel(e.channel);r&&(r.state=e.status,r.timeout=t,r.joined_at=e.timestamp)}}function removeWaitingList(e,t){for(let r=0;r<e.length;r++)if(e[r].attemptId===t)return e.splice(r,1),!0;return!1}!function(e){e.Abandoned="abandoned",e.Cancel="cancel",e.Success="success",e.Failed="failed",e.Missed="missed",e.Timeout="timeout",e.Endless="endless",e.Transferred="transferred"}(CallReportingStatus||(CallReportingStatus={})),function(e){e.Muted="muted",e.Conference="conference",e.Prompt="prompt"}(EavesdropState||(EavesdropState={})),function(e){e.Joined="joined",e.Leave="leave",e.Hide="hide"}(EavesdropType||(EavesdropType={})),function(e){e.Ringing="ringing",e.Active="active",e.Bridge="bridge",e.Hold="hold",e.DTMF="dtmf",e.Voice="voice",e.Silence="silence",e.Execute="execute",e.Update="update",e.Hangup="hangup",e.Reporting="reporting",e.PeerStream="peerStream",e.LocalStream="localStream",e.Destroy="destroy",e.Eavesdrop="eavesdrop"}(CallActions||(CallActions={})),function(e){e.Inbound="inbound",e.Outbound="outbound"}(CallDirection||(CallDirection={}));class Call{constructor(e,t){this.client=e;const r=t.data;this._muted=!1,this.voice=!0,this.createdAt=+t.timestamp,this.task=null,this.data=null,this._eavesdrop=null,this._autoAnswerTimerId=null,this._activeCounter=0,this.answeredAt=0,this.hangupAt=0,this.bridgedAt=0,this.reportingAt=0,this.autoAnswered=!1,this.peerStreams=[],this.localStreams=[],r.eavesdrop&&(this._eavesdrop=r.eavesdrop),e.phone&&(r.sip_id?this.setSip(e.phone.sipSessionBySipId(r.sip_id)):this.setSip(e.phone.sipSessionByCallId(t.id))),this.params={},this.id=t.id,this.digits=[],this.applications=[],this.appId=t.app_id,this.setState(t),this.setInfo(r),this.queue&&this.client.agent&&(this.task=this.client.agent.task.get(+this.queue.attempt_id)||null)}setState(e){this.state=e.event}setSip(e){e&&!this.sip&&(this.sip=e,this.localStreams=e.getLocalMedia(),this.peerStreams=e.getPeerMedia())}get duration(){return 0===this.hangupAt?Math.round((Date.now()-this.createdAt)/1e3):Math.round((this.hangupAt-this.createdAt)/1e3)}get allowDtmf(){return this.answeredAt>0&&this.allowHangup}get allowHangup(){return 0===this.hangupAt}get allowHold(){return 0===this.hangupAt&&("active"===this.state||"bridge"===this.state)}get allowAnswer(){return this.client.phone&&0===this.hangupAt&&0===this.answeredAt&&(this.queue||this.direction===CallDirection.Inbound||this.params&&!this.params.autoAnswer)}get allowUnHold(){return 0===this.hangupAt&&"hold"===this.state}get memberCommunication(){return this.task?this.task.communication:null}get isEavesdrop(){return!!this._eavesdrop}get eavesdropName(){return this.isEavesdrop?this._eavesdrop.name:""}get eavesdropNumber(){return this.isEavesdrop?this._eavesdrop.number:""}get eavesdropDuration(){return this.isEavesdrop?this._eavesdrop.duration:0}get eavesdropState(){return this.isEavesdrop?this._eavesdrop.state:null}get eavesdropIsMuted(){return this.eavesdropState===EavesdropState.Muted}get eavesdropIsConference(){return this.eavesdropState===EavesdropState.Conference}get eavesdropIsPrompt(){return this.eavesdropState===EavesdropState.Prompt}async getMember(e){if(!this.isMember)throw new Error("call is not from outbound queue");return this.client.request("cc_member_page",{queue_id:this.task.queueId,member_id:this.task.memberId})}get isMember(){return!(!this.task||!this.task.isMember)}get firstActive(){return 1===this._activeCounter}setActive(e){this._activeCounter++,this._autoAnswerTimerId&&(clearTimeout(this._autoAnswerTimerId),this._autoAnswerTimerId=null),this.answeredAt||(this.direction===CallDirection.Inbound&&(this.bridgedAt=+e.timestamp,this.parentId&&(this.bridgedId=this.parentId)),this.answeredAt=+e.timestamp),this.setState(e)}setBridged(e){const t=e.data;this.bridgedAt||(this.bridgedAt=+e.timestamp),this.bridgedId=t.bridged_id,t.to&&(this.direction===CallDirection.Inbound?this.from=t.to:this.to=t.to),this.bridgedId=t.bridged_id,t.payload&&(this.variables=t.payload),t.queue&&(this.queue=t.queue)}setHold(e){this.setState(e)}setInfo(e){this.parentId=e.parent_id,this.destination=e.destination,this.direction=e.direction,this.from=e.from,this.to=e.to,this.variables=e.payload,this.queue=e.queue||null,this.sipId=e.sip_id||null,this.params=e.params}setPeerStreams(e){this.peerStreams=e||[]}setLocalStreams(e){this.localStreams=e||[]}setVoice(){this.voice=!0}setSilence(){this.voice=!1}setExecute(e){this.applications.push(e.application)}addDigit(e){this.digits.push(e.digit)}setEavesdropState(e){e.type===EavesdropType.Joined?this._eavesdrop=e:e.type===EavesdropType.Leave?this._eavesdrop=null:this._eavesdrop.state=e.state}setHangup(e){const t=e.data;this.hangupAt=+e.timestamp,this.hangupCause=t.cause,this.hangupSipCode=t.sip,this.voice=!1,this.peerStreams=[],+t.reporting_at&&(this.reportingAt=+t.reporting_at),this.setState(e)}get allowReporting(){return this.answeredAt>0&&this.hasReporting}get hasReporting(){return!!this.task&&this.task.hasReporting}get display(){return`${this.displayNumber} (${this.displayName})`}get muted(){return this._muted}get isHold(){return this.state===CallActions.Hold}get allowInboundVideo(){return this.params&&this.params.video||!1}get allowOutboundVideo(){return this.params&&this.params.video||!1}get active(){return 0===this.hangupAt}get displayNumber(){return"inbound"===this.direction?this.from.number:this.to?this.to.number:this.destination}get displayName(){return"inbound"===this.direction?this.from.name:this.to?this.to.name:this.destination}get autoAnswer(){return this.queue&&"offline"===this.queue.queue_type||this.autoAnswerDelay>0}get autoAnswerDelay(){return this.params&&this.params.autoAnswer&&"false"!==`${this.params.autoAnswer}`?isFinite(+this.params.autoAnswer)?+this.params.autoAnswer:this.client.autoAnswerDelayTime:0}get attempt(){return this.task}async answer(e){if(this.sip&&this.client.phone){try{const t=await this.client.phone.callOption(e);await this.sip.answer(t)}catch(e){this.client.handleError(e)}return!0}return!1}answerDelay(e){this.autoAnswered||(this._autoAnswerTimerId&&clearTimeout(this._autoAnswerTimerId),this._autoAnswerTimerId=setTimeout(async()=>{this.autoAnswered||(this.autoAnswered=!0,await this.answer(e))},this.autoAnswerDelay))}async hangup(e){let t=e;return 0!==this.answeredAt||e||(t=this.direction===CallDirection.Inbound?"USER_BUSY":"ORIGINATOR_CANCEL"),this.client.request("call_hangup",{id:this.id,app_id:this.appId,cause:t})}async eavesdrop(e){return e.id=this.id,this.client.request("call_eavesdrop",e)}async changeEavesdropState(e){if(!this.isEavesdrop)throw new Error("this call not in eavesdrop");if(this.eavesdropState===e)throw new Error(`this call already eavesdrop state: ${e}`);return this.client.request("call_eavesdrop_state",{id:this.id,state:e})}async toggleHold(){return this.state===CallActions.Hold?this.unHold():this.hold()}async hold(){if(this.state===CallActions.Hold)throw new Error("Call is hold");return this.client.request("call_hold",{id:this.id,app_id:this.appId})}async unHold(){if(this.state!==CallActions.Hold)throw new Error("Call is active");return this.client.request("call_unhold",{id:this.id,app_id:this.appId})}async sendDTMF(e){return this.client.request("call_dtmf",{id:this.id,app_id:this.appId,dtmf:e})}async blindTransfer(e,t){return t?this.client.request("call_blind_transfer_ext",{id:this.id,app_id:this.appId,destination:e,variables:t}):this.client.request("call_blind_transfer",{id:this.id,app_id:this.appId,destination:e})}async mute(e=!1){const t=await this.client.request("call_mute",{id:this.id,app_id:this.appId,mute:e});return this._muted=e,t}async bridgeTo(e,t){return this.client.request("call_bridge",{from_id:this.id,from_app_id:this.appId,to_id:e.id,to_app_id:e.appId,variables:t})}async reporting(e){if(!this.task)throw new Error("this call not in queue");return this.task.reporting(e)}async renew(e){if(!this.task)throw new Error("this conversation not in queue");return this.task.renew(e)}async callToUser(e){return e.nodeId=this.appId,e.parentCallId=this.id||null,e.sendToCallId=this.parentId||null,this.client.inviteToUser(e)}}function formatWebSocketUri(e){return e.replace(/^http/,"ws")}function formatBaseUri(e){let t=e.replace(/^ws/,"http");return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/ws")&&(t=t.slice(0,-3)),t}function chunkString(e,t){const r=Math.ceil(e.length/t),i=new Array(r);let a=0;for(let n=0;n<r;n++)i[n]=e.substring(a,a+t),a+=t;return i}const maxSizeMessage=4096;var DeclineCause,ChatActions,ConversationState,NotificationActions;!function(e){e.Timeout="TIMEOUT",e.Busy="BUSY",e.Cancel="CANCEL",e.Transfer="TRANSFER"}(DeclineCause||(DeclineCause={})),function(e){e.Message="message",e.UserInvite="user_invite",e.Invite="invite_conversation",e.Joined="join_conversation",e.Close="close_conversation",e.Leave="leave_conversation",e.Decline="decline_invite",e.Update="update_channel",e.Destroy="destroy",e.MessageDeleted="message_deleted"}(ChatActions||(ChatActions={})),function(e){e.Init="init",e.Invite="invite",e.Active="active",e.Pending="pending",e.Closed="closed"}(ConversationState||(ConversationState={}));class Conversation{constructor(e,t,r,i,a,n){this.client=e,this.conversationId=t,this.title=r,this.channelId=null,this.createdAt=Date.now(),this.answeredAt=0,this.updatedAt=0,this.invitedAt=0,this.closedAt=0,this.task=null,this.data=null,this.queue=null,this.members=(i||[]).map(e=>wrapChannelMember(e)),this._messages=a||[],this.state=ConversationState.Invite,this.variables={},this._hasReporting=!(!n||"true"!==n.cc_reporting),this.autoAnswered=!1,this._autoAnswerParam=!1,this._autoAnswerTimerId=null,this._cause=null,this.lastAction=null;for(const e in n)!e.startsWith("cc_")&&n.hasOwnProperty(e)&&("wbt_auto_answer"===e?this._autoAnswerParam=n.wbt_auto_answer:this.variables[e]=n[e]);n&&n.hasOwnProperty("cc_attempt_id")&&this.client.agent&&(this.queue={id:+n.cc_queue_id||null,name:n.cc_queue_name||""},this.task=this.client.agent.task.get(+n.cc_attempt_id)||null)}setInvite(e,t){this.inviteId=e,this.invitedAt=t,this.autoAnswer&&this.joinDelay().catch(e=>{this.client.emit("error",e)})}get autoAnswer(){return this.autoAnswerDelay>0}get autoAnswerDelay(){return this._autoAnswerParam&&"false"!==`${this._autoAnswerParam}`?isFinite(+this._autoAnswerParam)?+this._autoAnswerParam:this.client.autoAnswerDelayTime:0}setAnswered(e,t,r){this.state=ConversationState.Active,this.answeredAt=t,this.channelId=e,this._autoAnswerTimerId&&(clearTimeout(this._autoAnswerTimerId),this._autoAnswerTimerId=null),this.member=wrapChannelMember(r),this.inviteId=null}setClosed(e){this.state=ConversationState.Closed,this.closedAt=e}setDecline(e){this.setClosed(e.timestamp),this._cause=e.cause||null}setLeave(e){e.cause&&(this._cause=e.cause),this.setClosed(e.timestamp)}setDeletedMessage(e){const t=this._messages;for(let r=0;r<t.length;r++)t[r].id===e.id&&(e.created_at=t[r].created_at,t.splice(r,1,e))}get id(){return this.channelId||this.inviteId||this.conversationId}get cause(){return this._cause}get messages(){return this.getMessages()}getMessages(){return this._messages.map(e=>{const t={id:e.id,type:e.type,member:this.messageMember(e),channelId:e.channel_id,createdAt:e.created_at,updatedAt:e.updated_at,contact:null};return e.hasOwnProperty("file")&&(e.file&&e.file.id>0&&(e.file.url=this.client.fileUrlDownload(e.file.id,e.file.mime),e.file.streamUrl=this.client.fileUrlStream(e.file.id,e.file.mime)),t.file=e.file),e.hasOwnProperty("text")&&(t.text=e.text),e.hasOwnProperty("contact")&&(t.contact=e.contact),t})}async next(){throw new Error("TODO")}async pagination(e,t){throw new Error("TODO")}newMessage(e){this._messages.push(e)}get allowDecline(){return!!this.inviteId}get allowJoin(){return!!this.inviteId}get allowLeave(){return!(!this.channelId||0!==this.closedAt&&this.hasReporting)}get allowReporting(){return this.answeredAt>0&&this.hasReporting}get hasReporting(){return this._hasReporting}get membersId(){const e=[this.id];for(const t of this.members)e.push(t.id);return e}get attempt(){return this.task}get isTransferred(){return(this._cause&&this._cause.toUpperCase())===DeclineCause.Transfer}async decline(e){if(!this.inviteId)throw new Error("This conversation is joined");let t=e;return e||0!==this.answeredAt||(t=DeclineCause.Busy),this.client.request("decline_chat",{invite_id:this.inviteId,cause:t})}async joinDelay(){this.autoAnswered||(this.autoAnswered=!0,this._autoAnswerTimerId=setTimeout(async()=>{this.answeredAt||await this.join()},this.autoAnswerDelay))}async join(){if(!this.inviteId)throw new Error("This conversation is joined");return this.client.request("join_chat",{invite_id:this.inviteId})}async close(e){if(!this.channelId)throw new Error("This conversation not active");return this.client.request("close_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:e})}async leave(e){if(!this.channelId)throw new Error("This conversation not active");return 0===this.closedAt||this.hasReporting||this.cause===DeclineCause.Busy?this.client.request("leave_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:e}):this.client.destroyConversation(this)}async sendText(e){if(!this.channelId)throw new Error("conversation not active");if(!e.length)throw new Error("empty message");const t=chunkString(e,maxSizeMessage);for(let e=0;e<t.length;e++){if(e+1>=t.length)return this.sendMessageTextChunk(t[e]);await this.sendMessageTextChunk(t[e])}}async sendFile(e,t){const r=(await this.client.storeFile(this.conversationId,[e],t))[0];return this.client.request("send_file_chat",{channel_id:this.channelId,conversation_id:this.conversationId,id:r.id,name:e.name,mime:r.mime,url:r.shared,size:r.size})}async send(e,t){if("string"==typeof e)return this.sendText(e);if(e instanceof File)return this.sendFile(e,t);throw new Error("unknown send data")}async addToChat(e,t){return this.client.request("add_to_chat",{channel_id:this.channelId,conversation_id:this.conversationId,user_id:e,title:t})}async startChat(e){return this.client.request("start_chat",{user_id:e})}async updateChannel(){return this.client.request("update_channel_chat",{channel_id:this.channelId})}async reporting(e){if(!this.task)throw new Error("this conversation not in queue");return this.task.reporting(e)}async renew(e){if(!this.task)throw new Error("this conversation not in queue");return this.task.renew(e)}async transferToPlan(e){return this.client.request("blind_transfer_chat",{conversation_id:this.conversationId,channel_id:this.channelId,plan_id:e})}async transferToUser(e){return this.client.request("transfer_user_chat",{conversation_id:this.conversationId,channel_id:this.channelId,user_id:e})}sendMessageTextChunk(e){return this.client.request("send_text_chat",{channel_id:this.channelId,conversation_id:this.conversationId,text:e})}messageMember(e){if(this.member&&e.channel_id===this.channelId)return{self:!0};for(const t of this.members)if(t.id===e.channel_id)return t;return null}}function wrapChannelMember(e){return e.messenger=e.type,e}!function(e){e.HideMember="hide_member",e.HideAttempt="hide_attempt",e.WaitingList="waiting_list"}(NotificationActions||(NotificationActions={}));const SOCKET_URL_SUFFIX="websocket",spamData="\0\0\0\0";class Socket extends EventEmitter{constructor(e){super(),this.host=e}connect(e){this.socket=new WebSocket(`${formatWebSocketUri(this.host)}/${SOCKET_URL_SUFFIX}`),this.socket.onclose=(e=>this.onClose(e.code)),this.socket.onmessage=(e=>this.onMessage(e.data)),this.socket.onopen=(()=>this.onOpen())}send(e){return this.socket.send(JSON.stringify(e)),null}close(e){this.socket.close(e||1e3),delete this.socket,this.onClose(e||1e3)}onOpen(){this.emit("open")}onClose(e){this.emit("close",e),this.off("*")}onMessage(e){if(e!==spamData){const t=JSON.parse(e);this.emit("message",t)}}}const API_HEADER_TOKEN="X-Webitel-Access",WEBSOCKET_AUTHENTICATION_CHALLENGE="authentication_challenge",WEBSOCKET_DEFAULT_DEVICE_CONFIG="user_default_device",WEBSOCKET_AGENT_SESSION="cc_agent_session",WEBSOCKET_PING="ping",WEBSOCKET_MAKE_OUTBOUND_CALL="call_invite",WEBSOCKET_MAKE_USER_CALL="call_user",WEBSOCKET_EVENT_HELLO="hello",WEBSOCKET_EVENT_CALL="call",WEBSOCKET_EVENT_CHAT="chat",WEBSOCKET_EVENT_USER_STATE="user_state",WEBSOCKET_EVENT_AGENT_STATUS="agent_status",WEBSOCKET_EVENT_CHANNEL_STATUS="channel",WEBSOCKET_EVENT_ERROR="error",WEBSOCKET_EVENT_NOTIFICATION="notification",TASK_EVENT="task",JOB_EVENT="job",WEBSOCKET_EVENT_SIP="sip";var HandleError,Response;!function(e){e.NotFoundError="NotFoundError",e.NotAllowedError="NotAllowedError"}(HandleError||(HandleError={})),function(e){e.STATUS_FAIL="FAIL",e.STATUS_OK="OK"}(Response||(Response={}));class Client extends EventEmitter{constructor(e){super(),this._config=e,this.reqSeq=0,this.queueRequest=new Map,this.log=new Log,this.eventHandler=new EventEmitter,this.callStore=new Map,this.conversationStore=new Map,this.pingTimer=null,this.basePath=`${formatBaseUri(e.storageEndpoint||e.endpoint)}`,this.lastError=null}async connect(){await this.connectToSocket()}async disconnect(){this.socket.close()}async subscribeCall(e,t){const r=await this.request("subscribe_call",t);if(this.eventHandler.on(WEBSOCKET_EVENT_CALL,e),r.items&&r.items.length)for(const e of r.items){if(e.hangup_at&&e.hangup_at>0&&!e.task)continue;const t={cc_app_id:"",app_id:e.app_id,event:e.state,id:e.id,timestamp:Date.now(),data:{app_id:e.app_id,event:e.state,id:e.id,timestamp:Date.now(),cc_app_id:"",sip_id:"",parent_id:e.parent_id,direction:e.direction,destination:e.destination,queue:e.queue,from:e.from,to:e.to,payload:e.variables}},r=new Call(this,t);if(r.createdAt=e.created_at,r.answeredAt=e.answered_at||0,r.bridgedAt=e.bridged_at||0,r.hangupAt=e.hangup_at||0,e.task){let t=this.getTask(e.task.attempt_id);t||((t=new Task(this,{attempt_id:e.task.attempt_id,channel:e.task.channel,status:e.task.status,timestamp:Date.now()},e.task)).form=e.task.form||null,e.leaving_at&&e.task.processing_sec&&(t.startProcessingAt=e.leaving_at,t.setProcessing(e.leaving_at,{sec:e.task.processing_sec||0,timeout:e.task.processing_timeout_at||null,renewal_sec:e.task.processing_renewal_sec||0}))),r.task=t,r.queue.reporting="true"}this.callStore.set(r.id,r)}return r}async subscribeChat(e,t){const r=await this.request("subscribe_chat",t);if(this.eventHandler.on(WEBSOCKET_EVENT_CHAT,e),r&&r.items)for(const e of r.items){const t=e.messages.reverse(),r=new Conversation(this,e.id,e.title,e.members,t,e.variables);if(r.createdAt=e.created_at,r.closedAt=e.closed_at,e.task){let t=this.getTask(e.task.attempt_id);t||(t=new Task(this,{attempt_id:e.task.attempt_id,channel:e.task.channel,status:e.task.status,timestamp:Date.now()},e.task),e.leaving_at&&e.task.processing_sec&&(t.startProcessingAt=e.leaving_at,t.setProcessing(e.leaving_at,{sec:e.task.processing_sec||0,timeout:e.task.processing_timeout_at||null,renewal_sec:e.task.processing_renewal_sec||0})),t.form=e.task.form||null),r.task=t}if(e.invite_id)r.setInvite(e.invite_id,e.created_at);else{if(!e.channel_id){this.log.error(`conversation ${e.id} not valid`);continue}r.setAnswered(e.channel_id,e.joined_at,{id:e.channel_id,name:"TODO",type:"webitel"})}this.conversationStore.set(r.id,r)}return r}async subscribeUsersStatus(e,t){const r=await this.request("subscribe_users_status",t);return this.eventHandler.on(WEBSOCKET_EVENT_USER_STATE,e),r}async subscribeAgentsStatus(e,t){const r=await this.request("cc_agent_subscribe_status",t);return this.eventHandler.on(WEBSOCKET_EVENT_AGENT_STATUS,e),r}getTask(e){if(this.agent)return this.agent.task.get(e)}subscribeTask(e){this.eventHandler.on(TASK_EVENT,e)}subscribeJob(e){this.eventHandler.on(JOB_EVENT,e)}async unSubscribe(e,t,r){return this.request(`un_subscribe_${e}`,r)}async destroy(){await this.disconnect(),this.phone&&(await this.phone.unregister(),this.phone.off("*"),delete this.phone),this.eventHandler.off("*")}allCall(){return Array.from(this.callStore.values())}allConversations(){return Array.from(this.conversationStore.values())}allTask(){return this.agent?Array.from(this.agent.task.values()):[]}allJob(){return this.allTask().filter(isJobTask)}callById(e){if(this.callStore.has(e))return this.callStore.get(e)}conversationById(e){if(this.conversationStore.has(e))return this.conversationStore.get(e)}callBySipId(e){for(const t of this.allCall())if(t.sipId&&e.startsWith(t.sipId))return t}async reportingTask(e,t){return this.request("cc_reporting",{attempt_id:e,...t})}async agentActiveTasks(e){return this.request("cc_agent_tasks",{agent_id:e})}async auth(){try{return await this.request(WEBSOCKET_AUTHENTICATION_CHALLENGE,{token:this._config.token})}catch(e){throw this.handleError(e),await this.disconnect(),e}}async ping(){return this.request(WEBSOCKET_PING,{ping:1})}sessionInfo(){return this.connectionInfo.session}get version(){return this.connectionInfo.server_version}get buildVersion(){return version$1}get instanceId(){return this.connectionInfo.sock_id}get autoAnswerDelayTime(){return this._config.autoAnswerDelayTime||400}async agentSession(){if(this.agent)return this.agent;const e=await this.request(WEBSOCKET_AGENT_SESSION);this.agent=new Agent(this,e);const t=await this.agentActiveTasks(this.agent.agentId);for(const e of t.items){const t=new Task(this,{status:e.status,timestamp:Date.now(),channel:e.channel,attempt_id:e.attempt_id},e);t.postProcessData={},t.setState(e.state),e.bridged_at&&(t.bridgedAt=e.bridged_at,t.answeredAt=e.bridged_at),e.leaving_at&&(t.closedAt=e.leaving_at),e.leaving_at&&e.processing_sec&&(t.startProcessingAt=e.leaving_at,t.setProcessing(e.leaving_at,{sec:e.processing_sec||0,timeout:e.processing_timeout_at||null,renewal_sec:e.processing_renewal_sec||0})),t.form=e.form||null,this.agent.task.set(t.id,t)}for(const e of this.allCall())e.task&&this.agent.task.set(e.task.id,e.task);for(const e of this.allConversations())e.task&&this.agent.task.set(e.task.id,e.task);return this.agent}async invite(e){return this.request(WEBSOCKET_MAKE_OUTBOUND_CALL,e)}async call(e){if(this.phone)try{await this.phone.call(e)}catch(e){this.handleError(e)}else await this.invite(e)}async callRecordId(e){return this.request("call_recordings",{id:e})}async eavesdrop(e){return this.request("call_eavesdrop",e)}async agentSetOnline(e,t,r){return this.request("cc_agent_online",{agent_id:e,channels:t,on_demand:r})}async agentSetWaiting(e,t){return this.request("cc_agent_waiting",{agent_id:e,channel:t})}async agentSetPause(e,t){return this.request("cc_agent_pause",{agent_id:e,payload:t})}async agentSetOffline(e){return this.request("cc_agent_offline",{agent_id:e})}inviteToUser(e){return this.request(WEBSOCKET_MAKE_USER_CALL,e)}async answer(e,t){const r=this.callById(e);if(r)return r.answer(t)}request(e,t){return new Promise((r,i)=>{this.queueRequest.set(++this.reqSeq,{resolve:r,reject:i}),this.socket.send({seq:this.reqSeq,action:e,data:t})})}useWebPhone(){return this._config.registerWebDevice||!1}callDestroyed(e){return e.hangupAt>0&&!this.hasAgentTask(e.task)}conversationDestroyed(e){return e.closedAt>0&&(!this.hasAgentTask(e.task)||!e.hasReporting)&&(e.hasReporting||!(e.lastAction===ChatActions.Close&&e.answeredAt>0))}reportingChannelTask(e){switch(e.channel){case ChannelName.Call:for(const e of this.allCall())if(this.callDestroyed(e))return void this.destroyCall(e);break;case ChannelName.Chat:if(e.agentChannelId){const t=this.conversationById(e.agentChannelId);if(t&&this.conversationDestroyed(t))return void this.destroyConversation(t)}}}async registerCallClient(e){this.phone=e,this.subscribePhone(e);try{const e=await this.deviceConfig(this.phone.type);await this.phone.register(e)}catch(e){this.log.error(e)}}subscribePhone(e){e.on("peerStreams",(e,t)=>{const r=this.callBySession(e);r&&!r.peerStreams.length&&(r.setPeerStreams(t),this.eventHandler.emit(WEBSOCKET_EVENT_CALL,CallActions.PeerStream,r))}),e.on("localStreams",(e,t)=>{const r=this.callBySession(e);r&&!r.localStreams.length&&(r.setLocalStreams(t),this.eventHandler.emit(WEBSOCKET_EVENT_CALL,CallActions.LocalStream,r))}),e.on("newSession",this.onNewCallSession.bind(this)),e.on("registered",()=>this.emit("phone_registered",!0)),e.on("unregistered",()=>this.emit("phone_registered",!1))}phoneIsRegister(){return!(!this.phone||!this.phone.isRegistered)&&this.phone.isRegistered()}async deviceConfig(e){return this.request(WEBSOCKET_DEFAULT_DEVICE_CONFIG,{name:e})}async storeFile(e,t,r){if(!t||t.length<1)throw new Error("no files");const i=new FormData;for(const e of t)i.append(e.name,e);const a=(await globalAxios.post(`${this.basePath}/api/storage/file/${e}/upload`,i,{headers:{[API_HEADER_TOKEN]:this._config.token},onUploadProgress:r})).data;for(const e of a)e.shared=this.basePath+e.shared;return a}fileUrlDownload(e,t){const r=this.fileUrlParams(t);return`${this.basePath}/api/storage/file/${e}/download?${r.join("&")}`}fileUrlStream(e,t){const r=this.fileUrlParams(t);return`${this.basePath}/api/storage/file/${e}/stream?${r.join("&")}`}handleError(e){if(e)switch(e.name){case HandleError.NotFoundError:this.emit("error",new DeviceNotFoundError(e.message));break;case HandleError.NotAllowedError:this.emit("error",new DeviceNotAllowPermissionError(e.message));break;default:this.emit("error",e)}}destroyConversation(e){this.conversationStore.delete(e.id),this.eventHandler.emit(WEBSOCKET_EVENT_CHAT,ChatActions.Destroy,e)}async onMessage(e){if(this.log.debug("receive message: ",e),e.seq_reply>0){if(this.queueRequest.has(e.seq_reply)){const t=this.queueRequest.get(e.seq_reply);if(this.queueRequest.delete(e.seq_reply),e.status===Response.STATUS_OK)t.resolve(e.data);else{const r=e.error;r&&r.id===TypeErrors.RolePermission?t.reject(new RolePermissionError(r.detail)):r&&r.id===TypeErrors.LicencePermission?t.reject(new LicencePermissionError(r.detail)):t.reject(e.error)}}}else switch(e.event){case WEBSOCKET_EVENT_HELLO:await this.connected(e.data),this.log.debug(`opened session ${this.connectionInfo.sock_id} for userId=${this.connectionInfo.session.user_id}`);break;case WEBSOCKET_EVENT_CALL:await this.handleCallEvents(e.data.call);break;case WEBSOCKET_EVENT_CHAT:await this.handleChatEvents(e.data);break;case WEBSOCKET_EVENT_USER_STATE:this.handleUserStateEvent(e.data.state);break;case WEBSOCKET_EVENT_SIP:this.eventHandler.emit(WEBSOCKET_EVENT_SIP,e.data);break;case WEBSOCKET_EVENT_AGENT_STATUS:this.handleAgentStatus(e.data);break;case WEBSOCKET_EVENT_CHANNEL_STATUS:this.handleChannelEvents(e.data);break;case WEBSOCKET_EVENT_ERROR:this.lastError=e.data.error;break;case WEBSOCKET_EVENT_NOTIFICATION:this.handleNotification(e.data.notification);break;default:this.log.error(`event ${e.event} not handler`)}}handleNotification(e){switch(e.action){case NotificationActions.HideMember:if(this.agent&&this.agent._listOfflineMembers){const t=this.agent._listOfflineMembers;if(t.items)for(let r=0;r<t.items.length;r++)if(t.items[r].id===e.body.member_id){t.items.splice(r,1);break}}break;case NotificationActions.WaitingList:this.agent&&this.agent.setWaitingList(e.body);break;case NotificationActions.HideAttempt:this.agent&&this.agent.deleteWaitingAttempt(e.body);break;default:this.log.error(`notification "${e.action}" not handled`)}}handleAgentStatus(e){this.agent&&e.agent_id===this.agent.agentId&&this.agent.setStatus(e),this.eventHandler.emit(WEBSOCKET_EVENT_AGENT_STATUS,e,this.agent)}handleChannelEvents(e){if(this.agent){e.timestamp=Date.now();const t=this.agent.onChannelEvent(e)||void 0;this.eventHandler.emit(TASK_EVENT,e.status,t),t&&isJobTask(t)&&(this.eventHandler.emit(JOB_EVENT,t.state,t),isDestroyJob(t.state)&&this.eventHandler.emit(JOB_EVENT,JobState.Destroy,t))}}async pingServer(){if(this.pingTimer&&this.connectionInfo.ping_interval){const e=setTimeout(async()=>{this.log.error("close socket without pong"),this.socket.close(3005)},2e3);await this.ping(),clearTimeout(e)}this.connectionInfo.ping_interval&&(this.pingTimer=setTimeout(this.pingServer.bind(this),+this.connectionInfo.ping_interval))}async connected(e){if(this.connectionInfo=e,e.ping_interval&&await this.pingServer(),this.useWebPhone())return this.registerCallClient(new SipPhone(this.instanceId,this._config.debug))}callBySession(e){for(const t of this.allCall())if(t.sip&&t.sip.id===e.id)return t}async onNewCallSession(e){let t;(t=e.callId?this.callById(e.callId):this.callBySipId(e.id))&&(t.setSip(e),this.checkAutoAnswer(t))}checkAutoAnswer(e){e.autoAnswer&&e.answerDelay({video:e.params.video,screen:e.params.screen,disableStun:e.params.disableStun})}connectToSocket(){return new Promise((e,t)=>{try{this.socket=new Socket(this._config.endpoint),this.socket.connect(this._config.token)}catch(e){return void t(e)}this.socket.on("message",this.onMessage.bind(this)),this.socket.on("close",e=>{this.pingTimer&&clearTimeout(this.pingTimer),this.log.error("socket close code: ",e),1e3!==e&&(this.emit("disconnected",e,this.lastError),t(new Error(`close socket code: ${e}`))),this.eventHandler.off("*")}),this.socket.on("open",()=>{e(null),this.emit("connected")})})}handleUserStateEvent(e){this.eventHandler.emit(WEBSOCKET_EVENT_USER_STATE,e)}async handleCallEvents(e){let t;switch(e.timestamp=Date.now(),e.event){case CallActions.Ringing:t=new Call(this,e),this.callStore.set(t.id,t),this.checkAutoAnswer(t);break;case CallActions.Active:(t=this.callById(e.id))&&t.setActive(e);break;case CallActions.Bridge:(t=this.callById(e.id))&&t.setBridged(e);break;case CallActions.Execute:(t=this.callById(e.id))&&t.setExecute(e.data);break;case CallActions.DTMF:(t=this.callById(e.id))&&t.addDigit(e.data);break;case CallActions.Eavesdrop:(t=this.callById(e.id))&&t.setEavesdropState(e.data);break;case CallActions.Voice:(t=this.callById(e.id))&&t.setVoice();break;case CallActions.Silence:(t=this.callById(e.id))&&t.setSilence();break;case CallActions.Hold:(t=this.callById(e.id))&&t.setHold(e);break;case CallActions.Hangup:(t=this.callById(e.id))&&t.setHangup(e);break;default:throw new Error("Unhandled action")}t&&(this.eventHandler.emit(WEBSOCKET_EVENT_CALL,e.event,t),this.callDestroyed(t)&&this.destroyCall(t))}async handleChatEvents(e){let t;const r=Date.now();switch(e.action){case ChatActions.UserInvite:const i=e.data;(t=new Conversation(this,i.conversation_id,i.title,i.members,i.messages,i.variables)).setInvite(i.invite_id,r),this.conversationStore.set(t.id,t);break;case ChatActions.MessageDeleted:const a=e.data;for(const e of this.allConversations())if(!e.closedAt&&e.membersId.indexOf(a.channel_id)>-1){t=e;break}return void(t&&t.setDeletedMessage(a));case ChatActions.Joined:const n=e.data;(t=this.conversationById(n.member.id))&&t.setAnswered(n.member.id,r,n.member);break;case ChatActions.Message:const s=e.data;s.timestamp=r;for(const e of this.allConversations())!e.closedAt&&e.membersId.indexOf(s.channel_id)>-1&&(t=e);t&&t.newMessage(s);break;case ChatActions.Close:const o=e.data;for(const e of this.allConversations())!e.closedAt&&e.membersId.indexOf(o.from_channel_id)>-1&&(t=e);t&&t.setClosed(r);break;case ChatActions.Leave:const u=e.data;(t=this.conversationById(u.leaved_channel_id))&&t.setLeave(u);break;case ChatActions.Decline:const c=e.data;(t=this.conversationById(c.invite_id))&&t.setDecline(c)}t&&(t.lastAction=e.action,this.eventHandler.emit(WEBSOCKET_EVENT_CHAT,e.action,t),this.conversationDestroyed(t)&&this.destroyConversation(t))}hasAgentTask(e){return!(!this.agent||!e)&&this.agent.hasTask(e)}destroyCall(e){this.callStore.delete(e.id),this.eventHandler.emit(WEBSOCKET_EVENT_CALL,CallActions.Destroy,e)}fileUrlParams(e){const t=[`access_token=${this._config.token}`];if(e){const r=e.replace(/.*;source=([-._A-Za-z0-9/]+).*/,"$1");r&&t.push(`source=${r}`)}return t}}function isJobTask(e){return e.channel===ChannelName.Task}function isDestroyJob(e){return[ChannelState.Missed.toString(),ChannelState.Waiting,ChannelState.WrapTime,JobState.Closed].indexOf(e)>-1}class SipClient extends EventEmitter{}var commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var ee=createCommonjsModule(function(e,t){var r=commonjsGlobal&&commonjsGlobal.__generator||function(e,t){var r,i,a,n,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return n={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function o(n){return function(o){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,i&&(a=2&n[0]?i.return:n[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,n[1])).done)return a;switch(i=0,a&&(n=[2&n[0],a.value]),n[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,i=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(!(a=(a=s.trys).length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=t.call(e,s)}catch(e){n=[6,e],i=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.$listeners=Symbol("EventEmitter.listeners"),t.$addListener=Symbol("EventEmitter.addListener");var i=function(){function e(){this[t.$listeners]={}}return e.count=function(e,r){var i=0,a=e[t.$listeners][r];if(a)for(var n=a.first;++i&&n.next;)n=n.next;return i},e.has=function(e,r){if("*"==r){for(r in e[t.$listeners])return!0;return!1}return void 0!==e[t.$listeners][r]},e.keys=function(e){return Object.keys(e[t.$listeners])},e.unhandle=function(e,r,i,a){return e.on(r,function(){for(var a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];if(!e[t.$listeners][r].first.next)return i.apply(void 0,a)},a)},e.prototype.on=function(e,r,i){return"function"==typeof r?this[t.$addListener](e,r,i):this[t.$addListener](e,void 0,r)},e.prototype.one=function(e,r,i){return"function"==typeof r?this[t.$addListener](e,r,i,!0):this[t.$addListener](e,void 0,r,!0)},e.prototype.off=function(e,r){if("*"==e){var i=this[t.$listeners];if(this[t.$listeners]={},this._onEventUnhandled)for(var a in i)this._onEventUnhandled(a);return this}if("function"==typeof r){var n=this[t.$listeners][e];if(n&&function(e,t){var r=null,i=e.first;for(;;)if(t(i))if(r){if(r.next=i.next,!i.next)break;i=i.next}else{if(!i.next)return null;e.first=i=i.next}else{if(r=i,!i.next)break;i=i.next}return e.last=r,e}(n,function(e){return e.fn==r}))return this}return delete this[t.$listeners][e],this._onEventUnhandled&&this._onEventUnhandled(e),this},e.prototype.emit=function(e){for(var t,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];for(var a=this.listeners(e);;){var n=a.next(),s=n.value;if(n.done)return t;var o=s.apply(void 0,r);void 0!==o&&(t=o)}},e.prototype.listeners=function(e){var i,a,n;return r(this,function(r){switch(r.label){case 0:if(!(i=this[t.$listeners][e]))return[2];a=null,n=i.first,r.label=1;case 1:return[4,n.fn];case 2:if(r.sent(),n.once){if(!a)return n.next?(i.first=n=n.next,[3,1]):(delete this[t.$listeners][e],this._onEventUnhandled&&this._onEventUnhandled(e),[2]);a.next=n.next}else a=n;return n.next?(n=n.next,[3,1]):(i.last=n,[2]);case 3:return[2]}})},e.prototype[t.$addListener]=function(e,r,i,n){var s=this;if(void 0===n&&(n=!1),"object"==typeof e){var o,u=function(){if("function"==typeof e[o]){var r=e[o],u=a(c[t.$listeners],o,{fn:r,once:n,next:null});i&&i.push({dispose:function(){return s.off(o,r)}}),r==u.first.fn&&c._onEventHandled&&c._onEventHandled(o)}},c=this;for(o in e)u();return this}if("function"==typeof r){var l=e,d=a(this[t.$listeners],l,{fn:r,once:n,next:null});i&&i.push({dispose:function(){return s.off(l,r)}}),r==d.first.fn&&this._onEventHandled&&this._onEventHandled(e)}return r},e.ev=t.$listeners,e}();function a(e,t,r){var i=e[t];return i?(i.last.next=r,i.last=r):e[t]=i={first:r,last:r},i}t.EventEmitter=i});unwrapExports(ee);var ee_1=ee.$listeners,ee_2=ee.$addListener,ee_3=ee.EventEmitter;class Session$1{constructor(e,t){this.client=e,this.callId=t,this.incoming=!1,this.instanceId="fixme"}get id(){return this.callId}getLocalMedia(){return[]}getPeerMedia(){return[]}answer(e){return new Promise(e=>{this.client.answer(this.id),e()})}}class ExternalClient extends ee_3{constructor(e){super(),this.config=e,this.type="external",this.schema="wtel://"}async callOption(e){return e}async register(e){}async unregister(){}async call(e){e.destination&&this.exec(e.destination)}answer(e){this.exec(e,"answer")}isRegistered(){return!1}sipSessionByCallId(e){return new Session$1(this,e)}sipSessionBySipId(e){return null}open(e){this.exec(encodeURIComponent(JSON.stringify({token:e,...this.config})),"open")}exec(e,t){let r=`${this.schema}${e}`;t&&(r+=` ${t}`);const i=document.createElement("a");i.download="File name",i.href=r,i.click()}}export{AgentPauseCauseServiceApiAxiosParamCreator,AgentPauseCauseServiceApiFp,AgentPauseCauseServiceApiFactory,AgentPauseCauseServiceApi,AgentServiceApiAxiosParamCreator,AgentServiceApiFp,AgentServiceApiFactory,AgentServiceApi,AgentSkillServiceApiAxiosParamCreator,AgentSkillServiceApiFp,AgentSkillServiceApiFactory,AgentSkillServiceApi,AgentTeamServiceApiAxiosParamCreator,AgentTeamServiceApiFp,AgentTeamServiceApiFactory,AgentTeamServiceApi,AuditFormServiceApiAxiosParamCreator,AuditFormServiceApiFp,AuditFormServiceApiFactory,AuditFormServiceApi,BackendProfileServiceApiAxiosParamCreator,BackendProfileServiceApiFp,BackendProfileServiceApiFactory,BackendProfileServiceApi,BucketServiceApiAxiosParamCreator,BucketServiceApiFp,BucketServiceApiFactory,BucketServiceApi,CalendarServiceApiAxiosParamCreator,CalendarServiceApiFp,CalendarServiceApiFactory,CalendarServiceApi,CallServiceApiAxiosParamCreator,CallServiceApiFp,CallServiceApiFactory,CallServiceApi,CatalogApiAxiosParamCreator,CatalogApiFp,CatalogApiFactory,CatalogApi,ChatHelperServiceApiAxiosParamCreator,ChatHelperServiceApiFp,ChatHelperServiceApiFactory,ChatHelperServiceApi,CognitiveProfileServiceApiAxiosParamCreator,CognitiveProfileServiceApiFp,CognitiveProfileServiceApiFactory,CognitiveProfileServiceApi,CommunicationTypeServiceApiAxiosParamCreator,CommunicationTypeServiceApiFp,CommunicationTypeServiceApiFactory,CommunicationTypeServiceApi,ConfigServiceApiAxiosParamCreator,ConfigServiceApiFp,ConfigServiceApiFactory,ConfigServiceApi,ContactsApiAxiosParamCreator,ContactsApiFp,ContactsApiFactory,ContactsApi,EmailProfileServiceApiAxiosParamCreator,EmailProfileServiceApiFp,EmailProfileServiceApiFactory,EmailProfileServiceApi,EmailsApiAxiosParamCreator,EmailsApiFp,EmailsApiFactory,EmailsApi,FileServiceApiAxiosParamCreator,FileServiceApiFp,FileServiceApiFactory,FileServiceApi,FileTranscriptServiceApiAxiosParamCreator,FileTranscriptServiceApiFp,FileTranscriptServiceApiFactory,FileTranscriptServiceApi,ImportTemplateServiceApiAxiosParamCreator,ImportTemplateServiceApiFp,ImportTemplateServiceApiFactory,ImportTemplateServiceApi,LabelsApiAxiosParamCreator,LabelsApiFp,LabelsApiFactory,LabelsApi,ListServiceApiAxiosParamCreator,ListServiceApiFp,ListServiceApiFactory,ListServiceApi,LoggerServiceApiAxiosParamCreator,LoggerServiceApiFp,LoggerServiceApiFactory,LoggerServiceApi,ManagersApiAxiosParamCreator,ManagersApiFp,ManagersApiFactory,ManagersApi,MediaFileServiceApiAxiosParamCreator,MediaFileServiceApiFp,MediaFileServiceApiFactory,MediaFileServiceApi,MemberServiceApiAxiosParamCreator,MemberServiceApiFp,MemberServiceApiFactory,MemberServiceApi,OutboundResourceGroupServiceApiAxiosParamCreator,OutboundResourceGroupServiceApiFp,OutboundResourceGroupServiceApiFactory,OutboundResourceGroupServiceApi,OutboundResourceServiceApiAxiosParamCreator,OutboundResourceServiceApiFp,OutboundResourceServiceApiFactory,OutboundResourceServiceApi,PhonesApiAxiosParamCreator,PhonesApiFp,PhonesApiFactory,PhonesApi,PresetQueryServiceApiAxiosParamCreator,PresetQueryServiceApiFp,PresetQueryServiceApiFactory,PresetQueryServiceApi,QueueBucketServiceApiAxiosParamCreator,QueueBucketServiceApiFp,QueueBucketServiceApiFactory,QueueBucketServiceApi,QueueHookServiceApiAxiosParamCreator,QueueHookServiceApiFp,QueueHookServiceApiFactory,QueueHookServiceApi,QueueResourcesServiceApiAxiosParamCreator,QueueResourcesServiceApiFp,QueueResourcesServiceApiFactory,QueueResourcesServiceApi,QueueServiceApiAxiosParamCreator,QueueServiceApiFp,QueueServiceApiFactory,QueueServiceApi,QueueSkillServiceApiAxiosParamCreator,QueueSkillServiceApiFp,QueueSkillServiceApiFactory,QueueSkillServiceApi,RegionServiceApiAxiosParamCreator,RegionServiceApiFp,RegionServiceApiFactory,RegionServiceApi,RoutingChatPlanServiceApiAxiosParamCreator,RoutingChatPlanServiceApiFp,RoutingChatPlanServiceApiFactory,RoutingChatPlanServiceApi,RoutingOutboundCallServiceApiAxiosParamCreator,RoutingOutboundCallServiceApiFp,RoutingOutboundCallServiceApiFactory,RoutingOutboundCallServiceApi,RoutingSchemaServiceApiAxiosParamCreator,RoutingSchemaServiceApiFp,RoutingSchemaServiceApiFactory,RoutingSchemaServiceApi,RoutingVariableServiceApiAxiosParamCreator,RoutingVariableServiceApiFp,RoutingVariableServiceApiFactory,RoutingVariableServiceApi,SkillServiceApiAxiosParamCreator,SkillServiceApiFp,SkillServiceApiFactory,SkillServiceApi,SystemSettingServiceApiAxiosParamCreator,SystemSettingServiceApiFp,SystemSettingServiceApiFactory,SystemSettingServiceApi,TimezonesApiAxiosParamCreator,TimezonesApiFp,TimezonesApiFactory,TimezonesApi,TriggerServiceApiAxiosParamCreator,TriggerServiceApiFp,TriggerServiceApiFactory,TriggerServiceApi,UserHelperServiceApiAxiosParamCreator,UserHelperServiceApiFp,UserHelperServiceApiFactory,UserHelperServiceApi,VariablesApiAxiosParamCreator,VariablesApiFp,VariablesApiFactory,VariablesApi,Configuration,EngineAuditQuestionType,EngineBoolFilter,EngineCommunicationChannels,EnginePresetQuerySection,EngineRoutingSchemaType,EngineTriggerJobState,EngineTriggerType,GoogleProtobufNullValue,HistoryFileJobHistoryFileJobAction,HistoryFileJobHistoryFileJobState,LoggerAction,LoggerAvailableSystemObjects,ProtobufNullValue,StorageImportSourceType,StorageProviderType,StorageServiceType,StorageUploadStatusCode,WebitelContactsAccessMode,JobState,Response,Client,CallReportingStatus,EavesdropState,EavesdropType,CallActions,CallDirection,Call,AgentStatus,ChannelState,ChannelType,Agent,DeclineCause,ChatActions,ConversationState,Conversation,TypeErrors,DeviceNotFoundError,DeviceNotAllowPermissionError,RolePermissionError,LicencePermissionError,PauseNotAllowedError,SipClient,ExternalClient,SipPhone,Log};
1
+ import{parse,format}from"url";import globalAxios from"axios";import{EventEmitter}from"ee-ts";import{version,debug,WebSocketInterface,UA}from"jssip";const BASE_PATH="https://dev.webitel.com/api".replace(/\/+$/,"");class BaseAPI{constructor(e,t=BASE_PATH,r=globalAxios){this.basePath=t,this.axios=r,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}}class RequiredError extends Error{constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}const AgentPauseCauseServiceApiAxiosParamCreator=function(e){return{createAgentPauseCause:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgentPauseCause.");const i=parse("/call_center/pause_causes",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteAgentPauseCause:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteAgentPauseCause.");const i="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchAgentPauseCause:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchAgentPauseCause.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchAgentPauseCause.");const a="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readAgentPauseCause:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readAgentPauseCause.");const i="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchAgentPauseCause:async(t,r,i,a,n,s,o={})=>{const u=parse("/call_center/pause_causes",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateAgentPauseCause:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentPauseCause.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateAgentPauseCause.");const a="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},AgentPauseCauseServiceApiFp=function(e){return{async createAgentPauseCause(t,r){const i=await AgentPauseCauseServiceApiAxiosParamCreator(e).createAgentPauseCause(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteAgentPauseCause(t,r){const i=await AgentPauseCauseServiceApiAxiosParamCreator(e).deleteAgentPauseCause(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchAgentPauseCause(t,r,i){const a=await AgentPauseCauseServiceApiAxiosParamCreator(e).patchAgentPauseCause(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readAgentPauseCause(t,r){const i=await AgentPauseCauseServiceApiAxiosParamCreator(e).readAgentPauseCause(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchAgentPauseCause(t,r,i,a,n,s,o){const u=await AgentPauseCauseServiceApiAxiosParamCreator(e).searchAgentPauseCause(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateAgentPauseCause(t,r,i){const a=await AgentPauseCauseServiceApiAxiosParamCreator(e).updateAgentPauseCause(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},AgentPauseCauseServiceApiFactory=function(e,t,r){return{createAgentPauseCause:(i,a)=>AgentPauseCauseServiceApiFp(e).createAgentPauseCause(i,a).then(e=>e(r,t)),deleteAgentPauseCause:(i,a)=>AgentPauseCauseServiceApiFp(e).deleteAgentPauseCause(i,a).then(e=>e(r,t)),patchAgentPauseCause:(i,a,n)=>AgentPauseCauseServiceApiFp(e).patchAgentPauseCause(i,a,n).then(e=>e(r,t)),readAgentPauseCause:(i,a)=>AgentPauseCauseServiceApiFp(e).readAgentPauseCause(i,a).then(e=>e(r,t)),searchAgentPauseCause:(i,a,n,s,o,u,c)=>AgentPauseCauseServiceApiFp(e).searchAgentPauseCause(i,a,n,s,o,u,c).then(e=>e(r,t)),updateAgentPauseCause:(i,a,n)=>AgentPauseCauseServiceApiFp(e).updateAgentPauseCause(i,a,n).then(e=>e(r,t))}};class AgentPauseCauseServiceApi extends BaseAPI{createAgentPauseCause(e,t){return AgentPauseCauseServiceApiFp(this.configuration).createAgentPauseCause(e,t).then(e=>e(this.axios,this.basePath))}deleteAgentPauseCause(e,t){return AgentPauseCauseServiceApiFp(this.configuration).deleteAgentPauseCause(e,t).then(e=>e(this.axios,this.basePath))}patchAgentPauseCause(e,t,r){return AgentPauseCauseServiceApiFp(this.configuration).patchAgentPauseCause(e,t,r).then(e=>e(this.axios,this.basePath))}readAgentPauseCause(e,t){return AgentPauseCauseServiceApiFp(this.configuration).readAgentPauseCause(e,t).then(e=>e(this.axios,this.basePath))}searchAgentPauseCause(e,t,r,i,a,n,s){return AgentPauseCauseServiceApiFp(this.configuration).searchAgentPauseCause(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateAgentPauseCause(e,t,r){return AgentPauseCauseServiceApiFp(this.configuration).updateAgentPauseCause(e,t,r).then(e=>e(this.axios,this.basePath))}}const AgentServiceApiAxiosParamCreator=function(e){return{agentSetState:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentSetState.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling agentSetState.");const a="/call_center/agents/{agent_id}/states/waiting".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},agentStateHistory:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentStateHistory.");const c="/call_center/agents/{agent_id}/states/history".replace("{agent_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.time_from=a),void 0!==n&&(y.time_to=n),void 0!==s&&(y.q=s),void 0!==o&&(y.domain_id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},agentTodayStatistics:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentTodayStatistics.");const a="/call_center/agents/{agent_id}/statistics/today".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}r&&(c.fields=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},createAgent:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgent.");const i=parse("/call_center/agents",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteAgent.");const a="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},patchAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchAgent.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchAgent.");const a="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readAgent.");const a="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchAgent:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b={})=>{const S=parse("/call_center/agents",!0);let q;e&&(q=e.baseOptions);const v={method:"GET",...q,...b},C={},R={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;C["X-Webitel-Access"]=t}void 0!==t&&(R.page=t),void 0!==r&&(R.size=r),void 0!==i&&(R.q=i),void 0!==a&&(R.sort=a),n&&(R.fields=n),s&&(R.id=s),o&&(R.allow_channels=o),u&&(R.supervisor_id=u),c&&(R.team_id=c),l&&(R.region_id=l),d&&(R.auditor_id=d),void 0!==p&&(R.is_supervisor=p),h&&(R.skill_id=h),y&&(R.queue_id=y),void 0!==g&&(R.not_supervisor=g),A&&(R.user_id=A),m&&(R.extension=m),f&&(R.not_team_id=f),w&&(R.not_skill_id=w),S.query={...S.query,...R,...b.query},delete S.search;let P=q&&q.headers?q.headers:{};return v.headers={...C,...P,...b.headers},{url:format(S),options:v}},searchAgentCallStatistics:async(t,r,i,a,n,s,o,u,c,l={})=>{const d=parse("/call_center/agents/reports/call",!0);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...l},y={},g={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;y["X-Webitel-Access"]=t}void 0!==t&&(g.page=t),void 0!==r&&(g.size=r),void 0!==i&&(g["time.from"]=i),void 0!==a&&(g["time.to"]=a),n&&(g.agent_id=n),void 0!==s&&(g.domain_id=s),void 0!==o&&(g.q=o),u&&(g.fields=u),void 0!==c&&(g.sort=c),d.query={...d.query,...g,...l.query},delete d.search;let A=p&&p.headers?p.headers:{};return h.headers={...y,...A,...l.headers},{url:format(d),options:h}},searchAgentInQueue:async(t,r,i,a,n,s,o={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling searchAgentInQueue.");const u="/call_center/agents/{id}/queues".replace("{id}",encodeURIComponent(String(t))),c=parse(u,!0);let l;e&&(l=e.baseOptions);const d={method:"GET",...l,...o},p={},h={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;p["X-Webitel-Access"]=t}void 0!==r&&(h.page=r),void 0!==i&&(h.size=i),void 0!==a&&(h.q=a),void 0!==n&&(h.sort=n),s&&(h.fields=s),c.query={...c.query,...h,...o.query},delete c.search;let y=l&&l.headers?l.headers:{};return d.headers={...p,...y,...o.headers},{url:format(c),options:d}},searchAgentInQueueStatistics:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling searchAgentInQueueStatistics.");const a="/call_center/agents/{agent_id}/statistics/queues".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchAgentInTeam:async(t,r,i,a,n,s={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling searchAgentInTeam.");const o="/call_center/agents/{id}/teams".replace("{id}",encodeURIComponent(String(t))),u=parse(o,!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...s},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==r&&(p.page=r),void 0!==i&&(p.size=i),void 0!==a&&(p.q=a),void 0!==n&&(p.domain_id=n),u.query={...u.query,...p,...s.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...s.headers},{url:format(u),options:l}},searchAgentStateHistory:async(t,r,i,a,n,s,o,u,c={})=>{const l=parse("/call_center/agents/states/history",!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==t&&(y.page=t),void 0!==r&&(y.size=r),void 0!==i&&(y["joined_at.from"]=i),void 0!==a&&(y["joined_at.to"]=a),n&&(y.agent_id=n),void 0!==s&&(y.sort=s),void 0!==o&&(y.domain_id=o),void 0!==u&&(y.from_id=u),l.query={...l.query,...y,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},searchAgentStatusStatistic:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w={})=>{const b=parse("/call_center/agents/reports/status",!0);let S;e&&(S=e.baseOptions);const q={method:"GET",...S,...w},v={},C={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;v["X-Webitel-Access"]=t}void 0!==t&&(C.page=t),void 0!==r&&(C.size=r),void 0!==i&&(C.q=i),void 0!==a&&(C.sort=a),n&&(C.fields=n),s&&(C.agent_id=s),void 0!==o&&(C["time.from"]=o),void 0!==u&&(C["time.to"]=u),c&&(C.status=c),l&&(C.queue_id=l),d&&(C.team_id=d),void 0!==p&&(C["utilization.from"]=p),void 0!==h&&(C["utilization.to"]=h),void 0!==y&&(C.has_call=y),g&&(C.skill_id=g),A&&(C.region_id=A),m&&(C.supervisor_id=m),f&&(C.auditor_id=f),b.query={...b.query,...C,...w.query},delete b.search;let R=S&&S.headers?S.headers:{};return q.headers={...v,...R,...w.headers},{url:format(b),options:q}},searchAgentStatusStatisticItem:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling searchAgentStatusStatisticItem.");const n="/call_center/agents/reports/status/{agent_id}".replace("{agent_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==r&&(l["time.from"]=r),void 0!==i&&(l["time.to"]=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchLookupUsersAgentNotExists:async(t,r,i,a,n={})=>{const s=parse("/call_center/lookups/agents/users",!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...n},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==t&&(l.page=t),void 0!==r&&(l.size=r),void 0!==i&&(l.q=i),void 0!==a&&(l.domain_id=a),s.query={...s.query,...l,...n.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...n.headers},{url:format(s),options:u}},searchPauseCauseForAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling searchPauseCauseForAgent.");const a="/call_center/agents/{agent_id}/pause_causes".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.allow_change=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},updateAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgent.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateAgent.");const a="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},updateAgentStatus:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentStatus.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateAgentStatus.");const a="/call_center/agents/{id}/status".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},AgentServiceApiFp=function(e){return{async agentSetState(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).agentSetState(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async agentStateHistory(t,r,i,a,n,s,o,u){const c=await AgentServiceApiAxiosParamCreator(e).agentStateHistory(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async agentTodayStatistics(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).agentTodayStatistics(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async createAgent(t,r){const i=await AgentServiceApiAxiosParamCreator(e).createAgent(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).deleteAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).patchAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).readAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchAgent(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b){const S=await AgentServiceApiAxiosParamCreator(e).searchAgent(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b);return(e=globalAxios,t=BASE_PATH)=>{const r={...S.options,url:t+S.url};return e.request(r)}},async searchAgentCallStatistics(t,r,i,a,n,s,o,u,c,l){const d=await AgentServiceApiAxiosParamCreator(e).searchAgentCallStatistics(t,r,i,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async searchAgentInQueue(t,r,i,a,n,s,o){const u=await AgentServiceApiAxiosParamCreator(e).searchAgentInQueue(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async searchAgentInQueueStatistics(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).searchAgentInQueueStatistics(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchAgentInTeam(t,r,i,a,n,s){const o=await AgentServiceApiAxiosParamCreator(e).searchAgentInTeam(t,r,i,a,n,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...o.options,url:t+o.url};return e.request(r)}},async searchAgentStateHistory(t,r,i,a,n,s,o,u,c){const l=await AgentServiceApiAxiosParamCreator(e).searchAgentStateHistory(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async searchAgentStatusStatistic(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w){const b=await AgentServiceApiAxiosParamCreator(e).searchAgentStatusStatistic(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w);return(e=globalAxios,t=BASE_PATH)=>{const r={...b.options,url:t+b.url};return e.request(r)}},async searchAgentStatusStatisticItem(t,r,i,a){const n=await AgentServiceApiAxiosParamCreator(e).searchAgentStatusStatisticItem(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchLookupUsersAgentNotExists(t,r,i,a,n){const s=await AgentServiceApiAxiosParamCreator(e).searchLookupUsersAgentNotExists(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async searchPauseCauseForAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).searchPauseCauseForAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async updateAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).updateAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async updateAgentStatus(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).updateAgentStatus(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},AgentServiceApiFactory=function(e,t,r){return{agentSetState:(i,a,n)=>AgentServiceApiFp(e).agentSetState(i,a,n).then(e=>e(r,t)),agentStateHistory:(i,a,n,s,o,u,c,l)=>AgentServiceApiFp(e).agentStateHistory(i,a,n,s,o,u,c,l).then(e=>e(r,t)),agentTodayStatistics:(i,a,n)=>AgentServiceApiFp(e).agentTodayStatistics(i,a,n).then(e=>e(r,t)),createAgent:(i,a)=>AgentServiceApiFp(e).createAgent(i,a).then(e=>e(r,t)),deleteAgent:(i,a,n)=>AgentServiceApiFp(e).deleteAgent(i,a,n).then(e=>e(r,t)),patchAgent:(i,a,n)=>AgentServiceApiFp(e).patchAgent(i,a,n).then(e=>e(r,t)),readAgent:(i,a,n)=>AgentServiceApiFp(e).readAgent(i,a,n).then(e=>e(r,t)),searchAgent:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q)=>AgentServiceApiFp(e).searchAgent(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q).then(e=>e(r,t)),searchAgentCallStatistics:(i,a,n,s,o,u,c,l,d,p)=>AgentServiceApiFp(e).searchAgentCallStatistics(i,a,n,s,o,u,c,l,d,p).then(e=>e(r,t)),searchAgentInQueue:(i,a,n,s,o,u,c)=>AgentServiceApiFp(e).searchAgentInQueue(i,a,n,s,o,u,c).then(e=>e(r,t)),searchAgentInQueueStatistics:(i,a,n)=>AgentServiceApiFp(e).searchAgentInQueueStatistics(i,a,n).then(e=>e(r,t)),searchAgentInTeam:(i,a,n,s,o,u)=>AgentServiceApiFp(e).searchAgentInTeam(i,a,n,s,o,u).then(e=>e(r,t)),searchAgentStateHistory:(i,a,n,s,o,u,c,l,d)=>AgentServiceApiFp(e).searchAgentStateHistory(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),searchAgentStatusStatistic:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S)=>AgentServiceApiFp(e).searchAgentStatusStatistic(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S).then(e=>e(r,t)),searchAgentStatusStatisticItem:(i,a,n,s)=>AgentServiceApiFp(e).searchAgentStatusStatisticItem(i,a,n,s).then(e=>e(r,t)),searchLookupUsersAgentNotExists:(i,a,n,s,o)=>AgentServiceApiFp(e).searchLookupUsersAgentNotExists(i,a,n,s,o).then(e=>e(r,t)),searchPauseCauseForAgent:(i,a,n)=>AgentServiceApiFp(e).searchPauseCauseForAgent(i,a,n).then(e=>e(r,t)),updateAgent:(i,a,n)=>AgentServiceApiFp(e).updateAgent(i,a,n).then(e=>e(r,t)),updateAgentStatus:(i,a,n)=>AgentServiceApiFp(e).updateAgentStatus(i,a,n).then(e=>e(r,t))}};class AgentServiceApi extends BaseAPI{agentSetState(e,t,r){return AgentServiceApiFp(this.configuration).agentSetState(e,t,r).then(e=>e(this.axios,this.basePath))}agentStateHistory(e,t,r,i,a,n,s,o){return AgentServiceApiFp(this.configuration).agentStateHistory(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}agentTodayStatistics(e,t,r){return AgentServiceApiFp(this.configuration).agentTodayStatistics(e,t,r).then(e=>e(this.axios,this.basePath))}createAgent(e,t){return AgentServiceApiFp(this.configuration).createAgent(e,t).then(e=>e(this.axios,this.basePath))}deleteAgent(e,t,r){return AgentServiceApiFp(this.configuration).deleteAgent(e,t,r).then(e=>e(this.axios,this.basePath))}patchAgent(e,t,r){return AgentServiceApiFp(this.configuration).patchAgent(e,t,r).then(e=>e(this.axios,this.basePath))}readAgent(e,t,r){return AgentServiceApiFp(this.configuration).readAgent(e,t,r).then(e=>e(this.axios,this.basePath))}searchAgent(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w){return AgentServiceApiFp(this.configuration).searchAgent(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w).then(e=>e(this.axios,this.basePath))}searchAgentCallStatistics(e,t,r,i,a,n,s,o,u,c){return AgentServiceApiFp(this.configuration).searchAgentCallStatistics(e,t,r,i,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}searchAgentInQueue(e,t,r,i,a,n,s){return AgentServiceApiFp(this.configuration).searchAgentInQueue(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}searchAgentInQueueStatistics(e,t,r){return AgentServiceApiFp(this.configuration).searchAgentInQueueStatistics(e,t,r).then(e=>e(this.axios,this.basePath))}searchAgentInTeam(e,t,r,i,a,n){return AgentServiceApiFp(this.configuration).searchAgentInTeam(e,t,r,i,a,n).then(e=>e(this.axios,this.basePath))}searchAgentStateHistory(e,t,r,i,a,n,s,o,u){return AgentServiceApiFp(this.configuration).searchAgentStateHistory(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}searchAgentStatusStatistic(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f){return AgentServiceApiFp(this.configuration).searchAgentStatusStatistic(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f).then(e=>e(this.axios,this.basePath))}searchAgentStatusStatisticItem(e,t,r,i){return AgentServiceApiFp(this.configuration).searchAgentStatusStatisticItem(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchLookupUsersAgentNotExists(e,t,r,i,a){return AgentServiceApiFp(this.configuration).searchLookupUsersAgentNotExists(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}searchPauseCauseForAgent(e,t,r){return AgentServiceApiFp(this.configuration).searchPauseCauseForAgent(e,t,r).then(e=>e(this.axios,this.basePath))}updateAgent(e,t,r){return AgentServiceApiFp(this.configuration).updateAgent(e,t,r).then(e=>e(this.axios,this.basePath))}updateAgentStatus(e,t,r){return AgentServiceApiFp(this.configuration).updateAgentStatus(e,t,r).then(e=>e(this.axios,this.basePath))}}const AgentSkillServiceApiAxiosParamCreator=function(e){return{createAgentSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling createAgentSkill.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgentSkill.");const a="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},createAgentSkills:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling createAgentSkills.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgentSkills.");const a="/call_center/agents/{agent_id}/skills/bulk".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteAgentSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling deleteAgentSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteAgentSkill.");const n="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},deleteAgentSkills:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling deleteAgentSkills.");const n="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}r&&(l.id=r),i&&(l.skill_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},patchAgentSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling patchAgentSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling patchAgentSkill.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling patchAgentSkill.");const n="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},patchAgentSkills:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling patchAgentSkills.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchAgentSkills.");const a="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readAgentSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling readAgentSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readAgentSkill.");const n="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchAgentSkill:async(t,r,i,a,n,s,o,u,c={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling searchAgentSkill.");const l="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(t))),d=parse(l,!0);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...c},y={},g={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;y["X-Webitel-Access"]=t}void 0!==r&&(g.page=r),void 0!==i&&(g.size=i),void 0!==a&&(g.q=a),void 0!==n&&(g.sort=n),s&&(g.fields=s),o&&(g.id=o),u&&(g.skill_id=u),d.query={...d.query,...g,...c.query},delete d.search;let A=p&&p.headers?p.headers:{};return h.headers={...y,...A,...c.headers},{url:format(d),options:h}},searchLookupAgentNotExistsSkill:async(t,r,i,a,n,s={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling searchLookupAgentNotExistsSkill.");const o="/call_center/lookups/agents/skills/{agent_id}".replace("{agent_id}",encodeURIComponent(String(t))),u=parse(o,!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...s},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==r&&(p.page=r),void 0!==i&&(p.size=i),void 0!==a&&(p.q=a),void 0!==n&&(p.domain_id=n),u.query={...u.query,...p,...s.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...s.headers},{url:format(u),options:l}},updateAgentSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling updateAgentSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentSkill.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateAgentSkill.");const n="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},AgentSkillServiceApiFp=function(e){return{async createAgentSkill(t,r,i){const a=await AgentSkillServiceApiAxiosParamCreator(e).createAgentSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async createAgentSkills(t,r,i){const a=await AgentSkillServiceApiAxiosParamCreator(e).createAgentSkills(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteAgentSkill(t,r,i,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).deleteAgentSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async deleteAgentSkills(t,r,i,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).deleteAgentSkills(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async patchAgentSkill(t,r,i,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).patchAgentSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async patchAgentSkills(t,r,i){const a=await AgentSkillServiceApiAxiosParamCreator(e).patchAgentSkills(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readAgentSkill(t,r,i,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).readAgentSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchAgentSkill(t,r,i,a,n,s,o,u,c){const l=await AgentSkillServiceApiAxiosParamCreator(e).searchAgentSkill(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async searchLookupAgentNotExistsSkill(t,r,i,a,n,s){const o=await AgentSkillServiceApiAxiosParamCreator(e).searchLookupAgentNotExistsSkill(t,r,i,a,n,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...o.options,url:t+o.url};return e.request(r)}},async updateAgentSkill(t,r,i,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).updateAgentSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},AgentSkillServiceApiFactory=function(e,t,r){return{createAgentSkill:(i,a,n)=>AgentSkillServiceApiFp(e).createAgentSkill(i,a,n).then(e=>e(r,t)),createAgentSkills:(i,a,n)=>AgentSkillServiceApiFp(e).createAgentSkills(i,a,n).then(e=>e(r,t)),deleteAgentSkill:(i,a,n,s)=>AgentSkillServiceApiFp(e).deleteAgentSkill(i,a,n,s).then(e=>e(r,t)),deleteAgentSkills:(i,a,n,s)=>AgentSkillServiceApiFp(e).deleteAgentSkills(i,a,n,s).then(e=>e(r,t)),patchAgentSkill:(i,a,n,s)=>AgentSkillServiceApiFp(e).patchAgentSkill(i,a,n,s).then(e=>e(r,t)),patchAgentSkills:(i,a,n)=>AgentSkillServiceApiFp(e).patchAgentSkills(i,a,n).then(e=>e(r,t)),readAgentSkill:(i,a,n,s)=>AgentSkillServiceApiFp(e).readAgentSkill(i,a,n,s).then(e=>e(r,t)),searchAgentSkill:(i,a,n,s,o,u,c,l,d)=>AgentSkillServiceApiFp(e).searchAgentSkill(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),searchLookupAgentNotExistsSkill:(i,a,n,s,o,u)=>AgentSkillServiceApiFp(e).searchLookupAgentNotExistsSkill(i,a,n,s,o,u).then(e=>e(r,t)),updateAgentSkill:(i,a,n,s)=>AgentSkillServiceApiFp(e).updateAgentSkill(i,a,n,s).then(e=>e(r,t))}};class AgentSkillServiceApi extends BaseAPI{createAgentSkill(e,t,r){return AgentSkillServiceApiFp(this.configuration).createAgentSkill(e,t,r).then(e=>e(this.axios,this.basePath))}createAgentSkills(e,t,r){return AgentSkillServiceApiFp(this.configuration).createAgentSkills(e,t,r).then(e=>e(this.axios,this.basePath))}deleteAgentSkill(e,t,r,i){return AgentSkillServiceApiFp(this.configuration).deleteAgentSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}deleteAgentSkills(e,t,r,i){return AgentSkillServiceApiFp(this.configuration).deleteAgentSkills(e,t,r,i).then(e=>e(this.axios,this.basePath))}patchAgentSkill(e,t,r,i){return AgentSkillServiceApiFp(this.configuration).patchAgentSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}patchAgentSkills(e,t,r){return AgentSkillServiceApiFp(this.configuration).patchAgentSkills(e,t,r).then(e=>e(this.axios,this.basePath))}readAgentSkill(e,t,r,i){return AgentSkillServiceApiFp(this.configuration).readAgentSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchAgentSkill(e,t,r,i,a,n,s,o,u){return AgentSkillServiceApiFp(this.configuration).searchAgentSkill(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}searchLookupAgentNotExistsSkill(e,t,r,i,a,n){return AgentSkillServiceApiFp(this.configuration).searchLookupAgentNotExistsSkill(e,t,r,i,a,n).then(e=>e(this.axios,this.basePath))}updateAgentSkill(e,t,r,i){return AgentSkillServiceApiFp(this.configuration).updateAgentSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const AgentTeamServiceApiAxiosParamCreator=function(e){return{createAgentTeam:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgentTeam.");const i=parse("/call_center/teams",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteAgentTeam:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteAgentTeam.");const a="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readAgentTeam:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readAgentTeam.");const a="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchAgentTeam:async(t,r,i,a,n,s,o,u,c={})=>{const l=parse("/call_center/teams",!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==t&&(y.page=t),void 0!==r&&(y.size=r),void 0!==i&&(y.q=i),void 0!==a&&(y.sort=a),n&&(y.fields=n),s&&(y.id=s),o&&(y.strategy=o),u&&(y.admin_id=u),l.query={...l.query,...y,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},updateAgentTeam:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentTeam.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateAgentTeam.");const a="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},AgentTeamServiceApiFp=function(e){return{async createAgentTeam(t,r){const i=await AgentTeamServiceApiAxiosParamCreator(e).createAgentTeam(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteAgentTeam(t,r,i){const a=await AgentTeamServiceApiAxiosParamCreator(e).deleteAgentTeam(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readAgentTeam(t,r,i){const a=await AgentTeamServiceApiAxiosParamCreator(e).readAgentTeam(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchAgentTeam(t,r,i,a,n,s,o,u,c){const l=await AgentTeamServiceApiAxiosParamCreator(e).searchAgentTeam(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async updateAgentTeam(t,r,i){const a=await AgentTeamServiceApiAxiosParamCreator(e).updateAgentTeam(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},AgentTeamServiceApiFactory=function(e,t,r){return{createAgentTeam:(i,a)=>AgentTeamServiceApiFp(e).createAgentTeam(i,a).then(e=>e(r,t)),deleteAgentTeam:(i,a,n)=>AgentTeamServiceApiFp(e).deleteAgentTeam(i,a,n).then(e=>e(r,t)),readAgentTeam:(i,a,n)=>AgentTeamServiceApiFp(e).readAgentTeam(i,a,n).then(e=>e(r,t)),searchAgentTeam:(i,a,n,s,o,u,c,l,d)=>AgentTeamServiceApiFp(e).searchAgentTeam(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),updateAgentTeam:(i,a,n)=>AgentTeamServiceApiFp(e).updateAgentTeam(i,a,n).then(e=>e(r,t))}};class AgentTeamServiceApi extends BaseAPI{createAgentTeam(e,t){return AgentTeamServiceApiFp(this.configuration).createAgentTeam(e,t).then(e=>e(this.axios,this.basePath))}deleteAgentTeam(e,t,r){return AgentTeamServiceApiFp(this.configuration).deleteAgentTeam(e,t,r).then(e=>e(this.axios,this.basePath))}readAgentTeam(e,t,r){return AgentTeamServiceApiFp(this.configuration).readAgentTeam(e,t,r).then(e=>e(this.axios,this.basePath))}searchAgentTeam(e,t,r,i,a,n,s,o,u){return AgentTeamServiceApiFp(this.configuration).searchAgentTeam(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateAgentTeam(e,t,r){return AgentTeamServiceApiFp(this.configuration).updateAgentTeam(e,t,r).then(e=>e(this.axios,this.basePath))}}const AuditFormServiceApiAxiosParamCreator=function(e){return{createAuditForm:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createAuditForm.");const i=parse("/call_center/audit/forms",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},createAuditFormRate:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createAuditFormRate.");const i=parse("/call_center/audit/rate",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteAuditForm:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteAuditForm.");const i="/call_center/audit/forms/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchAuditForm:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchAuditForm.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchAuditForm.");const a="/call_center/audit/forms/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readAuditForm:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readAuditForm.");const i="/call_center/audit/forms/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},readAuditRate:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readAuditRate.");const i="/call_center/audit/rate/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchAuditForm:async(t,r,i,a,n,s,o,u,c,l,d,p,h={})=>{const y=parse("/call_center/audit/forms",!0);let g;e&&(g=e.baseOptions);const A={method:"GET",...g,...h},m={},f={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;m["X-Webitel-Access"]=t}void 0!==t&&(f.page=t),void 0!==r&&(f.size=r),void 0!==i&&(f.q=i),void 0!==a&&(f.sort=a),n&&(f.fields=n),s&&(f.id=s),o&&(f.team_id=o),void 0!==u&&(f.enabled=u),void 0!==c&&(f.archive=c),void 0!==l&&(f.editable=l),void 0!==d&&(f.active=d),void 0!==p&&(f.question=p),y.query={...y.query,...f,...h.query},delete y.search;let w=g&&g.headers?g.headers:{};return A.headers={...m,...w,...h.headers},{url:format(y),options:A}},searchAuditRate:async(t,r,i,a,n,s,o,u,c,l,d,p={})=>{if(null==t)throw new RequiredError("formId","Required parameter formId was null or undefined when calling searchAuditRate.");const h="/call_center/audit/forms/{form_id}/rate".replace("{form_id}",encodeURIComponent(String(t))),y=parse(h,!0);let g;e&&(g=e.baseOptions);const A={method:"GET",...g,...p},m={},f={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;m["X-Webitel-Access"]=t}void 0!==r&&(f.page=r),void 0!==i&&(f.size=i),void 0!==a&&(f.q=a),void 0!==n&&(f.sort=n),s&&(f.fields=s),void 0!==o&&(f["created_at.from"]=o),void 0!==u&&(f["created_at.to"]=u),c&&(f.id=c),l&&(f.call_id=l),d&&(f.rated_user=d),y.query={...y.query,...f,...p.query},delete y.search;let w=g&&g.headers?g.headers:{};return A.headers={...m,...w,...p.headers},{url:format(y),options:A}},updateAuditForm:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAuditForm.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateAuditForm.");const a="/call_center/audit/forms/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},AuditFormServiceApiFp=function(e){return{async createAuditForm(t,r){const i=await AuditFormServiceApiAxiosParamCreator(e).createAuditForm(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createAuditFormRate(t,r){const i=await AuditFormServiceApiAxiosParamCreator(e).createAuditFormRate(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteAuditForm(t,r){const i=await AuditFormServiceApiAxiosParamCreator(e).deleteAuditForm(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchAuditForm(t,r,i){const a=await AuditFormServiceApiAxiosParamCreator(e).patchAuditForm(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readAuditForm(t,r){const i=await AuditFormServiceApiAxiosParamCreator(e).readAuditForm(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async readAuditRate(t,r){const i=await AuditFormServiceApiAxiosParamCreator(e).readAuditRate(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchAuditForm(t,r,i,a,n,s,o,u,c,l,d,p,h){const y=await AuditFormServiceApiAxiosParamCreator(e).searchAuditForm(t,r,i,a,n,s,o,u,c,l,d,p,h);return(e=globalAxios,t=BASE_PATH)=>{const r={...y.options,url:t+y.url};return e.request(r)}},async searchAuditRate(t,r,i,a,n,s,o,u,c,l,d,p){const h=await AuditFormServiceApiAxiosParamCreator(e).searchAuditRate(t,r,i,a,n,s,o,u,c,l,d,p);return(e=globalAxios,t=BASE_PATH)=>{const r={...h.options,url:t+h.url};return e.request(r)}},async updateAuditForm(t,r,i){const a=await AuditFormServiceApiAxiosParamCreator(e).updateAuditForm(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},AuditFormServiceApiFactory=function(e,t,r){return{createAuditForm:(i,a)=>AuditFormServiceApiFp(e).createAuditForm(i,a).then(e=>e(r,t)),createAuditFormRate:(i,a)=>AuditFormServiceApiFp(e).createAuditFormRate(i,a).then(e=>e(r,t)),deleteAuditForm:(i,a)=>AuditFormServiceApiFp(e).deleteAuditForm(i,a).then(e=>e(r,t)),patchAuditForm:(i,a,n)=>AuditFormServiceApiFp(e).patchAuditForm(i,a,n).then(e=>e(r,t)),readAuditForm:(i,a)=>AuditFormServiceApiFp(e).readAuditForm(i,a).then(e=>e(r,t)),readAuditRate:(i,a)=>AuditFormServiceApiFp(e).readAuditRate(i,a).then(e=>e(r,t)),searchAuditForm:(i,a,n,s,o,u,c,l,d,p,h,y,g)=>AuditFormServiceApiFp(e).searchAuditForm(i,a,n,s,o,u,c,l,d,p,h,y,g).then(e=>e(r,t)),searchAuditRate:(i,a,n,s,o,u,c,l,d,p,h,y)=>AuditFormServiceApiFp(e).searchAuditRate(i,a,n,s,o,u,c,l,d,p,h,y).then(e=>e(r,t)),updateAuditForm:(i,a,n)=>AuditFormServiceApiFp(e).updateAuditForm(i,a,n).then(e=>e(r,t))}};class AuditFormServiceApi extends BaseAPI{createAuditForm(e,t){return AuditFormServiceApiFp(this.configuration).createAuditForm(e,t).then(e=>e(this.axios,this.basePath))}createAuditFormRate(e,t){return AuditFormServiceApiFp(this.configuration).createAuditFormRate(e,t).then(e=>e(this.axios,this.basePath))}deleteAuditForm(e,t){return AuditFormServiceApiFp(this.configuration).deleteAuditForm(e,t).then(e=>e(this.axios,this.basePath))}patchAuditForm(e,t,r){return AuditFormServiceApiFp(this.configuration).patchAuditForm(e,t,r).then(e=>e(this.axios,this.basePath))}readAuditForm(e,t){return AuditFormServiceApiFp(this.configuration).readAuditForm(e,t).then(e=>e(this.axios,this.basePath))}readAuditRate(e,t){return AuditFormServiceApiFp(this.configuration).readAuditRate(e,t).then(e=>e(this.axios,this.basePath))}searchAuditForm(e,t,r,i,a,n,s,o,u,c,l,d,p){return AuditFormServiceApiFp(this.configuration).searchAuditForm(e,t,r,i,a,n,s,o,u,c,l,d,p).then(e=>e(this.axios,this.basePath))}searchAuditRate(e,t,r,i,a,n,s,o,u,c,l,d){return AuditFormServiceApiFp(this.configuration).searchAuditRate(e,t,r,i,a,n,s,o,u,c,l,d).then(e=>e(this.axios,this.basePath))}updateAuditForm(e,t,r){return AuditFormServiceApiFp(this.configuration).updateAuditForm(e,t,r).then(e=>e(this.axios,this.basePath))}}const BackendProfileServiceApiAxiosParamCreator=function(e){return{createBackendProfile:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createBackendProfile.");const i=parse("/storage/backend_profiles",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteBackendProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteBackendProfile.");const a="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},patchBackendProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchBackendProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchBackendProfile.");const a="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readBackendProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readBackendProfile.");const a="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchBackendProfile:async(t,r,i,a,n,s,o={})=>{const u=parse("/storage/backend_profiles",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateBackendProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateBackendProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateBackendProfile.");const a="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},BackendProfileServiceApiFp=function(e){return{async createBackendProfile(t,r){const i=await BackendProfileServiceApiAxiosParamCreator(e).createBackendProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteBackendProfile(t,r,i){const a=await BackendProfileServiceApiAxiosParamCreator(e).deleteBackendProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchBackendProfile(t,r,i){const a=await BackendProfileServiceApiAxiosParamCreator(e).patchBackendProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readBackendProfile(t,r,i){const a=await BackendProfileServiceApiAxiosParamCreator(e).readBackendProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchBackendProfile(t,r,i,a,n,s,o){const u=await BackendProfileServiceApiAxiosParamCreator(e).searchBackendProfile(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateBackendProfile(t,r,i){const a=await BackendProfileServiceApiAxiosParamCreator(e).updateBackendProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},BackendProfileServiceApiFactory=function(e,t,r){return{createBackendProfile:(i,a)=>BackendProfileServiceApiFp(e).createBackendProfile(i,a).then(e=>e(r,t)),deleteBackendProfile:(i,a,n)=>BackendProfileServiceApiFp(e).deleteBackendProfile(i,a,n).then(e=>e(r,t)),patchBackendProfile:(i,a,n)=>BackendProfileServiceApiFp(e).patchBackendProfile(i,a,n).then(e=>e(r,t)),readBackendProfile:(i,a,n)=>BackendProfileServiceApiFp(e).readBackendProfile(i,a,n).then(e=>e(r,t)),searchBackendProfile:(i,a,n,s,o,u,c)=>BackendProfileServiceApiFp(e).searchBackendProfile(i,a,n,s,o,u,c).then(e=>e(r,t)),updateBackendProfile:(i,a,n)=>BackendProfileServiceApiFp(e).updateBackendProfile(i,a,n).then(e=>e(r,t))}};class BackendProfileServiceApi extends BaseAPI{createBackendProfile(e,t){return BackendProfileServiceApiFp(this.configuration).createBackendProfile(e,t).then(e=>e(this.axios,this.basePath))}deleteBackendProfile(e,t,r){return BackendProfileServiceApiFp(this.configuration).deleteBackendProfile(e,t,r).then(e=>e(this.axios,this.basePath))}patchBackendProfile(e,t,r){return BackendProfileServiceApiFp(this.configuration).patchBackendProfile(e,t,r).then(e=>e(this.axios,this.basePath))}readBackendProfile(e,t,r){return BackendProfileServiceApiFp(this.configuration).readBackendProfile(e,t,r).then(e=>e(this.axios,this.basePath))}searchBackendProfile(e,t,r,i,a,n,s){return BackendProfileServiceApiFp(this.configuration).searchBackendProfile(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateBackendProfile(e,t,r){return BackendProfileServiceApiFp(this.configuration).updateBackendProfile(e,t,r).then(e=>e(this.axios,this.basePath))}}const BucketServiceApiAxiosParamCreator=function(e){return{createBucket:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createBucket.");const i=parse("/call_center/buckets",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteBucket.");const a="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readBucket.");const a="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchBucket:async(t,r,i,a,n,s,o={})=>{const u=parse("/call_center/buckets",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateBucket.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateBucket.");const a="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},BucketServiceApiFp=function(e){return{async createBucket(t,r){const i=await BucketServiceApiAxiosParamCreator(e).createBucket(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteBucket(t,r,i){const a=await BucketServiceApiAxiosParamCreator(e).deleteBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readBucket(t,r,i){const a=await BucketServiceApiAxiosParamCreator(e).readBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchBucket(t,r,i,a,n,s,o){const u=await BucketServiceApiAxiosParamCreator(e).searchBucket(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateBucket(t,r,i){const a=await BucketServiceApiAxiosParamCreator(e).updateBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},BucketServiceApiFactory=function(e,t,r){return{createBucket:(i,a)=>BucketServiceApiFp(e).createBucket(i,a).then(e=>e(r,t)),deleteBucket:(i,a,n)=>BucketServiceApiFp(e).deleteBucket(i,a,n).then(e=>e(r,t)),readBucket:(i,a,n)=>BucketServiceApiFp(e).readBucket(i,a,n).then(e=>e(r,t)),searchBucket:(i,a,n,s,o,u,c)=>BucketServiceApiFp(e).searchBucket(i,a,n,s,o,u,c).then(e=>e(r,t)),updateBucket:(i,a,n)=>BucketServiceApiFp(e).updateBucket(i,a,n).then(e=>e(r,t))}};class BucketServiceApi extends BaseAPI{createBucket(e,t){return BucketServiceApiFp(this.configuration).createBucket(e,t).then(e=>e(this.axios,this.basePath))}deleteBucket(e,t,r){return BucketServiceApiFp(this.configuration).deleteBucket(e,t,r).then(e=>e(this.axios,this.basePath))}readBucket(e,t,r){return BucketServiceApiFp(this.configuration).readBucket(e,t,r).then(e=>e(this.axios,this.basePath))}searchBucket(e,t,r,i,a,n,s){return BucketServiceApiFp(this.configuration).searchBucket(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateBucket(e,t,r){return BucketServiceApiFp(this.configuration).updateBucket(e,t,r).then(e=>e(this.axios,this.basePath))}}const CalendarServiceApiAxiosParamCreator=function(e){return{createCalendar:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCalendar.");const i=parse("/calendars",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteCalendar:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteCalendar.");const a="/calendars/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readCalendar:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readCalendar.");const a="/calendars/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchCalendar:async(t,r,i,a,n,s,o={})=>{const u=parse("/calendars",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},searchTimezones:async(t,r,i,a,n,s,o={})=>{const u=parse("/calendars/timezones",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateCalendar:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCalendar.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateCalendar.");const a="/calendars/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},CalendarServiceApiFp=function(e){return{async createCalendar(t,r){const i=await CalendarServiceApiAxiosParamCreator(e).createCalendar(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteCalendar(t,r,i){const a=await CalendarServiceApiAxiosParamCreator(e).deleteCalendar(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readCalendar(t,r,i){const a=await CalendarServiceApiAxiosParamCreator(e).readCalendar(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchCalendar(t,r,i,a,n,s,o){const u=await CalendarServiceApiAxiosParamCreator(e).searchCalendar(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async searchTimezones(t,r,i,a,n,s,o){const u=await CalendarServiceApiAxiosParamCreator(e).searchTimezones(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateCalendar(t,r,i){const a=await CalendarServiceApiAxiosParamCreator(e).updateCalendar(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},CalendarServiceApiFactory=function(e,t,r){return{createCalendar:(i,a)=>CalendarServiceApiFp(e).createCalendar(i,a).then(e=>e(r,t)),deleteCalendar:(i,a,n)=>CalendarServiceApiFp(e).deleteCalendar(i,a,n).then(e=>e(r,t)),readCalendar:(i,a,n)=>CalendarServiceApiFp(e).readCalendar(i,a,n).then(e=>e(r,t)),searchCalendar:(i,a,n,s,o,u,c)=>CalendarServiceApiFp(e).searchCalendar(i,a,n,s,o,u,c).then(e=>e(r,t)),searchTimezones:(i,a,n,s,o,u,c)=>CalendarServiceApiFp(e).searchTimezones(i,a,n,s,o,u,c).then(e=>e(r,t)),updateCalendar:(i,a,n)=>CalendarServiceApiFp(e).updateCalendar(i,a,n).then(e=>e(r,t))}};class CalendarServiceApi extends BaseAPI{createCalendar(e,t){return CalendarServiceApiFp(this.configuration).createCalendar(e,t).then(e=>e(this.axios,this.basePath))}deleteCalendar(e,t,r){return CalendarServiceApiFp(this.configuration).deleteCalendar(e,t,r).then(e=>e(this.axios,this.basePath))}readCalendar(e,t,r){return CalendarServiceApiFp(this.configuration).readCalendar(e,t,r).then(e=>e(this.axios,this.basePath))}searchCalendar(e,t,r,i,a,n,s){return CalendarServiceApiFp(this.configuration).searchCalendar(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}searchTimezones(e,t,r,i,a,n,s){return CalendarServiceApiFp(this.configuration).searchTimezones(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateCalendar(e,t,r){return CalendarServiceApiFp(this.configuration).updateCalendar(e,t,r).then(e=>e(this.axios,this.basePath))}}const CallServiceApiAxiosParamCreator=function(e){return{aggregateHistoryCall:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling aggregateHistoryCall.");const i=parse("/calls/history/aggregate",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},blindTransferCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling blindTransferCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling blindTransferCall.");const a="/calls/active/{id}/transfer".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},confirmPush:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling confirmPush.");const i="/calls/active/{id}/confirm_push".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"PATCH",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},createCall:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCall.");const i=parse("/calls",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},createCallAnnotation:async(t,r,i={})=>{if(null==t)throw new RequiredError("callId","Required parameter callId was null or undefined when calling createCallAnnotation.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createCallAnnotation.");const a="/calls/history/{call_id}/annotation".replace("{call_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteCallAnnotation:async(t,r,i={})=>{if(null==t)throw new RequiredError("callId","Required parameter callId was null or undefined when calling deleteCallAnnotation.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteCallAnnotation.");const a="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},dtmfCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling dtmfCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling dtmfCall.");const a="/calls/active/{id}/dtmf".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},eavesdropCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling eavesdropCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling eavesdropCall.");const a="/calls/active/{id}/eavesdrop".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},hangupCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling hangupCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling hangupCall.");const a="/calls/active/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},holdCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling holdCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling holdCall.");const a="/calls/active/{id}/hold".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},patchHistoryCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchHistoryCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchHistoryCall.");const a="/calls/history/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readCall.");const a="/calls/active/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchActiveCall:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q,v,C,R,P,T,E,_,K={})=>{const x=parse("/calls/active",!0);let F;e&&(F=e.baseOptions);const O={method:"GET",...F,...K},I={},k={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;I["X-Webitel-Access"]=t}void 0!==t&&(k.page=t),void 0!==r&&(k.size=r),void 0!==i&&(k.q=i),void 0!==a&&(k.sort=a),n&&(k.fields=n),void 0!==s&&(k["created_at.from"]=s),void 0!==o&&(k["created_at.to"]=o),u&&(k.user_id=u),c&&(k.agent_id=c),l&&(k.queue_id=l),d&&(k.team_id=d),p&&(k.member_id=p),h&&(k.gateway_id=h),void 0!==y&&(k["duration.from"]=y),void 0!==g&&(k["duration.to"]=g),void 0!==A&&(k.skip_parent=A),void 0!==m&&(k.parent_id=m),f&&(k.cause=f),void 0!==w&&(k.exists_file=w),void 0!==b&&(k.domain_id=b),void 0!==S&&(k.number=S),q&&(k.direction=q),void 0!==v&&(k["answered_at.from"]=v),void 0!==C&&(k["answered_at.to"]=C),void 0!==R&&(k.missed=R),void 0!==P&&(k["stored_at.from"]=P),void 0!==T&&(k["stored_at.to"]=T),E&&(k.supervisor_id=E),_&&(k.state=_),x.query={...x.query,...k,...K.query},delete x.search;let B=F&&F.headers?F.headers:{};return O.headers={...I,...B,...K.headers},{url:format(x),options:O}},searchHistoryCall:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q,v,C,R,P,T,E,_,K,x,F,O,I,k,B,W,X,H,Q,U,L,M,j,G,N,D,V,J,z,$={})=>{const Y=parse("/calls/history",!0);let Z;e&&(Z=e.baseOptions);const ee={method:"GET",...Z,...$},te={},re={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;te["X-Webitel-Access"]=t}void 0!==t&&(re.page=t),void 0!==r&&(re.size=r),void 0!==i&&(re.q=i),void 0!==a&&(re.sort=a),n&&(re.fields=n),void 0!==s&&(re["created_at.from"]=s),void 0!==o&&(re["created_at.to"]=o),u&&(re.user_id=u),c&&(re.agent_id=c),l&&(re.queue_id=l),d&&(re.team_id=d),p&&(re.member_id=p),h&&(re.gateway_id=h),void 0!==y&&(re["duration.from"]=y),void 0!==g&&(re["duration.to"]=g),void 0!==A&&(re.skip_parent=A),void 0!==m&&(re.parent_id=m),f&&(re.cause=f),void 0!==w&&(re.has_file=w),void 0!==b&&(re.domain_id=b),void 0!==S&&(re.number=S),void 0!==q&&(re.direction=q),void 0!==v&&(re["answered_at.from"]=v),void 0!==C&&(re["answered_at.to"]=C),void 0!==R&&(re.missed=R),void 0!==P&&(re["stored_at.from"]=P),void 0!==T&&(re["stored_at.to"]=T),E&&(re.id=E),_&&(re.transfer_from=_),K&&(re.transfer_to=K),void 0!==x&&(re.dependency_id=x),F&&(re.tags=F),O&&(re.amd_result=O),void 0!==I&&(re.fts=I),k&&(re.directions=k),void 0!==B&&(re.has_transcript=B),void 0!==W&&(re.agent_description=W),X&&(re.owner_id=X),H&&(re.grantee_id=H),Q&&(re.amd_ai_result=Q),void 0!==U&&(re["talk.from"]=U),void 0!==L&&(re["talk.to"]=L),void 0!==M&&(re.rated=M),j&&(re.rated_by=j),void 0!==G&&(re["score_required.from"]=G),void 0!==N&&(re["score_required.to"]=N),void 0!==D&&(re["score_optional.from"]=D),void 0!==V&&(re["score_optional.to"]=V),J&&(re.rated_user=J),z&&(re.contact_id=z),Y.query={...Y.query,...re,...$.query},delete Y.search;let ie=Z&&Z.headers?Z.headers:{};return ee.headers={...te,...ie,...$.headers},{url:format(Y),options:ee}},searchHistoryCallPost:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling searchHistoryCallPost.");const i=parse("/calls/history",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},setVariablesCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling setVariablesCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling setVariablesCall.");const a="/calls/active/{id}/variables".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},unHoldCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling unHoldCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling unHoldCall.");const a="/calls/active/{id}/unhold".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},updateCallAnnotation:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("callId","Required parameter callId was null or undefined when calling updateCallAnnotation.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCallAnnotation.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateCallAnnotation.");const n="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},CallServiceApiFp=function(e){return{async aggregateHistoryCall(t,r){const i=await CallServiceApiAxiosParamCreator(e).aggregateHistoryCall(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async blindTransferCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).blindTransferCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async confirmPush(t,r){const i=await CallServiceApiAxiosParamCreator(e).confirmPush(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createCall(t,r){const i=await CallServiceApiAxiosParamCreator(e).createCall(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createCallAnnotation(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).createCallAnnotation(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteCallAnnotation(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).deleteCallAnnotation(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async dtmfCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).dtmfCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async eavesdropCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).eavesdropCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async hangupCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).hangupCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async holdCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).holdCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchHistoryCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).patchHistoryCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).readCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchActiveCall(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q,v,C,R,P,T,E,_,K){const x=await CallServiceApiAxiosParamCreator(e).searchActiveCall(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q,v,C,R,P,T,E,_,K);return(e=globalAxios,t=BASE_PATH)=>{const r={...x.options,url:t+x.url};return e.request(r)}},async searchHistoryCall(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q,v,C,R,P,T,E,_,K,x,F,O,I,k,B,W,X,H,Q,U,L,M,j,G,N,D,V,J,z,$){const Y=await CallServiceApiAxiosParamCreator(e).searchHistoryCall(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q,v,C,R,P,T,E,_,K,x,F,O,I,k,B,W,X,H,Q,U,L,M,j,G,N,D,V,J,z,$);return(e=globalAxios,t=BASE_PATH)=>{const r={...Y.options,url:t+Y.url};return e.request(r)}},async searchHistoryCallPost(t,r){const i=await CallServiceApiAxiosParamCreator(e).searchHistoryCallPost(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async setVariablesCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).setVariablesCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async unHoldCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).unHoldCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async updateCallAnnotation(t,r,i,a){const n=await CallServiceApiAxiosParamCreator(e).updateCallAnnotation(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},CallServiceApiFactory=function(e,t,r){return{aggregateHistoryCall:(i,a)=>CallServiceApiFp(e).aggregateHistoryCall(i,a).then(e=>e(r,t)),blindTransferCall:(i,a,n)=>CallServiceApiFp(e).blindTransferCall(i,a,n).then(e=>e(r,t)),confirmPush:(i,a)=>CallServiceApiFp(e).confirmPush(i,a).then(e=>e(r,t)),createCall:(i,a)=>CallServiceApiFp(e).createCall(i,a).then(e=>e(r,t)),createCallAnnotation:(i,a,n)=>CallServiceApiFp(e).createCallAnnotation(i,a,n).then(e=>e(r,t)),deleteCallAnnotation:(i,a,n)=>CallServiceApiFp(e).deleteCallAnnotation(i,a,n).then(e=>e(r,t)),dtmfCall:(i,a,n)=>CallServiceApiFp(e).dtmfCall(i,a,n).then(e=>e(r,t)),eavesdropCall:(i,a,n)=>CallServiceApiFp(e).eavesdropCall(i,a,n).then(e=>e(r,t)),hangupCall:(i,a,n)=>CallServiceApiFp(e).hangupCall(i,a,n).then(e=>e(r,t)),holdCall:(i,a,n)=>CallServiceApiFp(e).holdCall(i,a,n).then(e=>e(r,t)),patchHistoryCall:(i,a,n)=>CallServiceApiFp(e).patchHistoryCall(i,a,n).then(e=>e(r,t)),readCall:(i,a,n)=>CallServiceApiFp(e).readCall(i,a,n).then(e=>e(r,t)),searchActiveCall:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q,v,C,R,P,T,E,_,K,x,F)=>CallServiceApiFp(e).searchActiveCall(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q,v,C,R,P,T,E,_,K,x,F).then(e=>e(r,t)),searchHistoryCall:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q,v,C,R,P,T,E,_,K,x,F,O,I,k,B,W,X,H,Q,U,L,M,j,G,N,D,V,J,z,$,Y,Z)=>CallServiceApiFp(e).searchHistoryCall(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q,v,C,R,P,T,E,_,K,x,F,O,I,k,B,W,X,H,Q,U,L,M,j,G,N,D,V,J,z,$,Y,Z).then(e=>e(r,t)),searchHistoryCallPost:(i,a)=>CallServiceApiFp(e).searchHistoryCallPost(i,a).then(e=>e(r,t)),setVariablesCall:(i,a,n)=>CallServiceApiFp(e).setVariablesCall(i,a,n).then(e=>e(r,t)),unHoldCall:(i,a,n)=>CallServiceApiFp(e).unHoldCall(i,a,n).then(e=>e(r,t)),updateCallAnnotation:(i,a,n,s)=>CallServiceApiFp(e).updateCallAnnotation(i,a,n,s).then(e=>e(r,t))}};class CallServiceApi extends BaseAPI{aggregateHistoryCall(e,t){return CallServiceApiFp(this.configuration).aggregateHistoryCall(e,t).then(e=>e(this.axios,this.basePath))}blindTransferCall(e,t,r){return CallServiceApiFp(this.configuration).blindTransferCall(e,t,r).then(e=>e(this.axios,this.basePath))}confirmPush(e,t){return CallServiceApiFp(this.configuration).confirmPush(e,t).then(e=>e(this.axios,this.basePath))}createCall(e,t){return CallServiceApiFp(this.configuration).createCall(e,t).then(e=>e(this.axios,this.basePath))}createCallAnnotation(e,t,r){return CallServiceApiFp(this.configuration).createCallAnnotation(e,t,r).then(e=>e(this.axios,this.basePath))}deleteCallAnnotation(e,t,r){return CallServiceApiFp(this.configuration).deleteCallAnnotation(e,t,r).then(e=>e(this.axios,this.basePath))}dtmfCall(e,t,r){return CallServiceApiFp(this.configuration).dtmfCall(e,t,r).then(e=>e(this.axios,this.basePath))}eavesdropCall(e,t,r){return CallServiceApiFp(this.configuration).eavesdropCall(e,t,r).then(e=>e(this.axios,this.basePath))}hangupCall(e,t,r){return CallServiceApiFp(this.configuration).hangupCall(e,t,r).then(e=>e(this.axios,this.basePath))}holdCall(e,t,r){return CallServiceApiFp(this.configuration).holdCall(e,t,r).then(e=>e(this.axios,this.basePath))}patchHistoryCall(e,t,r){return CallServiceApiFp(this.configuration).patchHistoryCall(e,t,r).then(e=>e(this.axios,this.basePath))}readCall(e,t,r){return CallServiceApiFp(this.configuration).readCall(e,t,r).then(e=>e(this.axios,this.basePath))}searchActiveCall(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q,v,C,R,P,T,E,_){return CallServiceApiFp(this.configuration).searchActiveCall(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q,v,C,R,P,T,E,_).then(e=>e(this.axios,this.basePath))}searchHistoryCall(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q,v,C,R,P,T,E,_,K,x,F,O,I,k,B,W,X,H,Q,U,L,M,j,G,N,D,V,J,z){return CallServiceApiFp(this.configuration).searchHistoryCall(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q,v,C,R,P,T,E,_,K,x,F,O,I,k,B,W,X,H,Q,U,L,M,j,G,N,D,V,J,z).then(e=>e(this.axios,this.basePath))}searchHistoryCallPost(e,t){return CallServiceApiFp(this.configuration).searchHistoryCallPost(e,t).then(e=>e(this.axios,this.basePath))}setVariablesCall(e,t,r){return CallServiceApiFp(this.configuration).setVariablesCall(e,t,r).then(e=>e(this.axios,this.basePath))}unHoldCall(e,t,r){return CallServiceApiFp(this.configuration).unHoldCall(e,t,r).then(e=>e(this.axios,this.basePath))}updateCallAnnotation(e,t,r,i){return CallServiceApiFp(this.configuration).updateCallAnnotation(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const CatalogApiAxiosParamCreator=function(e){return{getCustomers:async(t,r,i,a,n,s,o,u,c,l,d={})=>{const p=parse("/chat/customers",!0);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...d},g={},A={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==t&&(A.page=t),void 0!==r&&(A.size=r),void 0!==i&&(A.q=i),a&&(A.sort=a),n&&(A.fields=n),s&&(A.id=s),void 0!==o&&(A.type=o),void 0!==u&&(A["via.id"]=u),void 0!==c&&(A["via.type"]=c),void 0!==l&&(A["via.name"]=l),p.query={...p.query,...A,...d.query},delete p.search;let m=h&&h.headers?h.headers:{};return y.headers={...g,...m,...d.headers},{url:format(p),options:y}},getDialogs:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A={})=>{const m=parse("/chat/dialogs",!0);let f;e&&(f=e.baseOptions);const w={method:"GET",...f,...A},b={},S={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;b["X-Webitel-Access"]=t}void 0!==t&&(S.page=t),void 0!==r&&(S.size=r),void 0!==i&&(S.q=i),a&&(S.sort=a),n&&(S.fields=n),s&&(S.id=s),void 0!==o&&(S["via.id"]=o),void 0!==u&&(S["via.type"]=u),void 0!==c&&(S["via.name"]=c),void 0!==l&&(S["peer.id"]=l),void 0!==d&&(S["peer.type"]=d),void 0!==p&&(S["peer.name"]=p),void 0!==h&&(S["date.since"]=h),void 0!==y&&(S["date.until"]=y),void 0!==g&&(S.online=g),m.query={...m.query,...S,...A.query},delete m.search;let q=f&&f.headers?f.headers:{};return w.headers={...b,...q,...A.headers},{url:format(m),options:w}},getHistory:async(t,r,i,a,n,s,o,u,c,l={})=>{if(null==t)throw new RequiredError("chatId","Required parameter chatId was null or undefined when calling getHistory.");const d="/chat/dialogs/{chat_id}/messages".replace("{chat_id}",encodeURIComponent(String(t))),p=parse(d,!0);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...l},g={},A={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==r&&(A["offset.id"]=r),void 0!==i&&(A["offset.date"]=i),void 0!==a&&(A.limit=a),void 0!==n&&(A.q=n),s&&(A.fields=s),void 0!==o&&(A["peer.id"]=o),void 0!==u&&(A["peer.type"]=u),void 0!==c&&(A["peer.name"]=c),p.query={...p.query,...A,...l.query},delete p.search;let m=h&&h.headers?h.headers:{};return y.headers={...g,...m,...l.headers},{url:format(p),options:y}},getHistory2:async(t,r,i,a,n,s,o,u,c,l={})=>{if(null==t)throw new RequiredError("peerType","Required parameter peerType was null or undefined when calling getHistory2.");if(null==r)throw new RequiredError("peerId","Required parameter peerId was null or undefined when calling getHistory2.");const d="/chat/{peer.type}/{peer.id}/messages".replace("{peer.type}",encodeURIComponent(String(t))).replace("{peer.id}",encodeURIComponent(String(r))),p=parse(d,!0);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...l},g={},A={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==i&&(A["offset.id"]=i),void 0!==a&&(A["offset.date"]=a),void 0!==n&&(A.limit=n),void 0!==s&&(A.q=s),o&&(A.fields=o),void 0!==u&&(A.chat_id=u),void 0!==c&&(A["peer.name"]=c),p.query={...p.query,...A,...l.query},delete p.search;let m=h&&h.headers?h.headers:{};return y.headers={...g,...m,...l.headers},{url:format(p),options:y}},getMembers:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f={})=>{if(null==t)throw new RequiredError("chatId","Required parameter chatId was null or undefined when calling getMembers.");const w="/chat/dialogs/{chat_id}/members".replace("{chat_id}",encodeURIComponent(String(t))),b=parse(w,!0);let S;e&&(S=e.baseOptions);const q={method:"GET",...S,...f},v={},C={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;v["X-Webitel-Access"]=t}void 0!==r&&(C.page=r),void 0!==i&&(C.size=i),void 0!==a&&(C.q=a),n&&(C.sort=n),s&&(C.fields=s),o&&(C.id=o),void 0!==u&&(C["via.id"]=u),void 0!==c&&(C["via.type"]=c),void 0!==l&&(C["via.name"]=l),void 0!==d&&(C["peer.id"]=d),void 0!==p&&(C["peer.type"]=p),void 0!==h&&(C["peer.name"]=h),void 0!==y&&(C["date.since"]=y),void 0!==g&&(C["date.until"]=g),void 0!==A&&(C.online=A),void 0!==m&&(C.joined=m),b.query={...b.query,...C,...f.query},delete b.search;let R=S&&S.headers?S.headers:{};return q.headers={...v,...R,...f.headers},{url:format(b),options:q}}}},CatalogApiFp=function(e){return{async getCustomers(t,r,i,a,n,s,o,u,c,l,d){const p=await CatalogApiAxiosParamCreator(e).getCustomers(t,r,i,a,n,s,o,u,c,l,d);return(e=globalAxios,t=BASE_PATH)=>{const r={...p.options,url:t+p.url};return e.request(r)}},async getDialogs(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A){const m=await CatalogApiAxiosParamCreator(e).getDialogs(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A);return(e=globalAxios,t=BASE_PATH)=>{const r={...m.options,url:t+m.url};return e.request(r)}},async getHistory(t,r,i,a,n,s,o,u,c,l){const d=await CatalogApiAxiosParamCreator(e).getHistory(t,r,i,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async getHistory2(t,r,i,a,n,s,o,u,c,l){const d=await CatalogApiAxiosParamCreator(e).getHistory2(t,r,i,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async getMembers(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f){const w=await CatalogApiAxiosParamCreator(e).getMembers(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f);return(e=globalAxios,t=BASE_PATH)=>{const r={...w.options,url:t+w.url};return e.request(r)}}}},CatalogApiFactory=function(e,t,r){return{getCustomers:(i,a,n,s,o,u,c,l,d,p,h)=>CatalogApiFp(e).getCustomers(i,a,n,s,o,u,c,l,d,p,h).then(e=>e(r,t)),getDialogs:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f)=>CatalogApiFp(e).getDialogs(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f).then(e=>e(r,t)),getHistory:(i,a,n,s,o,u,c,l,d,p)=>CatalogApiFp(e).getHistory(i,a,n,s,o,u,c,l,d,p).then(e=>e(r,t)),getHistory2:(i,a,n,s,o,u,c,l,d,p)=>CatalogApiFp(e).getHistory2(i,a,n,s,o,u,c,l,d,p).then(e=>e(r,t)),getMembers:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b)=>CatalogApiFp(e).getMembers(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b).then(e=>e(r,t))}};class CatalogApi extends BaseAPI{getCustomers(e,t,r,i,a,n,s,o,u,c,l){return CatalogApiFp(this.configuration).getCustomers(e,t,r,i,a,n,s,o,u,c,l).then(e=>e(this.axios,this.basePath))}getDialogs(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g){return CatalogApiFp(this.configuration).getDialogs(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g).then(e=>e(this.axios,this.basePath))}getHistory(e,t,r,i,a,n,s,o,u,c){return CatalogApiFp(this.configuration).getHistory(e,t,r,i,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}getHistory2(e,t,r,i,a,n,s,o,u,c){return CatalogApiFp(this.configuration).getHistory2(e,t,r,i,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}getMembers(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m){return CatalogApiFp(this.configuration).getMembers(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m).then(e=>e(this.axios,this.basePath))}}const ChatHelperServiceApiAxiosParamCreator=function(e){return{broadcast:async(t,r,i={})=>{if(null==t)throw new RequiredError("profileId","Required parameter profileId was null or undefined when calling broadcast.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling broadcast.");const a="/chat/bots/{profile_id}/broadcast".replace("{profile_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},ChatHelperServiceApiFp=function(e){return{async broadcast(t,r,i){const a=await ChatHelperServiceApiAxiosParamCreator(e).broadcast(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},ChatHelperServiceApiFactory=function(e,t,r){return{broadcast:(i,a,n)=>ChatHelperServiceApiFp(e).broadcast(i,a,n).then(e=>e(r,t))}};class ChatHelperServiceApi extends BaseAPI{broadcast(e,t,r){return ChatHelperServiceApiFp(this.configuration).broadcast(e,t,r).then(e=>e(this.axios,this.basePath))}}const CognitiveProfileServiceApiAxiosParamCreator=function(e){return{createCognitiveProfile:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCognitiveProfile.");const i=parse("/storage/cognitive_profiles",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteCognitiveProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteCognitiveProfile.");const i="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchCognitiveProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchCognitiveProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchCognitiveProfile.");const a="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readCognitiveProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readCognitiveProfile.");const i="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchCognitiveProfile:async(t,r,i,a,n,s,o,u,c={})=>{const l=parse("/storage/cognitive_profiles",!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==t&&(y.page=t),void 0!==r&&(y.size=r),void 0!==i&&(y.q=i),void 0!==a&&(y.sort=a),n&&(y.fields=n),s&&(y.id=s),o&&(y.service=o),void 0!==u&&(y.enabled=u),l.query={...l.query,...y,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},updateCognitiveProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCognitiveProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateCognitiveProfile.");const a="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},CognitiveProfileServiceApiFp=function(e){return{async createCognitiveProfile(t,r){const i=await CognitiveProfileServiceApiAxiosParamCreator(e).createCognitiveProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteCognitiveProfile(t,r){const i=await CognitiveProfileServiceApiAxiosParamCreator(e).deleteCognitiveProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchCognitiveProfile(t,r,i){const a=await CognitiveProfileServiceApiAxiosParamCreator(e).patchCognitiveProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readCognitiveProfile(t,r){const i=await CognitiveProfileServiceApiAxiosParamCreator(e).readCognitiveProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchCognitiveProfile(t,r,i,a,n,s,o,u,c){const l=await CognitiveProfileServiceApiAxiosParamCreator(e).searchCognitiveProfile(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async updateCognitiveProfile(t,r,i){const a=await CognitiveProfileServiceApiAxiosParamCreator(e).updateCognitiveProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},CognitiveProfileServiceApiFactory=function(e,t,r){return{createCognitiveProfile:(i,a)=>CognitiveProfileServiceApiFp(e).createCognitiveProfile(i,a).then(e=>e(r,t)),deleteCognitiveProfile:(i,a)=>CognitiveProfileServiceApiFp(e).deleteCognitiveProfile(i,a).then(e=>e(r,t)),patchCognitiveProfile:(i,a,n)=>CognitiveProfileServiceApiFp(e).patchCognitiveProfile(i,a,n).then(e=>e(r,t)),readCognitiveProfile:(i,a)=>CognitiveProfileServiceApiFp(e).readCognitiveProfile(i,a).then(e=>e(r,t)),searchCognitiveProfile:(i,a,n,s,o,u,c,l,d)=>CognitiveProfileServiceApiFp(e).searchCognitiveProfile(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),updateCognitiveProfile:(i,a,n)=>CognitiveProfileServiceApiFp(e).updateCognitiveProfile(i,a,n).then(e=>e(r,t))}};class CognitiveProfileServiceApi extends BaseAPI{createCognitiveProfile(e,t){return CognitiveProfileServiceApiFp(this.configuration).createCognitiveProfile(e,t).then(e=>e(this.axios,this.basePath))}deleteCognitiveProfile(e,t){return CognitiveProfileServiceApiFp(this.configuration).deleteCognitiveProfile(e,t).then(e=>e(this.axios,this.basePath))}patchCognitiveProfile(e,t,r){return CognitiveProfileServiceApiFp(this.configuration).patchCognitiveProfile(e,t,r).then(e=>e(this.axios,this.basePath))}readCognitiveProfile(e,t){return CognitiveProfileServiceApiFp(this.configuration).readCognitiveProfile(e,t).then(e=>e(this.axios,this.basePath))}searchCognitiveProfile(e,t,r,i,a,n,s,o,u){return CognitiveProfileServiceApiFp(this.configuration).searchCognitiveProfile(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateCognitiveProfile(e,t,r){return CognitiveProfileServiceApiFp(this.configuration).updateCognitiveProfile(e,t,r).then(e=>e(this.axios,this.basePath))}}const CommunicationTypeServiceApiAxiosParamCreator=function(e){return{createCommunicationType:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCommunicationType.");const i=parse("/call_center/communication_type",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteCommunicationType:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteCommunicationType.");const a="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readCommunicationType:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readCommunicationType.");const a="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchCommunicationType:async(t,r,i,a,n,s,o,u={})=>{const c=parse("/call_center/communication_type",!0);let l;e&&(l=e.baseOptions);const d={method:"GET",...l,...u},p={},h={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;p["X-Webitel-Access"]=t}void 0!==t&&(h.page=t),void 0!==r&&(h.size=r),void 0!==i&&(h.q=i),void 0!==a&&(h.sort=a),n&&(h.fields=n),s&&(h.id=s),o&&(h.channel=o),c.query={...c.query,...h,...u.query},delete c.search;let y=l&&l.headers?l.headers:{};return d.headers={...p,...y,...u.headers},{url:format(c),options:d}},updateCommunicationType:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCommunicationType.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateCommunicationType.");const a="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},CommunicationTypeServiceApiFp=function(e){return{async createCommunicationType(t,r){const i=await CommunicationTypeServiceApiAxiosParamCreator(e).createCommunicationType(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteCommunicationType(t,r,i){const a=await CommunicationTypeServiceApiAxiosParamCreator(e).deleteCommunicationType(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readCommunicationType(t,r,i){const a=await CommunicationTypeServiceApiAxiosParamCreator(e).readCommunicationType(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchCommunicationType(t,r,i,a,n,s,o,u){const c=await CommunicationTypeServiceApiAxiosParamCreator(e).searchCommunicationType(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async updateCommunicationType(t,r,i){const a=await CommunicationTypeServiceApiAxiosParamCreator(e).updateCommunicationType(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},CommunicationTypeServiceApiFactory=function(e,t,r){return{createCommunicationType:(i,a)=>CommunicationTypeServiceApiFp(e).createCommunicationType(i,a).then(e=>e(r,t)),deleteCommunicationType:(i,a,n)=>CommunicationTypeServiceApiFp(e).deleteCommunicationType(i,a,n).then(e=>e(r,t)),readCommunicationType:(i,a,n)=>CommunicationTypeServiceApiFp(e).readCommunicationType(i,a,n).then(e=>e(r,t)),searchCommunicationType:(i,a,n,s,o,u,c,l)=>CommunicationTypeServiceApiFp(e).searchCommunicationType(i,a,n,s,o,u,c,l).then(e=>e(r,t)),updateCommunicationType:(i,a,n)=>CommunicationTypeServiceApiFp(e).updateCommunicationType(i,a,n).then(e=>e(r,t))}};class CommunicationTypeServiceApi extends BaseAPI{createCommunicationType(e,t){return CommunicationTypeServiceApiFp(this.configuration).createCommunicationType(e,t).then(e=>e(this.axios,this.basePath))}deleteCommunicationType(e,t,r){return CommunicationTypeServiceApiFp(this.configuration).deleteCommunicationType(e,t,r).then(e=>e(this.axios,this.basePath))}readCommunicationType(e,t,r){return CommunicationTypeServiceApiFp(this.configuration).readCommunicationType(e,t,r).then(e=>e(this.axios,this.basePath))}searchCommunicationType(e,t,r,i,a,n,s,o){return CommunicationTypeServiceApiFp(this.configuration).searchCommunicationType(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateCommunicationType(e,t,r){return CommunicationTypeServiceApiFp(this.configuration).updateCommunicationType(e,t,r).then(e=>e(this.axios,this.basePath))}}const ConfigServiceApiAxiosParamCreator=function(e){return{createConfig:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createConfig.");const i=parse("/logger/config",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteConfig:async(t,r={})=>{if(null==t)throw new RequiredError("configId","Required parameter configId was null or undefined when calling deleteConfig.");const i="/logger/config/{config_id}".replace("{config_id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},deleteConfigBulk:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling deleteConfigBulk.");const i=parse("/logger/config",!0);let a;e&&(a=e.baseOptions);const n={method:"DELETE",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},patchConfig:async(t,r,i={})=>{if(null==t)throw new RequiredError("configId","Required parameter configId was null or undefined when calling patchConfig.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchConfig.");const a="/logger/config/{config_id}".replace("{config_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readConfig:async(t,r={})=>{if(null==t)throw new RequiredError("configId","Required parameter configId was null or undefined when calling readConfig.");const i="/logger/config/{config_id}".replace("{config_id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},readSystemObjects:async(t,r={})=>{const i=parse("/logger/available_objects",!0);let a;e&&(a=e.baseOptions);const n={method:"GET",...a,...r},s={},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}void 0!==t&&(o.include_existing=t),i.query={...i.query,...o,...r.query},delete i.search;let u=a&&a.headers?a.headers:{};return n.headers={...s,...u,...r.headers},{url:format(i),options:n}},searchConfig:async(t,r,i,a,n,s,o={})=>{const u=parse("/logger/config",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.object=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateConfig:async(t,r,i={})=>{if(null==t)throw new RequiredError("configId","Required parameter configId was null or undefined when calling updateConfig.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateConfig.");const a="/logger/config/{config_id}".replace("{config_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},ConfigServiceApiFp=function(e){return{async createConfig(t,r){const i=await ConfigServiceApiAxiosParamCreator(e).createConfig(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteConfig(t,r){const i=await ConfigServiceApiAxiosParamCreator(e).deleteConfig(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteConfigBulk(t,r){const i=await ConfigServiceApiAxiosParamCreator(e).deleteConfigBulk(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchConfig(t,r,i){const a=await ConfigServiceApiAxiosParamCreator(e).patchConfig(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readConfig(t,r){const i=await ConfigServiceApiAxiosParamCreator(e).readConfig(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async readSystemObjects(t,r){const i=await ConfigServiceApiAxiosParamCreator(e).readSystemObjects(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchConfig(t,r,i,a,n,s,o){const u=await ConfigServiceApiAxiosParamCreator(e).searchConfig(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateConfig(t,r,i){const a=await ConfigServiceApiAxiosParamCreator(e).updateConfig(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},ConfigServiceApiFactory=function(e,t,r){return{createConfig:(i,a)=>ConfigServiceApiFp(e).createConfig(i,a).then(e=>e(r,t)),deleteConfig:(i,a)=>ConfigServiceApiFp(e).deleteConfig(i,a).then(e=>e(r,t)),deleteConfigBulk:(i,a)=>ConfigServiceApiFp(e).deleteConfigBulk(i,a).then(e=>e(r,t)),patchConfig:(i,a,n)=>ConfigServiceApiFp(e).patchConfig(i,a,n).then(e=>e(r,t)),readConfig:(i,a)=>ConfigServiceApiFp(e).readConfig(i,a).then(e=>e(r,t)),readSystemObjects:(i,a)=>ConfigServiceApiFp(e).readSystemObjects(i,a).then(e=>e(r,t)),searchConfig:(i,a,n,s,o,u,c)=>ConfigServiceApiFp(e).searchConfig(i,a,n,s,o,u,c).then(e=>e(r,t)),updateConfig:(i,a,n)=>ConfigServiceApiFp(e).updateConfig(i,a,n).then(e=>e(r,t))}};class ConfigServiceApi extends BaseAPI{createConfig(e,t){return ConfigServiceApiFp(this.configuration).createConfig(e,t).then(e=>e(this.axios,this.basePath))}deleteConfig(e,t){return ConfigServiceApiFp(this.configuration).deleteConfig(e,t).then(e=>e(this.axios,this.basePath))}deleteConfigBulk(e,t){return ConfigServiceApiFp(this.configuration).deleteConfigBulk(e,t).then(e=>e(this.axios,this.basePath))}patchConfig(e,t,r){return ConfigServiceApiFp(this.configuration).patchConfig(e,t,r).then(e=>e(this.axios,this.basePath))}readConfig(e,t){return ConfigServiceApiFp(this.configuration).readConfig(e,t).then(e=>e(this.axios,this.basePath))}readSystemObjects(e,t){return ConfigServiceApiFp(this.configuration).readSystemObjects(e,t).then(e=>e(this.axios,this.basePath))}searchConfig(e,t,r,i,a,n,s){return ConfigServiceApiFp(this.configuration).searchConfig(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateConfig(e,t,r){return ConfigServiceApiFp(this.configuration).updateConfig(e,t,r).then(e=>e(this.axios,this.basePath))}}const ContactsApiAxiosParamCreator=function(e){return{createContact:async(t,r,i={})=>{if(null==t)throw new RequiredError("input","Required parameter input was null or undefined when calling createContact.");const a=parse("/contacts",!0);let n;e&&(n=e.baseOptions);const s={method:"POST",...n,...i},o={},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}r&&(u.fields=r),o["Content-Type"]="application/json",a.query={...a.query,...u,...i.query},delete a.search;let c=n&&n.headers?n.headers:{};s.headers={...o,...c,...i.headers};const l="string"!=typeof t||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(a),options:s}},deleteContact:async(t,r,i={})=>{if(null==t)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteContact.");const a="/contacts/{etag}".replace("{etag}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}r&&(c.fields=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},locateContact:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("etag","Required parameter etag was null or undefined when calling locateContact.");const n="/contacts/{etag}".replace("{etag}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}r&&(l.fields=r),void 0!==i&&(l.mode=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchContacts:async(t,r,i,a,n,s,o,u,c={})=>{const l=parse("/contacts",!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==t&&(y.page=t),void 0!==r&&(y.size=r),void 0!==i&&(y.q=i),a&&(y.sort=a),n&&(y.fields=n),s&&(y.id=s),o&&(y.qin=o),void 0!==u&&(y.mode=u),l.query={...l.query,...y,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},updateContact:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updateContact.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling updateContact.");const n="/contacts/{etag}".replace("{etag}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},ContactsApiFp=function(e){return{async createContact(t,r,i){const a=await ContactsApiAxiosParamCreator(e).createContact(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteContact(t,r,i){const a=await ContactsApiAxiosParamCreator(e).deleteContact(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async locateContact(t,r,i,a){const n=await ContactsApiAxiosParamCreator(e).locateContact(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchContacts(t,r,i,a,n,s,o,u,c){const l=await ContactsApiAxiosParamCreator(e).searchContacts(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async updateContact(t,r,i,a){const n=await ContactsApiAxiosParamCreator(e).updateContact(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},ContactsApiFactory=function(e,t,r){return{createContact:(i,a,n)=>ContactsApiFp(e).createContact(i,a,n).then(e=>e(r,t)),deleteContact:(i,a,n)=>ContactsApiFp(e).deleteContact(i,a,n).then(e=>e(r,t)),locateContact:(i,a,n,s)=>ContactsApiFp(e).locateContact(i,a,n,s).then(e=>e(r,t)),searchContacts:(i,a,n,s,o,u,c,l,d)=>ContactsApiFp(e).searchContacts(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),updateContact:(i,a,n,s)=>ContactsApiFp(e).updateContact(i,a,n,s).then(e=>e(r,t))}};class ContactsApi extends BaseAPI{createContact(e,t,r){return ContactsApiFp(this.configuration).createContact(e,t,r).then(e=>e(this.axios,this.basePath))}deleteContact(e,t,r){return ContactsApiFp(this.configuration).deleteContact(e,t,r).then(e=>e(this.axios,this.basePath))}locateContact(e,t,r,i){return ContactsApiFp(this.configuration).locateContact(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchContacts(e,t,r,i,a,n,s,o,u){return ContactsApiFp(this.configuration).searchContacts(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateContact(e,t,r,i){return ContactsApiFp(this.configuration).updateContact(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const EmailProfileServiceApiAxiosParamCreator=function(e){return{createEmailProfile:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createEmailProfile.");const i=parse("/email/profile",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteEmailProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteEmailProfile.");const i="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},loginEmailProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling loginEmailProfile.");const i="/email/profile/{id}/login".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchEmailProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchEmailProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchEmailProfile.");const a="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readEmailProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readEmailProfile.");const i="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchEmailProfile:async(t,r,i,a,n,s={})=>{const o=parse("/email/profile",!0);let u;e&&(u=e.baseOptions);const c={method:"GET",...u,...s},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}void 0!==t&&(d.page=t),void 0!==r&&(d.size=r),void 0!==i&&(d.q=i),void 0!==a&&(d.sort=a),n&&(d.fields=n),o.query={...o.query,...d,...s.query},delete o.search;let p=u&&u.headers?u.headers:{};return c.headers={...l,...p,...s.headers},{url:format(o),options:c}},testEmailProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling testEmailProfile.");const i="/email/profile/{id}/test".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},updateEmailProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateEmailProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateEmailProfile.");const a="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},EmailProfileServiceApiFp=function(e){return{async createEmailProfile(t,r){const i=await EmailProfileServiceApiAxiosParamCreator(e).createEmailProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteEmailProfile(t,r){const i=await EmailProfileServiceApiAxiosParamCreator(e).deleteEmailProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async loginEmailProfile(t,r){const i=await EmailProfileServiceApiAxiosParamCreator(e).loginEmailProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchEmailProfile(t,r,i){const a=await EmailProfileServiceApiAxiosParamCreator(e).patchEmailProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readEmailProfile(t,r){const i=await EmailProfileServiceApiAxiosParamCreator(e).readEmailProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchEmailProfile(t,r,i,a,n,s){const o=await EmailProfileServiceApiAxiosParamCreator(e).searchEmailProfile(t,r,i,a,n,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...o.options,url:t+o.url};return e.request(r)}},async testEmailProfile(t,r){const i=await EmailProfileServiceApiAxiosParamCreator(e).testEmailProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async updateEmailProfile(t,r,i){const a=await EmailProfileServiceApiAxiosParamCreator(e).updateEmailProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},EmailProfileServiceApiFactory=function(e,t,r){return{createEmailProfile:(i,a)=>EmailProfileServiceApiFp(e).createEmailProfile(i,a).then(e=>e(r,t)),deleteEmailProfile:(i,a)=>EmailProfileServiceApiFp(e).deleteEmailProfile(i,a).then(e=>e(r,t)),loginEmailProfile:(i,a)=>EmailProfileServiceApiFp(e).loginEmailProfile(i,a).then(e=>e(r,t)),patchEmailProfile:(i,a,n)=>EmailProfileServiceApiFp(e).patchEmailProfile(i,a,n).then(e=>e(r,t)),readEmailProfile:(i,a)=>EmailProfileServiceApiFp(e).readEmailProfile(i,a).then(e=>e(r,t)),searchEmailProfile:(i,a,n,s,o,u)=>EmailProfileServiceApiFp(e).searchEmailProfile(i,a,n,s,o,u).then(e=>e(r,t)),testEmailProfile:(i,a)=>EmailProfileServiceApiFp(e).testEmailProfile(i,a).then(e=>e(r,t)),updateEmailProfile:(i,a,n)=>EmailProfileServiceApiFp(e).updateEmailProfile(i,a,n).then(e=>e(r,t))}};class EmailProfileServiceApi extends BaseAPI{createEmailProfile(e,t){return EmailProfileServiceApiFp(this.configuration).createEmailProfile(e,t).then(e=>e(this.axios,this.basePath))}deleteEmailProfile(e,t){return EmailProfileServiceApiFp(this.configuration).deleteEmailProfile(e,t).then(e=>e(this.axios,this.basePath))}loginEmailProfile(e,t){return EmailProfileServiceApiFp(this.configuration).loginEmailProfile(e,t).then(e=>e(this.axios,this.basePath))}patchEmailProfile(e,t,r){return EmailProfileServiceApiFp(this.configuration).patchEmailProfile(e,t,r).then(e=>e(this.axios,this.basePath))}readEmailProfile(e,t){return EmailProfileServiceApiFp(this.configuration).readEmailProfile(e,t).then(e=>e(this.axios,this.basePath))}searchEmailProfile(e,t,r,i,a,n){return EmailProfileServiceApiFp(this.configuration).searchEmailProfile(e,t,r,i,a,n).then(e=>e(this.axios,this.basePath))}testEmailProfile(e,t){return EmailProfileServiceApiFp(this.configuration).testEmailProfile(e,t).then(e=>e(this.axios,this.basePath))}updateEmailProfile(e,t,r){return EmailProfileServiceApiFp(this.configuration).updateEmailProfile(e,t,r).then(e=>e(this.axios,this.basePath))}}const EmailsApiAxiosParamCreator=function(e){return{deleteEmail:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deleteEmail.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteEmail.");const n="/contacts/{contact_id}/emails/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},deleteEmails:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deleteEmails.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteEmails.");const n="/contacts/{contact_id}/emails".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),r&&(l.etag=r),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},listEmails:async(t,r,i,a,n,s,o,u,c,l,d,p,h={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling listEmails.");const y="/contacts/{contact_id}/emails".replace("{contact_id}",encodeURIComponent(String(t))),g=parse(y,!0);let A;e&&(A=e.baseOptions);const m={method:"GET",...A,...h},f={},w={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;f["X-Webitel-Access"]=t}void 0!==r&&(w.page=r),void 0!==i&&(w.size=i),void 0!==a&&(w.q=a),n&&(w.sort=n),s&&(w.fields=s),o&&(w.id=o),void 0!==u&&(w.primary=u),void 0!==c&&(w.verified=c),void 0!==l&&(w["type.id"]=l),void 0!==d&&(w["type.type"]=d),void 0!==p&&(w["type.name"]=p),g.query={...g.query,...w,...h.query},delete g.search;let b=A&&A.headers?A.headers:{};return m.headers={...f,...b,...h.headers},{url:format(g),options:m}},locateEmail:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling locateEmail.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling locateEmail.");const n="/contacts/{contact_id}/emails/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},mergeEmails:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling mergeEmails.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling mergeEmails.");const n="/contacts/{contact_id}/emails".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"POST",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},resetEmails:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling resetEmails.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling resetEmails.");const n="/contacts/{contact_id}/emails".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},updateEmail:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updateEmail.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updateEmail.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updateEmail.");const s="/contacts/{contact_id}/emails/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PUT",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}},updateEmail2:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updateEmail2.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updateEmail2.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updateEmail2.");const s="/contacts/{contact_id}/emails/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PATCH",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},EmailsApiFp=function(e){return{async deleteEmail(t,r,i,a){const n=await EmailsApiAxiosParamCreator(e).deleteEmail(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async deleteEmails(t,r,i,a){const n=await EmailsApiAxiosParamCreator(e).deleteEmails(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async listEmails(t,r,i,a,n,s,o,u,c,l,d,p,h){const y=await EmailsApiAxiosParamCreator(e).listEmails(t,r,i,a,n,s,o,u,c,l,d,p,h);return(e=globalAxios,t=BASE_PATH)=>{const r={...y.options,url:t+y.url};return e.request(r)}},async locateEmail(t,r,i,a){const n=await EmailsApiAxiosParamCreator(e).locateEmail(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async mergeEmails(t,r,i,a){const n=await EmailsApiAxiosParamCreator(e).mergeEmails(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async resetEmails(t,r,i,a){const n=await EmailsApiAxiosParamCreator(e).resetEmails(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async updateEmail(t,r,i,a,n){const s=await EmailsApiAxiosParamCreator(e).updateEmail(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async updateEmail2(t,r,i,a,n){const s=await EmailsApiAxiosParamCreator(e).updateEmail2(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}}}},EmailsApiFactory=function(e,t,r){return{deleteEmail:(i,a,n,s)=>EmailsApiFp(e).deleteEmail(i,a,n,s).then(e=>e(r,t)),deleteEmails:(i,a,n,s)=>EmailsApiFp(e).deleteEmails(i,a,n,s).then(e=>e(r,t)),listEmails:(i,a,n,s,o,u,c,l,d,p,h,y,g)=>EmailsApiFp(e).listEmails(i,a,n,s,o,u,c,l,d,p,h,y,g).then(e=>e(r,t)),locateEmail:(i,a,n,s)=>EmailsApiFp(e).locateEmail(i,a,n,s).then(e=>e(r,t)),mergeEmails:(i,a,n,s)=>EmailsApiFp(e).mergeEmails(i,a,n,s).then(e=>e(r,t)),resetEmails:(i,a,n,s)=>EmailsApiFp(e).resetEmails(i,a,n,s).then(e=>e(r,t)),updateEmail:(i,a,n,s,o)=>EmailsApiFp(e).updateEmail(i,a,n,s,o).then(e=>e(r,t)),updateEmail2:(i,a,n,s,o)=>EmailsApiFp(e).updateEmail2(i,a,n,s,o).then(e=>e(r,t))}};class EmailsApi extends BaseAPI{deleteEmail(e,t,r,i){return EmailsApiFp(this.configuration).deleteEmail(e,t,r,i).then(e=>e(this.axios,this.basePath))}deleteEmails(e,t,r,i){return EmailsApiFp(this.configuration).deleteEmails(e,t,r,i).then(e=>e(this.axios,this.basePath))}listEmails(e,t,r,i,a,n,s,o,u,c,l,d,p){return EmailsApiFp(this.configuration).listEmails(e,t,r,i,a,n,s,o,u,c,l,d,p).then(e=>e(this.axios,this.basePath))}locateEmail(e,t,r,i){return EmailsApiFp(this.configuration).locateEmail(e,t,r,i).then(e=>e(this.axios,this.basePath))}mergeEmails(e,t,r,i){return EmailsApiFp(this.configuration).mergeEmails(e,t,r,i).then(e=>e(this.axios,this.basePath))}resetEmails(e,t,r,i){return EmailsApiFp(this.configuration).resetEmails(e,t,r,i).then(e=>e(this.axios,this.basePath))}updateEmail(e,t,r,i,a){return EmailsApiFp(this.configuration).updateEmail(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}updateEmail2(e,t,r,i,a){return EmailsApiFp(this.configuration).updateEmail2(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}}const FileServiceApiAxiosParamCreator=function(e){return{deleteFiles:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling deleteFiles.");const i=parse("/storage/file",!0);let a;e&&(a=e.baseOptions);const n={method:"DELETE",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}}}},FileServiceApiFp=function(e){return{async deleteFiles(t,r){const i=await FileServiceApiAxiosParamCreator(e).deleteFiles(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}}}},FileServiceApiFactory=function(e,t,r){return{deleteFiles:(i,a)=>FileServiceApiFp(e).deleteFiles(i,a).then(e=>e(r,t))}};class FileServiceApi extends BaseAPI{deleteFiles(e,t){return FileServiceApiFp(this.configuration).deleteFiles(e,t).then(e=>e(this.axios,this.basePath))}}const FileTranscriptServiceApiAxiosParamCreator=function(e){return{createFileTranscript:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createFileTranscript.");const i=parse("/storage/transcript_file",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteFileTranscript:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling deleteFileTranscript.");const i=parse("/storage/transcript_file",!0);let a;e&&(a=e.baseOptions);const n={method:"DELETE",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},getFileTranscriptPhrases:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling getFileTranscriptPhrases.");const n="/storage/transcript_file/{id}/phrases".replace("{id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==r&&(l.page=r),void 0!==i&&(l.size=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}}}},FileTranscriptServiceApiFp=function(e){return{async createFileTranscript(t,r){const i=await FileTranscriptServiceApiAxiosParamCreator(e).createFileTranscript(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteFileTranscript(t,r){const i=await FileTranscriptServiceApiAxiosParamCreator(e).deleteFileTranscript(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async getFileTranscriptPhrases(t,r,i,a){const n=await FileTranscriptServiceApiAxiosParamCreator(e).getFileTranscriptPhrases(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},FileTranscriptServiceApiFactory=function(e,t,r){return{createFileTranscript:(i,a)=>FileTranscriptServiceApiFp(e).createFileTranscript(i,a).then(e=>e(r,t)),deleteFileTranscript:(i,a)=>FileTranscriptServiceApiFp(e).deleteFileTranscript(i,a).then(e=>e(r,t)),getFileTranscriptPhrases:(i,a,n,s)=>FileTranscriptServiceApiFp(e).getFileTranscriptPhrases(i,a,n,s).then(e=>e(r,t))}};class FileTranscriptServiceApi extends BaseAPI{createFileTranscript(e,t){return FileTranscriptServiceApiFp(this.configuration).createFileTranscript(e,t).then(e=>e(this.axios,this.basePath))}deleteFileTranscript(e,t){return FileTranscriptServiceApiFp(this.configuration).deleteFileTranscript(e,t).then(e=>e(this.axios,this.basePath))}getFileTranscriptPhrases(e,t,r,i){return FileTranscriptServiceApiFp(this.configuration).getFileTranscriptPhrases(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const ImportTemplateServiceApiAxiosParamCreator=function(e){return{createImportTemplate:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createImportTemplate.");const i=parse("/storage/import_templates",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteImportTemplate:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteImportTemplate.");const i="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchImportTemplate:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchImportTemplate.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchImportTemplate.");const a="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readImportTemplate:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readImportTemplate.");const i="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchImportTemplate:async(t,r,i,a,n,s,o={})=>{const u=parse("/storage/import_templates",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateImportTemplate:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateImportTemplate.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateImportTemplate.");const a="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},ImportTemplateServiceApiFp=function(e){return{async createImportTemplate(t,r){const i=await ImportTemplateServiceApiAxiosParamCreator(e).createImportTemplate(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteImportTemplate(t,r){const i=await ImportTemplateServiceApiAxiosParamCreator(e).deleteImportTemplate(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchImportTemplate(t,r,i){const a=await ImportTemplateServiceApiAxiosParamCreator(e).patchImportTemplate(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readImportTemplate(t,r){const i=await ImportTemplateServiceApiAxiosParamCreator(e).readImportTemplate(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchImportTemplate(t,r,i,a,n,s,o){const u=await ImportTemplateServiceApiAxiosParamCreator(e).searchImportTemplate(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateImportTemplate(t,r,i){const a=await ImportTemplateServiceApiAxiosParamCreator(e).updateImportTemplate(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},ImportTemplateServiceApiFactory=function(e,t,r){return{createImportTemplate:(i,a)=>ImportTemplateServiceApiFp(e).createImportTemplate(i,a).then(e=>e(r,t)),deleteImportTemplate:(i,a)=>ImportTemplateServiceApiFp(e).deleteImportTemplate(i,a).then(e=>e(r,t)),patchImportTemplate:(i,a,n)=>ImportTemplateServiceApiFp(e).patchImportTemplate(i,a,n).then(e=>e(r,t)),readImportTemplate:(i,a)=>ImportTemplateServiceApiFp(e).readImportTemplate(i,a).then(e=>e(r,t)),searchImportTemplate:(i,a,n,s,o,u,c)=>ImportTemplateServiceApiFp(e).searchImportTemplate(i,a,n,s,o,u,c).then(e=>e(r,t)),updateImportTemplate:(i,a,n)=>ImportTemplateServiceApiFp(e).updateImportTemplate(i,a,n).then(e=>e(r,t))}};class ImportTemplateServiceApi extends BaseAPI{createImportTemplate(e,t){return ImportTemplateServiceApiFp(this.configuration).createImportTemplate(e,t).then(e=>e(this.axios,this.basePath))}deleteImportTemplate(e,t){return ImportTemplateServiceApiFp(this.configuration).deleteImportTemplate(e,t).then(e=>e(this.axios,this.basePath))}patchImportTemplate(e,t,r){return ImportTemplateServiceApiFp(this.configuration).patchImportTemplate(e,t,r).then(e=>e(this.axios,this.basePath))}readImportTemplate(e,t){return ImportTemplateServiceApiFp(this.configuration).readImportTemplate(e,t).then(e=>e(this.axios,this.basePath))}searchImportTemplate(e,t,r,i,a,n,s){return ImportTemplateServiceApiFp(this.configuration).searchImportTemplate(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateImportTemplate(e,t,r){return ImportTemplateServiceApiFp(this.configuration).updateImportTemplate(e,t,r).then(e=>e(this.axios,this.basePath))}}const LabelsApiAxiosParamCreator=function(e){return{deleteLabels:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deleteLabels.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteLabels.");const n="/contacts/{contact_id}/labels".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),r&&(l.etag=r),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},getLabels:async(t,r,i,a={})=>{const n=parse("/contacts/labels",!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...a},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==t&&(c.page=t),void 0!==r&&(c.size=r),void 0!==i&&(c.q=i),n.query={...n.query,...c,...a.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...a.headers},{url:format(n),options:o}},listLabels:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling listLabels.");const c="/contacts/{contact_id}/labels".replace("{contact_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.q=a),n&&(y.sort=n),s&&(y.fields=s),o&&(y.id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},mergeLabels:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling mergeLabels.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling mergeLabels.");const n="/contacts/{contact_id}/labels".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"POST",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},resetLabels:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling resetLabels.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling resetLabels.");const n="/contacts/{contact_id}/labels".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},LabelsApiFp=function(e){return{async deleteLabels(t,r,i,a){const n=await LabelsApiAxiosParamCreator(e).deleteLabels(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async getLabels(t,r,i,a){const n=await LabelsApiAxiosParamCreator(e).getLabels(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async listLabels(t,r,i,a,n,s,o,u){const c=await LabelsApiAxiosParamCreator(e).listLabels(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async mergeLabels(t,r,i,a){const n=await LabelsApiAxiosParamCreator(e).mergeLabels(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async resetLabels(t,r,i,a){const n=await LabelsApiAxiosParamCreator(e).resetLabels(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},LabelsApiFactory=function(e,t,r){return{deleteLabels:(i,a,n,s)=>LabelsApiFp(e).deleteLabels(i,a,n,s).then(e=>e(r,t)),getLabels:(i,a,n,s)=>LabelsApiFp(e).getLabels(i,a,n,s).then(e=>e(r,t)),listLabels:(i,a,n,s,o,u,c,l)=>LabelsApiFp(e).listLabels(i,a,n,s,o,u,c,l).then(e=>e(r,t)),mergeLabels:(i,a,n,s)=>LabelsApiFp(e).mergeLabels(i,a,n,s).then(e=>e(r,t)),resetLabels:(i,a,n,s)=>LabelsApiFp(e).resetLabels(i,a,n,s).then(e=>e(r,t))}};class LabelsApi extends BaseAPI{deleteLabels(e,t,r,i){return LabelsApiFp(this.configuration).deleteLabels(e,t,r,i).then(e=>e(this.axios,this.basePath))}getLabels(e,t,r,i){return LabelsApiFp(this.configuration).getLabels(e,t,r,i).then(e=>e(this.axios,this.basePath))}listLabels(e,t,r,i,a,n,s,o){return LabelsApiFp(this.configuration).listLabels(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}mergeLabels(e,t,r,i){return LabelsApiFp(this.configuration).mergeLabels(e,t,r,i).then(e=>e(this.axios,this.basePath))}resetLabels(e,t,r,i){return LabelsApiFp(this.configuration).resetLabels(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const ListServiceApiAxiosParamCreator=function(e){return{createList:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createList.");const i=parse("/call_center/list",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},createListCommunication:async(t,r,i={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling createListCommunication.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createListCommunication.");const a="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteList:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteList.");const a="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},deleteListCommunication:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling deleteListCommunication.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteListCommunication.");const n="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},readList:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readList.");const a="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readListCommunication:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling readListCommunication.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readListCommunication.");const n="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchList:async(t,r,i,a,n,s,o={})=>{const u=parse("/call_center/list",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},searchListCommunication:async(t,r,i,a,n,s,o,u,c,l={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling searchListCommunication.");const d="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(t))),p=parse(d,!0);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...l},g={},A={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==r&&(A.page=r),void 0!==i&&(A.size=i),void 0!==a&&(A.q=a),void 0!==n&&(A.sort=n),s&&(A.fields=s),o&&(A.id=o),void 0!==u&&(A["expire_at.from"]=u),void 0!==c&&(A["expire_at.to"]=c),p.query={...p.query,...A,...l.query},delete p.search;let m=h&&h.headers?h.headers:{};return y.headers={...g,...m,...l.headers},{url:format(p),options:y}},updateList:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateList.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateList.");const a="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},updateListCommunication:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling updateListCommunication.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateListCommunication.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateListCommunication.");const n="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},ListServiceApiFp=function(e){return{async createList(t,r){const i=await ListServiceApiAxiosParamCreator(e).createList(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createListCommunication(t,r,i){const a=await ListServiceApiAxiosParamCreator(e).createListCommunication(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteList(t,r,i){const a=await ListServiceApiAxiosParamCreator(e).deleteList(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteListCommunication(t,r,i,a){const n=await ListServiceApiAxiosParamCreator(e).deleteListCommunication(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readList(t,r,i){const a=await ListServiceApiAxiosParamCreator(e).readList(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readListCommunication(t,r,i,a){const n=await ListServiceApiAxiosParamCreator(e).readListCommunication(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchList(t,r,i,a,n,s,o){const u=await ListServiceApiAxiosParamCreator(e).searchList(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async searchListCommunication(t,r,i,a,n,s,o,u,c,l){const d=await ListServiceApiAxiosParamCreator(e).searchListCommunication(t,r,i,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async updateList(t,r,i){const a=await ListServiceApiAxiosParamCreator(e).updateList(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async updateListCommunication(t,r,i,a){const n=await ListServiceApiAxiosParamCreator(e).updateListCommunication(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},ListServiceApiFactory=function(e,t,r){return{createList:(i,a)=>ListServiceApiFp(e).createList(i,a).then(e=>e(r,t)),createListCommunication:(i,a,n)=>ListServiceApiFp(e).createListCommunication(i,a,n).then(e=>e(r,t)),deleteList:(i,a,n)=>ListServiceApiFp(e).deleteList(i,a,n).then(e=>e(r,t)),deleteListCommunication:(i,a,n,s)=>ListServiceApiFp(e).deleteListCommunication(i,a,n,s).then(e=>e(r,t)),readList:(i,a,n)=>ListServiceApiFp(e).readList(i,a,n).then(e=>e(r,t)),readListCommunication:(i,a,n,s)=>ListServiceApiFp(e).readListCommunication(i,a,n,s).then(e=>e(r,t)),searchList:(i,a,n,s,o,u,c)=>ListServiceApiFp(e).searchList(i,a,n,s,o,u,c).then(e=>e(r,t)),searchListCommunication:(i,a,n,s,o,u,c,l,d,p)=>ListServiceApiFp(e).searchListCommunication(i,a,n,s,o,u,c,l,d,p).then(e=>e(r,t)),updateList:(i,a,n)=>ListServiceApiFp(e).updateList(i,a,n).then(e=>e(r,t)),updateListCommunication:(i,a,n,s)=>ListServiceApiFp(e).updateListCommunication(i,a,n,s).then(e=>e(r,t))}};class ListServiceApi extends BaseAPI{createList(e,t){return ListServiceApiFp(this.configuration).createList(e,t).then(e=>e(this.axios,this.basePath))}createListCommunication(e,t,r){return ListServiceApiFp(this.configuration).createListCommunication(e,t,r).then(e=>e(this.axios,this.basePath))}deleteList(e,t,r){return ListServiceApiFp(this.configuration).deleteList(e,t,r).then(e=>e(this.axios,this.basePath))}deleteListCommunication(e,t,r,i){return ListServiceApiFp(this.configuration).deleteListCommunication(e,t,r,i).then(e=>e(this.axios,this.basePath))}readList(e,t,r){return ListServiceApiFp(this.configuration).readList(e,t,r).then(e=>e(this.axios,this.basePath))}readListCommunication(e,t,r,i){return ListServiceApiFp(this.configuration).readListCommunication(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchList(e,t,r,i,a,n,s){return ListServiceApiFp(this.configuration).searchList(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}searchListCommunication(e,t,r,i,a,n,s,o,u,c){return ListServiceApiFp(this.configuration).searchListCommunication(e,t,r,i,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}updateList(e,t,r){return ListServiceApiFp(this.configuration).updateList(e,t,r).then(e=>e(this.axios,this.basePath))}updateListCommunication(e,t,r,i){return ListServiceApiFp(this.configuration).updateListCommunication(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const LoggerServiceApiAxiosParamCreator=function(e){return{searchLogByConfigId:async(t,r,i,a,n,s,o,u,c,l,d,p={})=>{if(null==t)throw new RequiredError("configId","Required parameter configId was null or undefined when calling searchLogByConfigId.");const h="/logger/config/{config_id}/logs".replace("{config_id}",encodeURIComponent(String(t))),y=parse(h,!0);let g;e&&(g=e.baseOptions);const A={method:"GET",...g,...p},m={},f={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;m["X-Webitel-Access"]=t}void 0!==r&&(f.page=r),void 0!==i&&(f.size=i),void 0!==a&&(f.q=a),void 0!==n&&(f.sort=n),s&&(f.fields=s),o&&(f.user_id=o),u&&(f.action=u),void 0!==c&&(f.user_ip=c),void 0!==l&&(f.date_from=l),void 0!==d&&(f.date_to=d),y.query={...y.query,...f,...p.query},delete y.search;let w=g&&g.headers?g.headers:{};return A.headers={...m,...w,...p.headers},{url:format(y),options:A}},searchLogByRecordId:async(t,r,i,a,n,s,o,u,c,l,d,p,h={})=>{if(null==t)throw new RequiredError("object","Required parameter object was null or undefined when calling searchLogByRecordId.");if(null==r)throw new RequiredError("recordId","Required parameter recordId was null or undefined when calling searchLogByRecordId.");const y="/logger/{object}/record/{record_id}/logs".replace("{object}",encodeURIComponent(String(t))).replace("{record_id}",encodeURIComponent(String(r))),g=parse(y,!0);let A;e&&(A=e.baseOptions);const m={method:"GET",...A,...h},f={},w={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;f["X-Webitel-Access"]=t}void 0!==i&&(w.page=i),void 0!==a&&(w.size=a),void 0!==n&&(w.q=n),void 0!==s&&(w.sort=s),o&&(w.fields=o),u&&(w.action=u),c&&(w.user_id=c),void 0!==l&&(w.user_ip=l),void 0!==d&&(w.date_from=d),void 0!==p&&(w.date_to=p),g.query={...g.query,...w,...h.query},delete g.search;let b=A&&A.headers?A.headers:{};return m.headers={...f,...b,...h.headers},{url:format(g),options:m}},searchLogByUserId:async(t,r,i,a,n,s,o,u,c,l,d,p={})=>{if(null==t)throw new RequiredError("userId","Required parameter userId was null or undefined when calling searchLogByUserId.");const h="/logger/user/{user_id}/logs".replace("{user_id}",encodeURIComponent(String(t))),y=parse(h,!0);let g;e&&(g=e.baseOptions);const A={method:"GET",...g,...p},m={},f={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;m["X-Webitel-Access"]=t}void 0!==r&&(f.page=r),void 0!==i&&(f.size=i),void 0!==a&&(f.q=a),void 0!==n&&(f.sort=n),s&&(f.fields=s),o&&(f.object_id=o),u&&(f.action=u),void 0!==c&&(f.user_ip=c),void 0!==l&&(f.date_from=l),void 0!==d&&(f.date_to=d),y.query={...y.query,...f,...p.query},delete y.search;let w=g&&g.headers?g.headers:{};return A.headers={...m,...w,...p.headers},{url:format(y),options:A}}}},LoggerServiceApiFp=function(e){return{async searchLogByConfigId(t,r,i,a,n,s,o,u,c,l,d,p){const h=await LoggerServiceApiAxiosParamCreator(e).searchLogByConfigId(t,r,i,a,n,s,o,u,c,l,d,p);return(e=globalAxios,t=BASE_PATH)=>{const r={...h.options,url:t+h.url};return e.request(r)}},async searchLogByRecordId(t,r,i,a,n,s,o,u,c,l,d,p,h){const y=await LoggerServiceApiAxiosParamCreator(e).searchLogByRecordId(t,r,i,a,n,s,o,u,c,l,d,p,h);return(e=globalAxios,t=BASE_PATH)=>{const r={...y.options,url:t+y.url};return e.request(r)}},async searchLogByUserId(t,r,i,a,n,s,o,u,c,l,d,p){const h=await LoggerServiceApiAxiosParamCreator(e).searchLogByUserId(t,r,i,a,n,s,o,u,c,l,d,p);return(e=globalAxios,t=BASE_PATH)=>{const r={...h.options,url:t+h.url};return e.request(r)}}}},LoggerServiceApiFactory=function(e,t,r){return{searchLogByConfigId:(i,a,n,s,o,u,c,l,d,p,h,y)=>LoggerServiceApiFp(e).searchLogByConfigId(i,a,n,s,o,u,c,l,d,p,h,y).then(e=>e(r,t)),searchLogByRecordId:(i,a,n,s,o,u,c,l,d,p,h,y,g)=>LoggerServiceApiFp(e).searchLogByRecordId(i,a,n,s,o,u,c,l,d,p,h,y,g).then(e=>e(r,t)),searchLogByUserId:(i,a,n,s,o,u,c,l,d,p,h,y)=>LoggerServiceApiFp(e).searchLogByUserId(i,a,n,s,o,u,c,l,d,p,h,y).then(e=>e(r,t))}};class LoggerServiceApi extends BaseAPI{searchLogByConfigId(e,t,r,i,a,n,s,o,u,c,l,d){return LoggerServiceApiFp(this.configuration).searchLogByConfigId(e,t,r,i,a,n,s,o,u,c,l,d).then(e=>e(this.axios,this.basePath))}searchLogByRecordId(e,t,r,i,a,n,s,o,u,c,l,d,p){return LoggerServiceApiFp(this.configuration).searchLogByRecordId(e,t,r,i,a,n,s,o,u,c,l,d,p).then(e=>e(this.axios,this.basePath))}searchLogByUserId(e,t,r,i,a,n,s,o,u,c,l,d){return LoggerServiceApiFp(this.configuration).searchLogByUserId(e,t,r,i,a,n,s,o,u,c,l,d).then(e=>e(this.axios,this.basePath))}}const ManagersApiAxiosParamCreator=function(e){return{deleteManager:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deleteManager.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteManager.");const n="/contacts/{contact_id}/managers/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},deleteManagers:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deleteManagers.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteManagers.");const n="/contacts/{contact_id}/managers".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),r&&(l.etag=r),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},listManagers:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling listManagers.");const c="/contacts/{contact_id}/managers".replace("{contact_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.q=a),n&&(y.sort=n),s&&(y.fields=s),o&&(y.id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},locateManager:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling locateManager.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling locateManager.");const n="/contacts/{contact_id}/managers/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},mergeManagers:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling mergeManagers.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling mergeManagers.");const n="/contacts/{contact_id}/managers".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"POST",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},resetManagers:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling resetManagers.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling resetManagers.");const n="/contacts/{contact_id}/managers".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},updateManager:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updateManager.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updateManager.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updateManager.");const s="/contacts/{contact_id}/managers/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PUT",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}},updateManager2:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updateManager2.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updateManager2.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updateManager2.");const s="/contacts/{contact_id}/managers/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PATCH",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},ManagersApiFp=function(e){return{async deleteManager(t,r,i,a){const n=await ManagersApiAxiosParamCreator(e).deleteManager(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async deleteManagers(t,r,i,a){const n=await ManagersApiAxiosParamCreator(e).deleteManagers(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async listManagers(t,r,i,a,n,s,o,u){const c=await ManagersApiAxiosParamCreator(e).listManagers(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async locateManager(t,r,i,a){const n=await ManagersApiAxiosParamCreator(e).locateManager(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async mergeManagers(t,r,i,a){const n=await ManagersApiAxiosParamCreator(e).mergeManagers(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async resetManagers(t,r,i,a){const n=await ManagersApiAxiosParamCreator(e).resetManagers(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async updateManager(t,r,i,a,n){const s=await ManagersApiAxiosParamCreator(e).updateManager(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async updateManager2(t,r,i,a,n){const s=await ManagersApiAxiosParamCreator(e).updateManager2(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}}}},ManagersApiFactory=function(e,t,r){return{deleteManager:(i,a,n,s)=>ManagersApiFp(e).deleteManager(i,a,n,s).then(e=>e(r,t)),deleteManagers:(i,a,n,s)=>ManagersApiFp(e).deleteManagers(i,a,n,s).then(e=>e(r,t)),listManagers:(i,a,n,s,o,u,c,l)=>ManagersApiFp(e).listManagers(i,a,n,s,o,u,c,l).then(e=>e(r,t)),locateManager:(i,a,n,s)=>ManagersApiFp(e).locateManager(i,a,n,s).then(e=>e(r,t)),mergeManagers:(i,a,n,s)=>ManagersApiFp(e).mergeManagers(i,a,n,s).then(e=>e(r,t)),resetManagers:(i,a,n,s)=>ManagersApiFp(e).resetManagers(i,a,n,s).then(e=>e(r,t)),updateManager:(i,a,n,s,o)=>ManagersApiFp(e).updateManager(i,a,n,s,o).then(e=>e(r,t)),updateManager2:(i,a,n,s,o)=>ManagersApiFp(e).updateManager2(i,a,n,s,o).then(e=>e(r,t))}};class ManagersApi extends BaseAPI{deleteManager(e,t,r,i){return ManagersApiFp(this.configuration).deleteManager(e,t,r,i).then(e=>e(this.axios,this.basePath))}deleteManagers(e,t,r,i){return ManagersApiFp(this.configuration).deleteManagers(e,t,r,i).then(e=>e(this.axios,this.basePath))}listManagers(e,t,r,i,a,n,s,o){return ManagersApiFp(this.configuration).listManagers(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}locateManager(e,t,r,i){return ManagersApiFp(this.configuration).locateManager(e,t,r,i).then(e=>e(this.axios,this.basePath))}mergeManagers(e,t,r,i){return ManagersApiFp(this.configuration).mergeManagers(e,t,r,i).then(e=>e(this.axios,this.basePath))}resetManagers(e,t,r,i){return ManagersApiFp(this.configuration).resetManagers(e,t,r,i).then(e=>e(this.axios,this.basePath))}updateManager(e,t,r,i,a){return ManagersApiFp(this.configuration).updateManager(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}updateManager2(e,t,r,i,a){return ManagersApiFp(this.configuration).updateManager2(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}}const MediaFileServiceApiAxiosParamCreator=function(e){return{deleteMediaFile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteMediaFile.");const a="/storage/media/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readMediaFile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readMediaFile.");const a="/storage/media/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchMediaFile:async(t,r,i,a,n,s,o={})=>{const u=parse("/storage/media",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}}}},MediaFileServiceApiFp=function(e){return{async deleteMediaFile(t,r,i){const a=await MediaFileServiceApiAxiosParamCreator(e).deleteMediaFile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readMediaFile(t,r,i){const a=await MediaFileServiceApiAxiosParamCreator(e).readMediaFile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchMediaFile(t,r,i,a,n,s,o){const u=await MediaFileServiceApiAxiosParamCreator(e).searchMediaFile(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}}}},MediaFileServiceApiFactory=function(e,t,r){return{deleteMediaFile:(i,a,n)=>MediaFileServiceApiFp(e).deleteMediaFile(i,a,n).then(e=>e(r,t)),readMediaFile:(i,a,n)=>MediaFileServiceApiFp(e).readMediaFile(i,a,n).then(e=>e(r,t)),searchMediaFile:(i,a,n,s,o,u,c)=>MediaFileServiceApiFp(e).searchMediaFile(i,a,n,s,o,u,c).then(e=>e(r,t))}};class MediaFileServiceApi extends BaseAPI{deleteMediaFile(e,t,r){return MediaFileServiceApiFp(this.configuration).deleteMediaFile(e,t,r).then(e=>e(this.axios,this.basePath))}readMediaFile(e,t,r){return MediaFileServiceApiFp(this.configuration).readMediaFile(e,t,r).then(e=>e(this.axios,this.basePath))}searchMediaFile(e,t,r,i,a,n,s){return MediaFileServiceApiFp(this.configuration).searchMediaFile(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}}const MemberServiceApiAxiosParamCreator=function(e){return{attemptCallback:async(t,r,i={})=>{if(null==t)throw new RequiredError("attemptId","Required parameter attemptId was null or undefined when calling attemptCallback.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling attemptCallback.");const a="/call_center/attempts/{attempt_id}".replace("{attempt_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},attemptResult:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling attemptResult.");if(null==r)throw new RequiredError("memberId","Required parameter memberId was null or undefined when calling attemptResult.");if(null==i)throw new RequiredError("attemptId","Required parameter attemptId was null or undefined when calling attemptResult.");if(null==a)throw new RequiredError("body","Required parameter body was null or undefined when calling attemptResult.");const s="/call_center/queues/{queue_id}/members/{member_id}/attempts/{attempt_id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{member_id}",encodeURIComponent(String(r))).replace("{attempt_id}",encodeURIComponent(String(i))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PATCH",...u,...n},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}l["Content-Type"]="application/json",o.query={...o.query,...n.query},delete o.search;let d=u&&u.headers?u.headers:{};c.headers={...l,...d,...n.headers};const p="string"!=typeof a||"application/json"===c.headers["Content-Type"];return c.data=p?JSON.stringify(void 0!==a?a:{}):a||"",{url:format(o),options:c}},attemptsRenewalResult:async(t,r,i={})=>{if(null==t)throw new RequiredError("attemptId","Required parameter attemptId was null or undefined when calling attemptsRenewalResult.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling attemptsRenewalResult.");const a="/call_center/queues/attempts/{attempt_id}/renewal".replace("{attempt_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},createAttempt:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createAttempt.");if(null==r)throw new RequiredError("memberId","Required parameter memberId was null or undefined when calling createAttempt.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling createAttempt.");const n="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(t))).replace("{member_id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"POST",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},createMember:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createMember.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createMember.");const a="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},createMemberBulk:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createMemberBulk.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createMemberBulk.");const a="/call_center/queues/{queue_id}/members/bulk".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteMember:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteMember.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteMember.");const n="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},deleteMembers:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteMembers.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling deleteMembers.");const a="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},patchMember:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchMember.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling patchMember.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling patchMember.");const n="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},readMember:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readMember.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readMember.");const n="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},resetMembers:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling resetMembers.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling resetMembers.");const a="/call_center/queues/{queue_id}/members/reset".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},searchAttempts:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b={})=>{const S=parse("/call_center/queues/attempts/active",!0);let q;e&&(q=e.baseOptions);const v={method:"GET",...q,...b},C={},R={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;C["X-Webitel-Access"]=t}void 0!==t&&(R.page=t),void 0!==r&&(R.size=r),void 0!==i&&(R.q=i),void 0!==a&&(R.sort=a),n&&(R.fields=n),void 0!==s&&(R["joined_at.from"]=s),void 0!==o&&(R["joined_at.to"]=o),u&&(R.id=u),c&&(R.queue_id=c),l&&(R.bucket_id=l),d&&(R.member_id=d),p&&(R.agent_id=p),h&&(R.result=h),void 0!==y&&(R["leaving_at.from"]=y),void 0!==g&&(R["leaving_at.to"]=g),void 0!==A&&(R["offering_at.from"]=A),void 0!==m&&(R["offering_at.to"]=m),void 0!==f&&(R["duration.from"]=f),void 0!==w&&(R["duration.to"]=w),S.query={...S.query,...R,...b.query},delete S.search;let P=q&&q.headers?q.headers:{};return v.headers={...C,...P,...b.headers},{url:format(S),options:v}},searchAttemptsHistory:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b={})=>{const S=parse("/call_center/queues/attempts/history",!0);let q;e&&(q=e.baseOptions);const v={method:"GET",...q,...b},C={},R={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;C["X-Webitel-Access"]=t}void 0!==t&&(R.page=t),void 0!==r&&(R.size=r),void 0!==i&&(R.q=i),void 0!==a&&(R.sort=a),n&&(R.fields=n),void 0!==s&&(R["joined_at.from"]=s),void 0!==o&&(R["joined_at.to"]=o),u&&(R.id=u),c&&(R.queue_id=c),l&&(R.bucket_id=l),d&&(R.member_id=d),p&&(R.agent_id=p),h&&(R.result=h),void 0!==y&&(R["leaving_at.from"]=y),void 0!==g&&(R["leaving_at.to"]=g),void 0!==A&&(R["offering_at.from"]=A),void 0!==m&&(R["offering_at.to"]=m),void 0!==f&&(R["duration.from"]=f),void 0!==w&&(R["duration.to"]=w),S.query={...S.query,...R,...b.query},delete S.search;let P=q&&q.headers?q.headers:{};return v.headers={...C,...P,...b.headers},{url:format(S),options:v}},searchMemberAttempts:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchMemberAttempts.");if(null==r)throw new RequiredError("memberId","Required parameter memberId was null or undefined when calling searchMemberAttempts.");const n="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(t))).replace("{member_id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchMemberInQueue:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchMemberInQueue.");const q="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(t))),v=parse(q,!0);let C;e&&(C=e.baseOptions);const R={method:"GET",...C,...S},P={},T={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;P["X-Webitel-Access"]=t}void 0!==r&&(T.page=r),void 0!==i&&(T.size=i),void 0!==a&&(T.q=a),void 0!==n&&(T.sort=n),s&&(T.fields=s),o&&(T.id=o),u&&(T.bucket_id=u),void 0!==c&&(T.destination=c),void 0!==l&&(T["created_at.from"]=l),void 0!==d&&(T["created_at.to"]=d),void 0!==p&&(T["offering_at.from"]=p),void 0!==h&&(T["offering_at.to"]=h),y&&(T.stop_cause=y),void 0!==g&&(T["priority.from"]=g),void 0!==A&&(T["priority.to"]=A),void 0!==m&&(T.name=m),void 0!==f&&(T["attempts.from"]=f),void 0!==w&&(T["attempts.to"]=w),b&&(T.agent_id=b),v.query={...v.query,...T,...S.query},delete v.search;let E=C&&C.headers?C.headers:{};return R.headers={...P,...E,...S.headers},{url:format(v),options:R}},searchMembers:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S={})=>{const q=parse("/call_center/members",!0);let v;e&&(v=e.baseOptions);const C={method:"GET",...v,...S},R={},P={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;R["X-Webitel-Access"]=t}void 0!==t&&(P.page=t),void 0!==r&&(P.size=r),void 0!==i&&(P.q=i),void 0!==a&&(P.sort=a),n&&(P.fields=n),s&&(P.id=s),o&&(P.queue_id=o),u&&(P.bucket_id=u),void 0!==c&&(P.destination=c),void 0!==l&&(P["created_at.from"]=l),void 0!==d&&(P["created_at.to"]=d),void 0!==p&&(P["offering_at.from"]=p),void 0!==h&&(P["offering_at.to"]=h),y&&(P.stop_cause=y),void 0!==g&&(P["priority.from"]=g),void 0!==A&&(P["priority.to"]=A),void 0!==m&&(P.name=m),void 0!==f&&(P["attempts.from"]=f),void 0!==w&&(P["attempts.to"]=w),b&&(P.agent_id=b),q.query={...q.query,...P,...S.query},delete q.search;let T=v&&v.headers?v.headers:{};return C.headers={...R,...T,...S.headers},{url:format(q),options:C}},updateMember:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateMember.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateMember.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateMember.");const n="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},MemberServiceApiFp=function(e){return{async attemptCallback(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).attemptCallback(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async attemptResult(t,r,i,a,n){const s=await MemberServiceApiAxiosParamCreator(e).attemptResult(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async attemptsRenewalResult(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).attemptsRenewalResult(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async createAttempt(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).createAttempt(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async createMember(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).createMember(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async createMemberBulk(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).createMemberBulk(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteMember(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).deleteMember(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async deleteMembers(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).deleteMembers(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchMember(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).patchMember(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readMember(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).readMember(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async resetMembers(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).resetMembers(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchAttempts(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b){const S=await MemberServiceApiAxiosParamCreator(e).searchAttempts(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b);return(e=globalAxios,t=BASE_PATH)=>{const r={...S.options,url:t+S.url};return e.request(r)}},async searchAttemptsHistory(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b){const S=await MemberServiceApiAxiosParamCreator(e).searchAttemptsHistory(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b);return(e=globalAxios,t=BASE_PATH)=>{const r={...S.options,url:t+S.url};return e.request(r)}},async searchMemberAttempts(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).searchMemberAttempts(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchMemberInQueue(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S){const q=await MemberServiceApiAxiosParamCreator(e).searchMemberInQueue(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S);return(e=globalAxios,t=BASE_PATH)=>{const r={...q.options,url:t+q.url};return e.request(r)}},async searchMembers(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S){const q=await MemberServiceApiAxiosParamCreator(e).searchMembers(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S);return(e=globalAxios,t=BASE_PATH)=>{const r={...q.options,url:t+q.url};return e.request(r)}},async updateMember(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).updateMember(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},MemberServiceApiFactory=function(e,t,r){return{attemptCallback:(i,a,n)=>MemberServiceApiFp(e).attemptCallback(i,a,n).then(e=>e(r,t)),attemptResult:(i,a,n,s,o)=>MemberServiceApiFp(e).attemptResult(i,a,n,s,o).then(e=>e(r,t)),attemptsRenewalResult:(i,a,n)=>MemberServiceApiFp(e).attemptsRenewalResult(i,a,n).then(e=>e(r,t)),createAttempt:(i,a,n,s)=>MemberServiceApiFp(e).createAttempt(i,a,n,s).then(e=>e(r,t)),createMember:(i,a,n)=>MemberServiceApiFp(e).createMember(i,a,n).then(e=>e(r,t)),createMemberBulk:(i,a,n)=>MemberServiceApiFp(e).createMemberBulk(i,a,n).then(e=>e(r,t)),deleteMember:(i,a,n,s)=>MemberServiceApiFp(e).deleteMember(i,a,n,s).then(e=>e(r,t)),deleteMembers:(i,a,n)=>MemberServiceApiFp(e).deleteMembers(i,a,n).then(e=>e(r,t)),patchMember:(i,a,n,s)=>MemberServiceApiFp(e).patchMember(i,a,n,s).then(e=>e(r,t)),readMember:(i,a,n,s)=>MemberServiceApiFp(e).readMember(i,a,n,s).then(e=>e(r,t)),resetMembers:(i,a,n)=>MemberServiceApiFp(e).resetMembers(i,a,n).then(e=>e(r,t)),searchAttempts:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q)=>MemberServiceApiFp(e).searchAttempts(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q).then(e=>e(r,t)),searchAttemptsHistory:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q)=>MemberServiceApiFp(e).searchAttemptsHistory(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q).then(e=>e(r,t)),searchMemberAttempts:(i,a,n,s)=>MemberServiceApiFp(e).searchMemberAttempts(i,a,n,s).then(e=>e(r,t)),searchMemberInQueue:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q,v)=>MemberServiceApiFp(e).searchMemberInQueue(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q,v).then(e=>e(r,t)),searchMembers:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q,v)=>MemberServiceApiFp(e).searchMembers(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b,S,q,v).then(e=>e(r,t)),updateMember:(i,a,n,s)=>MemberServiceApiFp(e).updateMember(i,a,n,s).then(e=>e(r,t))}};class MemberServiceApi extends BaseAPI{attemptCallback(e,t,r){return MemberServiceApiFp(this.configuration).attemptCallback(e,t,r).then(e=>e(this.axios,this.basePath))}attemptResult(e,t,r,i,a){return MemberServiceApiFp(this.configuration).attemptResult(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}attemptsRenewalResult(e,t,r){return MemberServiceApiFp(this.configuration).attemptsRenewalResult(e,t,r).then(e=>e(this.axios,this.basePath))}createAttempt(e,t,r,i){return MemberServiceApiFp(this.configuration).createAttempt(e,t,r,i).then(e=>e(this.axios,this.basePath))}createMember(e,t,r){return MemberServiceApiFp(this.configuration).createMember(e,t,r).then(e=>e(this.axios,this.basePath))}createMemberBulk(e,t,r){return MemberServiceApiFp(this.configuration).createMemberBulk(e,t,r).then(e=>e(this.axios,this.basePath))}deleteMember(e,t,r,i){return MemberServiceApiFp(this.configuration).deleteMember(e,t,r,i).then(e=>e(this.axios,this.basePath))}deleteMembers(e,t,r){return MemberServiceApiFp(this.configuration).deleteMembers(e,t,r).then(e=>e(this.axios,this.basePath))}patchMember(e,t,r,i){return MemberServiceApiFp(this.configuration).patchMember(e,t,r,i).then(e=>e(this.axios,this.basePath))}readMember(e,t,r,i){return MemberServiceApiFp(this.configuration).readMember(e,t,r,i).then(e=>e(this.axios,this.basePath))}resetMembers(e,t,r){return MemberServiceApiFp(this.configuration).resetMembers(e,t,r).then(e=>e(this.axios,this.basePath))}searchAttempts(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w){return MemberServiceApiFp(this.configuration).searchAttempts(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w).then(e=>e(this.axios,this.basePath))}searchAttemptsHistory(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w){return MemberServiceApiFp(this.configuration).searchAttemptsHistory(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w).then(e=>e(this.axios,this.basePath))}searchMemberAttempts(e,t,r,i){return MemberServiceApiFp(this.configuration).searchMemberAttempts(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchMemberInQueue(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b){return MemberServiceApiFp(this.configuration).searchMemberInQueue(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b).then(e=>e(this.axios,this.basePath))}searchMembers(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b){return MemberServiceApiFp(this.configuration).searchMembers(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,w,b).then(e=>e(this.axios,this.basePath))}updateMember(e,t,r,i){return MemberServiceApiFp(this.configuration).updateMember(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const OutboundResourceGroupServiceApiAxiosParamCreator=function(e){return{createOutboundResourceGroup:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createOutboundResourceGroup.");const i=parse("/call_center/resource_group",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},createOutboundResourceInGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling createOutboundResourceInGroup.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createOutboundResourceInGroup.");const a="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteOutboundResourceGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteOutboundResourceGroup.");const a="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},deleteOutboundResourceInGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling deleteOutboundResourceInGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteOutboundResourceInGroup.");const n="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},readOutboundResourceGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readOutboundResourceGroup.");const a="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readOutboundResourceInGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling readOutboundResourceInGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readOutboundResourceInGroup.");const n="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchOutboundResourceGroup:async(t,r,i,a,n,s,o={})=>{const u=parse("/call_center/resource_group",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},searchOutboundResourceInGroup:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling searchOutboundResourceInGroup.");const c="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.q=a),void 0!==n&&(y.sort=n),s&&(y.fields=s),o&&(y.id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},updateOutboundResourceGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResourceGroup.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateOutboundResourceGroup.");const a="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},updateOutboundResourceInGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling updateOutboundResourceInGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResourceInGroup.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateOutboundResourceInGroup.");const n="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},OutboundResourceGroupServiceApiFp=function(e){return{async createOutboundResourceGroup(t,r){const i=await OutboundResourceGroupServiceApiAxiosParamCreator(e).createOutboundResourceGroup(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createOutboundResourceInGroup(t,r,i){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).createOutboundResourceInGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteOutboundResourceGroup(t,r,i){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).deleteOutboundResourceGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteOutboundResourceInGroup(t,r,i,a){const n=await OutboundResourceGroupServiceApiAxiosParamCreator(e).deleteOutboundResourceInGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readOutboundResourceGroup(t,r,i){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).readOutboundResourceGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readOutboundResourceInGroup(t,r,i,a){const n=await OutboundResourceGroupServiceApiAxiosParamCreator(e).readOutboundResourceInGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchOutboundResourceGroup(t,r,i,a,n,s,o){const u=await OutboundResourceGroupServiceApiAxiosParamCreator(e).searchOutboundResourceGroup(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async searchOutboundResourceInGroup(t,r,i,a,n,s,o,u){const c=await OutboundResourceGroupServiceApiAxiosParamCreator(e).searchOutboundResourceInGroup(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async updateOutboundResourceGroup(t,r,i){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).updateOutboundResourceGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async updateOutboundResourceInGroup(t,r,i,a){const n=await OutboundResourceGroupServiceApiAxiosParamCreator(e).updateOutboundResourceInGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},OutboundResourceGroupServiceApiFactory=function(e,t,r){return{createOutboundResourceGroup:(i,a)=>OutboundResourceGroupServiceApiFp(e).createOutboundResourceGroup(i,a).then(e=>e(r,t)),createOutboundResourceInGroup:(i,a,n)=>OutboundResourceGroupServiceApiFp(e).createOutboundResourceInGroup(i,a,n).then(e=>e(r,t)),deleteOutboundResourceGroup:(i,a,n)=>OutboundResourceGroupServiceApiFp(e).deleteOutboundResourceGroup(i,a,n).then(e=>e(r,t)),deleteOutboundResourceInGroup:(i,a,n,s)=>OutboundResourceGroupServiceApiFp(e).deleteOutboundResourceInGroup(i,a,n,s).then(e=>e(r,t)),readOutboundResourceGroup:(i,a,n)=>OutboundResourceGroupServiceApiFp(e).readOutboundResourceGroup(i,a,n).then(e=>e(r,t)),readOutboundResourceInGroup:(i,a,n,s)=>OutboundResourceGroupServiceApiFp(e).readOutboundResourceInGroup(i,a,n,s).then(e=>e(r,t)),searchOutboundResourceGroup:(i,a,n,s,o,u,c)=>OutboundResourceGroupServiceApiFp(e).searchOutboundResourceGroup(i,a,n,s,o,u,c).then(e=>e(r,t)),searchOutboundResourceInGroup:(i,a,n,s,o,u,c,l)=>OutboundResourceGroupServiceApiFp(e).searchOutboundResourceInGroup(i,a,n,s,o,u,c,l).then(e=>e(r,t)),updateOutboundResourceGroup:(i,a,n)=>OutboundResourceGroupServiceApiFp(e).updateOutboundResourceGroup(i,a,n).then(e=>e(r,t)),updateOutboundResourceInGroup:(i,a,n,s)=>OutboundResourceGroupServiceApiFp(e).updateOutboundResourceInGroup(i,a,n,s).then(e=>e(r,t))}};class OutboundResourceGroupServiceApi extends BaseAPI{createOutboundResourceGroup(e,t){return OutboundResourceGroupServiceApiFp(this.configuration).createOutboundResourceGroup(e,t).then(e=>e(this.axios,this.basePath))}createOutboundResourceInGroup(e,t,r){return OutboundResourceGroupServiceApiFp(this.configuration).createOutboundResourceInGroup(e,t,r).then(e=>e(this.axios,this.basePath))}deleteOutboundResourceGroup(e,t,r){return OutboundResourceGroupServiceApiFp(this.configuration).deleteOutboundResourceGroup(e,t,r).then(e=>e(this.axios,this.basePath))}deleteOutboundResourceInGroup(e,t,r,i){return OutboundResourceGroupServiceApiFp(this.configuration).deleteOutboundResourceInGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}readOutboundResourceGroup(e,t,r){return OutboundResourceGroupServiceApiFp(this.configuration).readOutboundResourceGroup(e,t,r).then(e=>e(this.axios,this.basePath))}readOutboundResourceInGroup(e,t,r,i){return OutboundResourceGroupServiceApiFp(this.configuration).readOutboundResourceInGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchOutboundResourceGroup(e,t,r,i,a,n,s){return OutboundResourceGroupServiceApiFp(this.configuration).searchOutboundResourceGroup(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}searchOutboundResourceInGroup(e,t,r,i,a,n,s,o){return OutboundResourceGroupServiceApiFp(this.configuration).searchOutboundResourceInGroup(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateOutboundResourceGroup(e,t,r){return OutboundResourceGroupServiceApiFp(this.configuration).updateOutboundResourceGroup(e,t,r).then(e=>e(this.axios,this.basePath))}updateOutboundResourceInGroup(e,t,r,i){return OutboundResourceGroupServiceApiFp(this.configuration).updateOutboundResourceInGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const OutboundResourceServiceApiAxiosParamCreator=function(e){return{createOutboundResource:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createOutboundResource.");const i=parse("/call_center/resources",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},createOutboundResourceDisplay:async(t,r,i={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling createOutboundResourceDisplay.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createOutboundResourceDisplay.");const a="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},createOutboundResourceDisplayBulk:async(t,r,i={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling createOutboundResourceDisplayBulk.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createOutboundResourceDisplayBulk.");const a="/call_center/resources/{resource_id}/display/bulk".replace("{resource_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteOutboundResource:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteOutboundResource.");const a="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},deleteOutboundResourceDisplay:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling deleteOutboundResourceDisplay.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteOutboundResourceDisplay.");const n="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},deleteOutboundResourceDisplays:async(t,r,i={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling deleteOutboundResourceDisplays.");const a="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}r&&(c.items=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},patchOutboundResource:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchOutboundResource.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchOutboundResource.");const a="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readOutboundResource:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readOutboundResource.");const a="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readOutboundResourceDisplay:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling readOutboundResourceDisplay.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readOutboundResourceDisplay.");const n="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchOutboundResource:async(t,r,i,a,n,s,o={})=>{const u=parse("/call_center/resources",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},searchOutboundResourceDisplay:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling searchOutboundResourceDisplay.");const c="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.q=a),void 0!==n&&(y.sort=n),s&&(y.fields=s),o&&(y.id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},updateOutboundResource:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResource.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateOutboundResource.");const a="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},updateOutboundResourceDisplay:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling updateOutboundResourceDisplay.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResourceDisplay.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateOutboundResourceDisplay.");const n="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},OutboundResourceServiceApiFp=function(e){return{async createOutboundResource(t,r){const i=await OutboundResourceServiceApiAxiosParamCreator(e).createOutboundResource(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createOutboundResourceDisplay(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).createOutboundResourceDisplay(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async createOutboundResourceDisplayBulk(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).createOutboundResourceDisplayBulk(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteOutboundResource(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).deleteOutboundResource(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteOutboundResourceDisplay(t,r,i,a){const n=await OutboundResourceServiceApiAxiosParamCreator(e).deleteOutboundResourceDisplay(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async deleteOutboundResourceDisplays(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).deleteOutboundResourceDisplays(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchOutboundResource(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).patchOutboundResource(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readOutboundResource(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).readOutboundResource(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readOutboundResourceDisplay(t,r,i,a){const n=await OutboundResourceServiceApiAxiosParamCreator(e).readOutboundResourceDisplay(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchOutboundResource(t,r,i,a,n,s,o){const u=await OutboundResourceServiceApiAxiosParamCreator(e).searchOutboundResource(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async searchOutboundResourceDisplay(t,r,i,a,n,s,o,u){const c=await OutboundResourceServiceApiAxiosParamCreator(e).searchOutboundResourceDisplay(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async updateOutboundResource(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).updateOutboundResource(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async updateOutboundResourceDisplay(t,r,i,a){const n=await OutboundResourceServiceApiAxiosParamCreator(e).updateOutboundResourceDisplay(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},OutboundResourceServiceApiFactory=function(e,t,r){return{createOutboundResource:(i,a)=>OutboundResourceServiceApiFp(e).createOutboundResource(i,a).then(e=>e(r,t)),createOutboundResourceDisplay:(i,a,n)=>OutboundResourceServiceApiFp(e).createOutboundResourceDisplay(i,a,n).then(e=>e(r,t)),createOutboundResourceDisplayBulk:(i,a,n)=>OutboundResourceServiceApiFp(e).createOutboundResourceDisplayBulk(i,a,n).then(e=>e(r,t)),deleteOutboundResource:(i,a,n)=>OutboundResourceServiceApiFp(e).deleteOutboundResource(i,a,n).then(e=>e(r,t)),deleteOutboundResourceDisplay:(i,a,n,s)=>OutboundResourceServiceApiFp(e).deleteOutboundResourceDisplay(i,a,n,s).then(e=>e(r,t)),deleteOutboundResourceDisplays:(i,a,n)=>OutboundResourceServiceApiFp(e).deleteOutboundResourceDisplays(i,a,n).then(e=>e(r,t)),patchOutboundResource:(i,a,n)=>OutboundResourceServiceApiFp(e).patchOutboundResource(i,a,n).then(e=>e(r,t)),readOutboundResource:(i,a,n)=>OutboundResourceServiceApiFp(e).readOutboundResource(i,a,n).then(e=>e(r,t)),readOutboundResourceDisplay:(i,a,n,s)=>OutboundResourceServiceApiFp(e).readOutboundResourceDisplay(i,a,n,s).then(e=>e(r,t)),searchOutboundResource:(i,a,n,s,o,u,c)=>OutboundResourceServiceApiFp(e).searchOutboundResource(i,a,n,s,o,u,c).then(e=>e(r,t)),searchOutboundResourceDisplay:(i,a,n,s,o,u,c,l)=>OutboundResourceServiceApiFp(e).searchOutboundResourceDisplay(i,a,n,s,o,u,c,l).then(e=>e(r,t)),updateOutboundResource:(i,a,n)=>OutboundResourceServiceApiFp(e).updateOutboundResource(i,a,n).then(e=>e(r,t)),updateOutboundResourceDisplay:(i,a,n,s)=>OutboundResourceServiceApiFp(e).updateOutboundResourceDisplay(i,a,n,s).then(e=>e(r,t))}};class OutboundResourceServiceApi extends BaseAPI{createOutboundResource(e,t){return OutboundResourceServiceApiFp(this.configuration).createOutboundResource(e,t).then(e=>e(this.axios,this.basePath))}createOutboundResourceDisplay(e,t,r){return OutboundResourceServiceApiFp(this.configuration).createOutboundResourceDisplay(e,t,r).then(e=>e(this.axios,this.basePath))}createOutboundResourceDisplayBulk(e,t,r){return OutboundResourceServiceApiFp(this.configuration).createOutboundResourceDisplayBulk(e,t,r).then(e=>e(this.axios,this.basePath))}deleteOutboundResource(e,t,r){return OutboundResourceServiceApiFp(this.configuration).deleteOutboundResource(e,t,r).then(e=>e(this.axios,this.basePath))}deleteOutboundResourceDisplay(e,t,r,i){return OutboundResourceServiceApiFp(this.configuration).deleteOutboundResourceDisplay(e,t,r,i).then(e=>e(this.axios,this.basePath))}deleteOutboundResourceDisplays(e,t,r){return OutboundResourceServiceApiFp(this.configuration).deleteOutboundResourceDisplays(e,t,r).then(e=>e(this.axios,this.basePath))}patchOutboundResource(e,t,r){return OutboundResourceServiceApiFp(this.configuration).patchOutboundResource(e,t,r).then(e=>e(this.axios,this.basePath))}readOutboundResource(e,t,r){return OutboundResourceServiceApiFp(this.configuration).readOutboundResource(e,t,r).then(e=>e(this.axios,this.basePath))}readOutboundResourceDisplay(e,t,r,i){return OutboundResourceServiceApiFp(this.configuration).readOutboundResourceDisplay(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchOutboundResource(e,t,r,i,a,n,s){return OutboundResourceServiceApiFp(this.configuration).searchOutboundResource(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}searchOutboundResourceDisplay(e,t,r,i,a,n,s,o){return OutboundResourceServiceApiFp(this.configuration).searchOutboundResourceDisplay(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateOutboundResource(e,t,r){return OutboundResourceServiceApiFp(this.configuration).updateOutboundResource(e,t,r).then(e=>e(this.axios,this.basePath))}updateOutboundResourceDisplay(e,t,r,i){return OutboundResourceServiceApiFp(this.configuration).updateOutboundResourceDisplay(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const PhonesApiAxiosParamCreator=function(e){return{deletePhone:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deletePhone.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deletePhone.");const n="/contacts/{contact_id}/phones/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},deletePhones:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deletePhones.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deletePhones.");const n="/contacts/{contact_id}/phones".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),r&&(l.etag=r),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},listPhones:async(t,r,i,a,n,s,o,u,c,l,d,p,h={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling listPhones.");const y="/contacts/{contact_id}/phones".replace("{contact_id}",encodeURIComponent(String(t))),g=parse(y,!0);let A;e&&(A=e.baseOptions);const m={method:"GET",...A,...h},f={},w={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;f["X-Webitel-Access"]=t}void 0!==r&&(w.page=r),void 0!==i&&(w.size=i),void 0!==a&&(w.q=a),n&&(w.sort=n),s&&(w.fields=s),o&&(w.id=o),void 0!==u&&(w.primary=u),void 0!==c&&(w.verified=c),void 0!==l&&(w["type.id"]=l),void 0!==d&&(w["type.type"]=d),void 0!==p&&(w["type.name"]=p),g.query={...g.query,...w,...h.query},delete g.search;let b=A&&A.headers?A.headers:{};return m.headers={...f,...b,...h.headers},{url:format(g),options:m}},locatePhone:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling locatePhone.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling locatePhone.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling locatePhone.");const s="/contacts/{contact_id}/phones/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"GET",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),void 0!==i&&(d.id=i),o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};return c.headers={...l,...p,...n.headers},{url:format(o),options:c}},mergePhones:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling mergePhones.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling mergePhones.");const n="/contacts/{contact_id}/phones".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"POST",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},resetPhones:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling resetPhones.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling resetPhones.");const n="/contacts/{contact_id}/phones".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},updatePhone:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updatePhone.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updatePhone.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updatePhone.");const s="/contacts/{contact_id}/phones/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PUT",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}},updatePhone2:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updatePhone2.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updatePhone2.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updatePhone2.");const s="/contacts/{contact_id}/phones/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PATCH",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},PhonesApiFp=function(e){return{async deletePhone(t,r,i,a){const n=await PhonesApiAxiosParamCreator(e).deletePhone(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async deletePhones(t,r,i,a){const n=await PhonesApiAxiosParamCreator(e).deletePhones(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async listPhones(t,r,i,a,n,s,o,u,c,l,d,p,h){const y=await PhonesApiAxiosParamCreator(e).listPhones(t,r,i,a,n,s,o,u,c,l,d,p,h);return(e=globalAxios,t=BASE_PATH)=>{const r={...y.options,url:t+y.url};return e.request(r)}},async locatePhone(t,r,i,a,n){const s=await PhonesApiAxiosParamCreator(e).locatePhone(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async mergePhones(t,r,i,a){const n=await PhonesApiAxiosParamCreator(e).mergePhones(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async resetPhones(t,r,i,a){const n=await PhonesApiAxiosParamCreator(e).resetPhones(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async updatePhone(t,r,i,a,n){const s=await PhonesApiAxiosParamCreator(e).updatePhone(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async updatePhone2(t,r,i,a,n){const s=await PhonesApiAxiosParamCreator(e).updatePhone2(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}}}},PhonesApiFactory=function(e,t,r){return{deletePhone:(i,a,n,s)=>PhonesApiFp(e).deletePhone(i,a,n,s).then(e=>e(r,t)),deletePhones:(i,a,n,s)=>PhonesApiFp(e).deletePhones(i,a,n,s).then(e=>e(r,t)),listPhones:(i,a,n,s,o,u,c,l,d,p,h,y,g)=>PhonesApiFp(e).listPhones(i,a,n,s,o,u,c,l,d,p,h,y,g).then(e=>e(r,t)),locatePhone:(i,a,n,s,o)=>PhonesApiFp(e).locatePhone(i,a,n,s,o).then(e=>e(r,t)),mergePhones:(i,a,n,s)=>PhonesApiFp(e).mergePhones(i,a,n,s).then(e=>e(r,t)),resetPhones:(i,a,n,s)=>PhonesApiFp(e).resetPhones(i,a,n,s).then(e=>e(r,t)),updatePhone:(i,a,n,s,o)=>PhonesApiFp(e).updatePhone(i,a,n,s,o).then(e=>e(r,t)),updatePhone2:(i,a,n,s,o)=>PhonesApiFp(e).updatePhone2(i,a,n,s,o).then(e=>e(r,t))}};class PhonesApi extends BaseAPI{deletePhone(e,t,r,i){return PhonesApiFp(this.configuration).deletePhone(e,t,r,i).then(e=>e(this.axios,this.basePath))}deletePhones(e,t,r,i){return PhonesApiFp(this.configuration).deletePhones(e,t,r,i).then(e=>e(this.axios,this.basePath))}listPhones(e,t,r,i,a,n,s,o,u,c,l,d,p){return PhonesApiFp(this.configuration).listPhones(e,t,r,i,a,n,s,o,u,c,l,d,p).then(e=>e(this.axios,this.basePath))}locatePhone(e,t,r,i,a){return PhonesApiFp(this.configuration).locatePhone(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}mergePhones(e,t,r,i){return PhonesApiFp(this.configuration).mergePhones(e,t,r,i).then(e=>e(this.axios,this.basePath))}resetPhones(e,t,r,i){return PhonesApiFp(this.configuration).resetPhones(e,t,r,i).then(e=>e(this.axios,this.basePath))}updatePhone(e,t,r,i,a){return PhonesApiFp(this.configuration).updatePhone(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}updatePhone2(e,t,r,i,a){return PhonesApiFp(this.configuration).updatePhone2(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}}const PresetQueryServiceApiAxiosParamCreator=function(e){return{createPresetQuery:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createPresetQuery.");const i=parse("/call_center/preset/query",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deletePresetQuery:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deletePresetQuery.");const i="/call_center/preset/query/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchPresetQuery:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchPresetQuery.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchPresetQuery.");const a="/call_center/preset/query/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readPresetQuery:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readPresetQuery.");const i="/call_center/preset/query/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchPresetQuery:async(t,r,i,a,n,s,o,u={})=>{const c=parse("/call_center/preset/query",!0);let l;e&&(l=e.baseOptions);const d={method:"GET",...l,...u},p={},h={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;p["X-Webitel-Access"]=t}void 0!==t&&(h.page=t),void 0!==r&&(h.size=r),void 0!==i&&(h.q=i),void 0!==a&&(h.sort=a),n&&(h.fields=n),s&&(h.id=s),o&&(h.section=o),c.query={...c.query,...h,...u.query},delete c.search;let y=l&&l.headers?l.headers:{};return d.headers={...p,...y,...u.headers},{url:format(c),options:d}},updatePresetQuery:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updatePresetQuery.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updatePresetQuery.");const a="/call_center/preset/query/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},PresetQueryServiceApiFp=function(e){return{async createPresetQuery(t,r){const i=await PresetQueryServiceApiAxiosParamCreator(e).createPresetQuery(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deletePresetQuery(t,r){const i=await PresetQueryServiceApiAxiosParamCreator(e).deletePresetQuery(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchPresetQuery(t,r,i){const a=await PresetQueryServiceApiAxiosParamCreator(e).patchPresetQuery(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readPresetQuery(t,r){const i=await PresetQueryServiceApiAxiosParamCreator(e).readPresetQuery(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchPresetQuery(t,r,i,a,n,s,o,u){const c=await PresetQueryServiceApiAxiosParamCreator(e).searchPresetQuery(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async updatePresetQuery(t,r,i){const a=await PresetQueryServiceApiAxiosParamCreator(e).updatePresetQuery(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},PresetQueryServiceApiFactory=function(e,t,r){return{createPresetQuery:(i,a)=>PresetQueryServiceApiFp(e).createPresetQuery(i,a).then(e=>e(r,t)),deletePresetQuery:(i,a)=>PresetQueryServiceApiFp(e).deletePresetQuery(i,a).then(e=>e(r,t)),patchPresetQuery:(i,a,n)=>PresetQueryServiceApiFp(e).patchPresetQuery(i,a,n).then(e=>e(r,t)),readPresetQuery:(i,a)=>PresetQueryServiceApiFp(e).readPresetQuery(i,a).then(e=>e(r,t)),searchPresetQuery:(i,a,n,s,o,u,c,l)=>PresetQueryServiceApiFp(e).searchPresetQuery(i,a,n,s,o,u,c,l).then(e=>e(r,t)),updatePresetQuery:(i,a,n)=>PresetQueryServiceApiFp(e).updatePresetQuery(i,a,n).then(e=>e(r,t))}};class PresetQueryServiceApi extends BaseAPI{createPresetQuery(e,t){return PresetQueryServiceApiFp(this.configuration).createPresetQuery(e,t).then(e=>e(this.axios,this.basePath))}deletePresetQuery(e,t){return PresetQueryServiceApiFp(this.configuration).deletePresetQuery(e,t).then(e=>e(this.axios,this.basePath))}patchPresetQuery(e,t,r){return PresetQueryServiceApiFp(this.configuration).patchPresetQuery(e,t,r).then(e=>e(this.axios,this.basePath))}readPresetQuery(e,t){return PresetQueryServiceApiFp(this.configuration).readPresetQuery(e,t).then(e=>e(this.axios,this.basePath))}searchPresetQuery(e,t,r,i,a,n,s,o){return PresetQueryServiceApiFp(this.configuration).searchPresetQuery(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}updatePresetQuery(e,t,r){return PresetQueryServiceApiFp(this.configuration).updatePresetQuery(e,t,r).then(e=>e(this.axios,this.basePath))}}const QueueBucketServiceApiAxiosParamCreator=function(e){return{createQueueBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueBucket.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createQueueBucket.");const a="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteQueueBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueBucket.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteQueueBucket.");const a="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},patchQueueBucket:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchQueueBucket.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueueBucket.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling patchQueueBucket.");const n="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},readQueueBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueBucket.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readQueueBucket.");const a="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},searchQueueBucket:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchQueueBucket.");const c="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.q=a),void 0!==n&&(y.sort=n),s&&(y.fields=s),o&&(y.id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},updateQueueBucket:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueBucket.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueBucket.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateQueueBucket.");const n="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},QueueBucketServiceApiFp=function(e){return{async createQueueBucket(t,r,i){const a=await QueueBucketServiceApiAxiosParamCreator(e).createQueueBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteQueueBucket(t,r,i){const a=await QueueBucketServiceApiAxiosParamCreator(e).deleteQueueBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchQueueBucket(t,r,i,a){const n=await QueueBucketServiceApiAxiosParamCreator(e).patchQueueBucket(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readQueueBucket(t,r,i){const a=await QueueBucketServiceApiAxiosParamCreator(e).readQueueBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchQueueBucket(t,r,i,a,n,s,o,u){const c=await QueueBucketServiceApiAxiosParamCreator(e).searchQueueBucket(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async updateQueueBucket(t,r,i,a){const n=await QueueBucketServiceApiAxiosParamCreator(e).updateQueueBucket(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},QueueBucketServiceApiFactory=function(e,t,r){return{createQueueBucket:(i,a,n)=>QueueBucketServiceApiFp(e).createQueueBucket(i,a,n).then(e=>e(r,t)),deleteQueueBucket:(i,a,n)=>QueueBucketServiceApiFp(e).deleteQueueBucket(i,a,n).then(e=>e(r,t)),patchQueueBucket:(i,a,n,s)=>QueueBucketServiceApiFp(e).patchQueueBucket(i,a,n,s).then(e=>e(r,t)),readQueueBucket:(i,a,n)=>QueueBucketServiceApiFp(e).readQueueBucket(i,a,n).then(e=>e(r,t)),searchQueueBucket:(i,a,n,s,o,u,c,l)=>QueueBucketServiceApiFp(e).searchQueueBucket(i,a,n,s,o,u,c,l).then(e=>e(r,t)),updateQueueBucket:(i,a,n,s)=>QueueBucketServiceApiFp(e).updateQueueBucket(i,a,n,s).then(e=>e(r,t))}};class QueueBucketServiceApi extends BaseAPI{createQueueBucket(e,t,r){return QueueBucketServiceApiFp(this.configuration).createQueueBucket(e,t,r).then(e=>e(this.axios,this.basePath))}deleteQueueBucket(e,t,r){return QueueBucketServiceApiFp(this.configuration).deleteQueueBucket(e,t,r).then(e=>e(this.axios,this.basePath))}patchQueueBucket(e,t,r,i){return QueueBucketServiceApiFp(this.configuration).patchQueueBucket(e,t,r,i).then(e=>e(this.axios,this.basePath))}readQueueBucket(e,t,r){return QueueBucketServiceApiFp(this.configuration).readQueueBucket(e,t,r).then(e=>e(this.axios,this.basePath))}searchQueueBucket(e,t,r,i,a,n,s,o){return QueueBucketServiceApiFp(this.configuration).searchQueueBucket(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateQueueBucket(e,t,r,i){return QueueBucketServiceApiFp(this.configuration).updateQueueBucket(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const QueueHookServiceApiAxiosParamCreator=function(e){return{createQueueHook:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueHook.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createQueueHook.");const a="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteQueueHook:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueHook.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteQueueHook.");const a="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},patchQueueHook:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchQueueHook.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueueHook.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling patchQueueHook.");const n="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},readQueueHook:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueHook.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readQueueHook.");const a="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},searchQueueHook:async(t,r,i,a,n,s,o,u,c,l={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchQueueHook.");const d="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(t))),p=parse(d,!0);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...l},g={},A={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==r&&(A.page=r),void 0!==i&&(A.size=i),void 0!==a&&(A.q=a),void 0!==n&&(A.sort=n),s&&(A.fields=s),o&&(A.id=o),u&&(A.schema_id=u),c&&(A.event=c),p.query={...p.query,...A,...l.query},delete p.search;let m=h&&h.headers?h.headers:{};return y.headers={...g,...m,...l.headers},{url:format(p),options:y}},updateQueueHook:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueHook.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueHook.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateQueueHook.");const n="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},QueueHookServiceApiFp=function(e){return{async createQueueHook(t,r,i){const a=await QueueHookServiceApiAxiosParamCreator(e).createQueueHook(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteQueueHook(t,r,i){const a=await QueueHookServiceApiAxiosParamCreator(e).deleteQueueHook(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchQueueHook(t,r,i,a){const n=await QueueHookServiceApiAxiosParamCreator(e).patchQueueHook(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readQueueHook(t,r,i){const a=await QueueHookServiceApiAxiosParamCreator(e).readQueueHook(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchQueueHook(t,r,i,a,n,s,o,u,c,l){const d=await QueueHookServiceApiAxiosParamCreator(e).searchQueueHook(t,r,i,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async updateQueueHook(t,r,i,a){const n=await QueueHookServiceApiAxiosParamCreator(e).updateQueueHook(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},QueueHookServiceApiFactory=function(e,t,r){return{createQueueHook:(i,a,n)=>QueueHookServiceApiFp(e).createQueueHook(i,a,n).then(e=>e(r,t)),deleteQueueHook:(i,a,n)=>QueueHookServiceApiFp(e).deleteQueueHook(i,a,n).then(e=>e(r,t)),patchQueueHook:(i,a,n,s)=>QueueHookServiceApiFp(e).patchQueueHook(i,a,n,s).then(e=>e(r,t)),readQueueHook:(i,a,n)=>QueueHookServiceApiFp(e).readQueueHook(i,a,n).then(e=>e(r,t)),searchQueueHook:(i,a,n,s,o,u,c,l,d,p)=>QueueHookServiceApiFp(e).searchQueueHook(i,a,n,s,o,u,c,l,d,p).then(e=>e(r,t)),updateQueueHook:(i,a,n,s)=>QueueHookServiceApiFp(e).updateQueueHook(i,a,n,s).then(e=>e(r,t))}};class QueueHookServiceApi extends BaseAPI{createQueueHook(e,t,r){return QueueHookServiceApiFp(this.configuration).createQueueHook(e,t,r).then(e=>e(this.axios,this.basePath))}deleteQueueHook(e,t,r){return QueueHookServiceApiFp(this.configuration).deleteQueueHook(e,t,r).then(e=>e(this.axios,this.basePath))}patchQueueHook(e,t,r,i){return QueueHookServiceApiFp(this.configuration).patchQueueHook(e,t,r,i).then(e=>e(this.axios,this.basePath))}readQueueHook(e,t,r){return QueueHookServiceApiFp(this.configuration).readQueueHook(e,t,r).then(e=>e(this.axios,this.basePath))}searchQueueHook(e,t,r,i,a,n,s,o,u,c){return QueueHookServiceApiFp(this.configuration).searchQueueHook(e,t,r,i,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}updateQueueHook(e,t,r,i){return QueueHookServiceApiFp(this.configuration).updateQueueHook(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const QueueResourcesServiceApiAxiosParamCreator=function(e){return{createQueueResourceGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueResourceGroup.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createQueueResourceGroup.");const a="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteQueueResourceGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueResourceGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteQueueResourceGroup.");const n="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},readQueueResourceGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueResourceGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readQueueResourceGroup.");const n="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchQueueResourceGroup:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchQueueResourceGroup.");const c="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.q=a),void 0!==n&&(y.sort=n),s&&(y.fields=s),o&&(y.id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},updateQueueResourceGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueResourceGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueResourceGroup.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateQueueResourceGroup.");const n="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},QueueResourcesServiceApiFp=function(e){return{async createQueueResourceGroup(t,r,i){const a=await QueueResourcesServiceApiAxiosParamCreator(e).createQueueResourceGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteQueueResourceGroup(t,r,i,a){const n=await QueueResourcesServiceApiAxiosParamCreator(e).deleteQueueResourceGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readQueueResourceGroup(t,r,i,a){const n=await QueueResourcesServiceApiAxiosParamCreator(e).readQueueResourceGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchQueueResourceGroup(t,r,i,a,n,s,o,u){const c=await QueueResourcesServiceApiAxiosParamCreator(e).searchQueueResourceGroup(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async updateQueueResourceGroup(t,r,i,a){const n=await QueueResourcesServiceApiAxiosParamCreator(e).updateQueueResourceGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},QueueResourcesServiceApiFactory=function(e,t,r){return{createQueueResourceGroup:(i,a,n)=>QueueResourcesServiceApiFp(e).createQueueResourceGroup(i,a,n).then(e=>e(r,t)),deleteQueueResourceGroup:(i,a,n,s)=>QueueResourcesServiceApiFp(e).deleteQueueResourceGroup(i,a,n,s).then(e=>e(r,t)),readQueueResourceGroup:(i,a,n,s)=>QueueResourcesServiceApiFp(e).readQueueResourceGroup(i,a,n,s).then(e=>e(r,t)),searchQueueResourceGroup:(i,a,n,s,o,u,c,l)=>QueueResourcesServiceApiFp(e).searchQueueResourceGroup(i,a,n,s,o,u,c,l).then(e=>e(r,t)),updateQueueResourceGroup:(i,a,n,s)=>QueueResourcesServiceApiFp(e).updateQueueResourceGroup(i,a,n,s).then(e=>e(r,t))}};class QueueResourcesServiceApi extends BaseAPI{createQueueResourceGroup(e,t,r){return QueueResourcesServiceApiFp(this.configuration).createQueueResourceGroup(e,t,r).then(e=>e(this.axios,this.basePath))}deleteQueueResourceGroup(e,t,r,i){return QueueResourcesServiceApiFp(this.configuration).deleteQueueResourceGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}readQueueResourceGroup(e,t,r,i){return QueueResourcesServiceApiFp(this.configuration).readQueueResourceGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchQueueResourceGroup(e,t,r,i,a,n,s,o){return QueueResourcesServiceApiFp(this.configuration).searchQueueResourceGroup(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateQueueResourceGroup(e,t,r,i){return QueueResourcesServiceApiFp(this.configuration).updateQueueResourceGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const QueueServiceApiAxiosParamCreator=function(e){return{createQueue:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createQueue.");const i=parse("/call_center/queues",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteQueue:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteQueue.");const a="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},patchQueue:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueue.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchQueue.");const a="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readQueue:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readQueue.");const a="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchQueue:async(t,r,i,a,n,s,o,u={})=>{const c=parse("/call_center/queues",!0);let l;e&&(l=e.baseOptions);const d={method:"GET",...l,...u},p={},h={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;p["X-Webitel-Access"]=t}void 0!==t&&(h.page=t),void 0!==r&&(h.size=r),void 0!==i&&(h.q=i),void 0!==a&&(h.sort=a),n&&(h.fields=n),s&&(h.id=s),o&&(h.type=o),c.query={...c.query,...h,...u.query},delete c.search;let y=l&&l.headers?l.headers:{};return d.headers={...p,...y,...u.headers},{url:format(c),options:d}},searchQueueReportGeneral:async(t,r,i,a,n,s,o,u,c,l,d,p={})=>{const h=parse("/call_center/queues/reports/general",!0);let y;e&&(y=e.baseOptions);const g={method:"GET",...y,...p},A={},m={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;A["X-Webitel-Access"]=t}void 0!==t&&(m.page=t),void 0!==r&&(m.size=r),void 0!==i&&(m["joined_at.from"]=i),void 0!==a&&(m["joined_at.to"]=a),void 0!==n&&(m.domain_id=n),s&&(m.fields=s),void 0!==o&&(m.sort=o),void 0!==u&&(m.q=u),c&&(m.queue_id=c),l&&(m.team_id=l),d&&(m.type=d),h.query={...h.query,...m,...p.query},delete h.search;let f=y&&y.headers?y.headers:{};return g.headers={...A,...f,...p.headers},{url:format(h),options:g}},updateQueue:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueue.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateQueue.");const a="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},QueueServiceApiFp=function(e){return{async createQueue(t,r){const i=await QueueServiceApiAxiosParamCreator(e).createQueue(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteQueue(t,r,i){const a=await QueueServiceApiAxiosParamCreator(e).deleteQueue(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchQueue(t,r,i){const a=await QueueServiceApiAxiosParamCreator(e).patchQueue(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readQueue(t,r,i){const a=await QueueServiceApiAxiosParamCreator(e).readQueue(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchQueue(t,r,i,a,n,s,o,u){const c=await QueueServiceApiAxiosParamCreator(e).searchQueue(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async searchQueueReportGeneral(t,r,i,a,n,s,o,u,c,l,d,p){const h=await QueueServiceApiAxiosParamCreator(e).searchQueueReportGeneral(t,r,i,a,n,s,o,u,c,l,d,p);return(e=globalAxios,t=BASE_PATH)=>{const r={...h.options,url:t+h.url};return e.request(r)}},async updateQueue(t,r,i){const a=await QueueServiceApiAxiosParamCreator(e).updateQueue(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},QueueServiceApiFactory=function(e,t,r){return{createQueue:(i,a)=>QueueServiceApiFp(e).createQueue(i,a).then(e=>e(r,t)),deleteQueue:(i,a,n)=>QueueServiceApiFp(e).deleteQueue(i,a,n).then(e=>e(r,t)),patchQueue:(i,a,n)=>QueueServiceApiFp(e).patchQueue(i,a,n).then(e=>e(r,t)),readQueue:(i,a,n)=>QueueServiceApiFp(e).readQueue(i,a,n).then(e=>e(r,t)),searchQueue:(i,a,n,s,o,u,c,l)=>QueueServiceApiFp(e).searchQueue(i,a,n,s,o,u,c,l).then(e=>e(r,t)),searchQueueReportGeneral:(i,a,n,s,o,u,c,l,d,p,h,y)=>QueueServiceApiFp(e).searchQueueReportGeneral(i,a,n,s,o,u,c,l,d,p,h,y).then(e=>e(r,t)),updateQueue:(i,a,n)=>QueueServiceApiFp(e).updateQueue(i,a,n).then(e=>e(r,t))}};class QueueServiceApi extends BaseAPI{createQueue(e,t){return QueueServiceApiFp(this.configuration).createQueue(e,t).then(e=>e(this.axios,this.basePath))}deleteQueue(e,t,r){return QueueServiceApiFp(this.configuration).deleteQueue(e,t,r).then(e=>e(this.axios,this.basePath))}patchQueue(e,t,r){return QueueServiceApiFp(this.configuration).patchQueue(e,t,r).then(e=>e(this.axios,this.basePath))}readQueue(e,t,r){return QueueServiceApiFp(this.configuration).readQueue(e,t,r).then(e=>e(this.axios,this.basePath))}searchQueue(e,t,r,i,a,n,s,o){return QueueServiceApiFp(this.configuration).searchQueue(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}searchQueueReportGeneral(e,t,r,i,a,n,s,o,u,c,l,d){return QueueServiceApiFp(this.configuration).searchQueueReportGeneral(e,t,r,i,a,n,s,o,u,c,l,d).then(e=>e(this.axios,this.basePath))}updateQueue(e,t,r){return QueueServiceApiFp(this.configuration).updateQueue(e,t,r).then(e=>e(this.axios,this.basePath))}}const QueueSkillServiceApiAxiosParamCreator=function(e){return{createQueueSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueSkill.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createQueueSkill.");const a="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteQueueSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteQueueSkill.");const a="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},patchQueueSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchQueueSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueueSkill.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling patchQueueSkill.");const n="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},readQueueSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readQueueSkill.");const a="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},searchQueueSkill:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchQueueSkill.");const g="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(t))),A=parse(g,!0);let m;e&&(m=e.baseOptions);const f={method:"GET",...m,...y},w={},b={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;w["X-Webitel-Access"]=t}void 0!==r&&(b.page=r),void 0!==i&&(b.size=i),void 0!==a&&(b.q=a),void 0!==n&&(b.sort=n),s&&(b.fields=s),o&&(b.id=o),u&&(b.skill_id=u),c&&(b.bucket_id=c),l&&(b.lvl=l),d&&(b.min_capacity=d),p&&(b.max_capacity=p),void 0!==h&&(b.enabled=h),A.query={...A.query,...b,...y.query},delete A.search;let S=m&&m.headers?m.headers:{};return f.headers={...w,...S,...y.headers},{url:format(A),options:f}},updateQueueSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueSkill.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateQueueSkill.");const n="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},QueueSkillServiceApiFp=function(e){return{async createQueueSkill(t,r,i){const a=await QueueSkillServiceApiAxiosParamCreator(e).createQueueSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteQueueSkill(t,r,i){const a=await QueueSkillServiceApiAxiosParamCreator(e).deleteQueueSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchQueueSkill(t,r,i,a){const n=await QueueSkillServiceApiAxiosParamCreator(e).patchQueueSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readQueueSkill(t,r,i){const a=await QueueSkillServiceApiAxiosParamCreator(e).readQueueSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchQueueSkill(t,r,i,a,n,s,o,u,c,l,d,p,h,y){const g=await QueueSkillServiceApiAxiosParamCreator(e).searchQueueSkill(t,r,i,a,n,s,o,u,c,l,d,p,h,y);return(e=globalAxios,t=BASE_PATH)=>{const r={...g.options,url:t+g.url};return e.request(r)}},async updateQueueSkill(t,r,i,a){const n=await QueueSkillServiceApiAxiosParamCreator(e).updateQueueSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},QueueSkillServiceApiFactory=function(e,t,r){return{createQueueSkill:(i,a,n)=>QueueSkillServiceApiFp(e).createQueueSkill(i,a,n).then(e=>e(r,t)),deleteQueueSkill:(i,a,n)=>QueueSkillServiceApiFp(e).deleteQueueSkill(i,a,n).then(e=>e(r,t)),patchQueueSkill:(i,a,n,s)=>QueueSkillServiceApiFp(e).patchQueueSkill(i,a,n,s).then(e=>e(r,t)),readQueueSkill:(i,a,n)=>QueueSkillServiceApiFp(e).readQueueSkill(i,a,n).then(e=>e(r,t)),searchQueueSkill:(i,a,n,s,o,u,c,l,d,p,h,y,g,A)=>QueueSkillServiceApiFp(e).searchQueueSkill(i,a,n,s,o,u,c,l,d,p,h,y,g,A).then(e=>e(r,t)),updateQueueSkill:(i,a,n,s)=>QueueSkillServiceApiFp(e).updateQueueSkill(i,a,n,s).then(e=>e(r,t))}};class QueueSkillServiceApi extends BaseAPI{createQueueSkill(e,t,r){return QueueSkillServiceApiFp(this.configuration).createQueueSkill(e,t,r).then(e=>e(this.axios,this.basePath))}deleteQueueSkill(e,t,r){return QueueSkillServiceApiFp(this.configuration).deleteQueueSkill(e,t,r).then(e=>e(this.axios,this.basePath))}patchQueueSkill(e,t,r,i){return QueueSkillServiceApiFp(this.configuration).patchQueueSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}readQueueSkill(e,t,r){return QueueSkillServiceApiFp(this.configuration).readQueueSkill(e,t,r).then(e=>e(this.axios,this.basePath))}searchQueueSkill(e,t,r,i,a,n,s,o,u,c,l,d,p,h){return QueueSkillServiceApiFp(this.configuration).searchQueueSkill(e,t,r,i,a,n,s,o,u,c,l,d,p,h).then(e=>e(this.axios,this.basePath))}updateQueueSkill(e,t,r,i){return QueueSkillServiceApiFp(this.configuration).updateQueueSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const RegionServiceApiAxiosParamCreator=function(e){return{createRegion:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRegion.");const i=parse("/regions",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteRegion:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteRegion.");const i="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchRegion:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchRegion.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchRegion.");const a="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readRegion:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readRegion.");const i="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchRegion:async(t,r,i,a,n,s,o,u,c,l={})=>{const d=parse("/regions",!0);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...l},y={},g={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;y["X-Webitel-Access"]=t}void 0!==t&&(g.page=t),void 0!==r&&(g.size=r),void 0!==i&&(g.q=i),void 0!==a&&(g.sort=a),n&&(g.fields=n),s&&(g.id=s),void 0!==o&&(g.name=o),void 0!==u&&(g.description=u),c&&(g.timezone_id=c),d.query={...d.query,...g,...l.query},delete d.search;let A=p&&p.headers?p.headers:{};return h.headers={...y,...A,...l.headers},{url:format(d),options:h}},updateRegion:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRegion.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateRegion.");const a="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},RegionServiceApiFp=function(e){return{async createRegion(t,r){const i=await RegionServiceApiAxiosParamCreator(e).createRegion(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteRegion(t,r){const i=await RegionServiceApiAxiosParamCreator(e).deleteRegion(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchRegion(t,r,i){const a=await RegionServiceApiAxiosParamCreator(e).patchRegion(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readRegion(t,r){const i=await RegionServiceApiAxiosParamCreator(e).readRegion(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchRegion(t,r,i,a,n,s,o,u,c,l){const d=await RegionServiceApiAxiosParamCreator(e).searchRegion(t,r,i,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async updateRegion(t,r,i){const a=await RegionServiceApiAxiosParamCreator(e).updateRegion(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RegionServiceApiFactory=function(e,t,r){return{createRegion:(i,a)=>RegionServiceApiFp(e).createRegion(i,a).then(e=>e(r,t)),deleteRegion:(i,a)=>RegionServiceApiFp(e).deleteRegion(i,a).then(e=>e(r,t)),patchRegion:(i,a,n)=>RegionServiceApiFp(e).patchRegion(i,a,n).then(e=>e(r,t)),readRegion:(i,a)=>RegionServiceApiFp(e).readRegion(i,a).then(e=>e(r,t)),searchRegion:(i,a,n,s,o,u,c,l,d,p)=>RegionServiceApiFp(e).searchRegion(i,a,n,s,o,u,c,l,d,p).then(e=>e(r,t)),updateRegion:(i,a,n)=>RegionServiceApiFp(e).updateRegion(i,a,n).then(e=>e(r,t))}};class RegionServiceApi extends BaseAPI{createRegion(e,t){return RegionServiceApiFp(this.configuration).createRegion(e,t).then(e=>e(this.axios,this.basePath))}deleteRegion(e,t){return RegionServiceApiFp(this.configuration).deleteRegion(e,t).then(e=>e(this.axios,this.basePath))}patchRegion(e,t,r){return RegionServiceApiFp(this.configuration).patchRegion(e,t,r).then(e=>e(this.axios,this.basePath))}readRegion(e,t){return RegionServiceApiFp(this.configuration).readRegion(e,t).then(e=>e(this.axios,this.basePath))}searchRegion(e,t,r,i,a,n,s,o,u,c){return RegionServiceApiFp(this.configuration).searchRegion(e,t,r,i,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}updateRegion(e,t,r){return RegionServiceApiFp(this.configuration).updateRegion(e,t,r).then(e=>e(this.axios,this.basePath))}}const RoutingChatPlanServiceApiAxiosParamCreator=function(e){return{createChatPlan:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createChatPlan.");const i=parse("/routing/outbound/chat",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteChatPlan:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteChatPlan.");const i="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchChatPlan:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchChatPlan.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchChatPlan.");const a="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readChatPlan:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readChatPlan.");const i="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchChatPlan:async(t,r,i,a,n,s,o,u,c={})=>{const l=parse("/routing/outbound/chat",!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==t&&(y.page=t),void 0!==r&&(y.size=r),void 0!==i&&(y.q=i),void 0!==a&&(y.sort=a),n&&(y.fields=n),s&&(y.id=s),void 0!==o&&(y.name=o),void 0!==u&&(y.enabled=u),l.query={...l.query,...y,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},updateChatPlan:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateChatPlan.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateChatPlan.");const a="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},RoutingChatPlanServiceApiFp=function(e){return{async createChatPlan(t,r){const i=await RoutingChatPlanServiceApiAxiosParamCreator(e).createChatPlan(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteChatPlan(t,r){const i=await RoutingChatPlanServiceApiAxiosParamCreator(e).deleteChatPlan(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchChatPlan(t,r,i){const a=await RoutingChatPlanServiceApiAxiosParamCreator(e).patchChatPlan(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readChatPlan(t,r){const i=await RoutingChatPlanServiceApiAxiosParamCreator(e).readChatPlan(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchChatPlan(t,r,i,a,n,s,o,u,c){const l=await RoutingChatPlanServiceApiAxiosParamCreator(e).searchChatPlan(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async updateChatPlan(t,r,i){const a=await RoutingChatPlanServiceApiAxiosParamCreator(e).updateChatPlan(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RoutingChatPlanServiceApiFactory=function(e,t,r){return{createChatPlan:(i,a)=>RoutingChatPlanServiceApiFp(e).createChatPlan(i,a).then(e=>e(r,t)),deleteChatPlan:(i,a)=>RoutingChatPlanServiceApiFp(e).deleteChatPlan(i,a).then(e=>e(r,t)),patchChatPlan:(i,a,n)=>RoutingChatPlanServiceApiFp(e).patchChatPlan(i,a,n).then(e=>e(r,t)),readChatPlan:(i,a)=>RoutingChatPlanServiceApiFp(e).readChatPlan(i,a).then(e=>e(r,t)),searchChatPlan:(i,a,n,s,o,u,c,l,d)=>RoutingChatPlanServiceApiFp(e).searchChatPlan(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),updateChatPlan:(i,a,n)=>RoutingChatPlanServiceApiFp(e).updateChatPlan(i,a,n).then(e=>e(r,t))}};class RoutingChatPlanServiceApi extends BaseAPI{createChatPlan(e,t){return RoutingChatPlanServiceApiFp(this.configuration).createChatPlan(e,t).then(e=>e(this.axios,this.basePath))}deleteChatPlan(e,t){return RoutingChatPlanServiceApiFp(this.configuration).deleteChatPlan(e,t).then(e=>e(this.axios,this.basePath))}patchChatPlan(e,t,r){return RoutingChatPlanServiceApiFp(this.configuration).patchChatPlan(e,t,r).then(e=>e(this.axios,this.basePath))}readChatPlan(e,t){return RoutingChatPlanServiceApiFp(this.configuration).readChatPlan(e,t).then(e=>e(this.axios,this.basePath))}searchChatPlan(e,t,r,i,a,n,s,o,u){return RoutingChatPlanServiceApiFp(this.configuration).searchChatPlan(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateChatPlan(e,t,r){return RoutingChatPlanServiceApiFp(this.configuration).updateChatPlan(e,t,r).then(e=>e(this.axios,this.basePath))}}const RoutingOutboundCallServiceApiAxiosParamCreator=function(e){return{createRoutingOutboundCall:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRoutingOutboundCall.");const i=parse("/routing/outbound/calls",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteRoutingOutboundCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteRoutingOutboundCall.");const a="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},movePositionRoutingOutboundCall:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("fromId","Required parameter fromId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==r)throw new RequiredError("toId","Required parameter toId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling movePositionRoutingOutboundCall.");const n="/routing/outbound/calls/{from_id}/to/{to_id}".replace("{from_id}",encodeURIComponent(String(t))).replace("{to_id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},patchRoutingOutboundCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchRoutingOutboundCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchRoutingOutboundCall.");const a="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readRoutingOutboundCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readRoutingOutboundCall.");const a="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchRoutingOutboundCall:async(t,r,i,a,n,s,o,u,c,l,d={})=>{const p=parse("/routing/outbound/calls",!0);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...d},g={},A={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==t&&(A.page=t),void 0!==r&&(A.size=r),void 0!==i&&(A.q=i),void 0!==a&&(A.sort=a),n&&(A.fields=n),s&&(A.id=s),void 0!==o&&(A.name=o),u&&(A.schema_id=u),void 0!==c&&(A.pattern=c),void 0!==l&&(A.description=l),p.query={...p.query,...A,...d.query},delete p.search;let m=h&&h.headers?h.headers:{};return y.headers={...g,...m,...d.headers},{url:format(p),options:y}},updateRoutingOutboundCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRoutingOutboundCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateRoutingOutboundCall.");const a="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},RoutingOutboundCallServiceApiFp=function(e){return{async createRoutingOutboundCall(t,r){const i=await RoutingOutboundCallServiceApiAxiosParamCreator(e).createRoutingOutboundCall(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteRoutingOutboundCall(t,r,i){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).deleteRoutingOutboundCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async movePositionRoutingOutboundCall(t,r,i,a){const n=await RoutingOutboundCallServiceApiAxiosParamCreator(e).movePositionRoutingOutboundCall(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async patchRoutingOutboundCall(t,r,i){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).patchRoutingOutboundCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readRoutingOutboundCall(t,r,i){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).readRoutingOutboundCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchRoutingOutboundCall(t,r,i,a,n,s,o,u,c,l,d){const p=await RoutingOutboundCallServiceApiAxiosParamCreator(e).searchRoutingOutboundCall(t,r,i,a,n,s,o,u,c,l,d);return(e=globalAxios,t=BASE_PATH)=>{const r={...p.options,url:t+p.url};return e.request(r)}},async updateRoutingOutboundCall(t,r,i){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).updateRoutingOutboundCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RoutingOutboundCallServiceApiFactory=function(e,t,r){return{createRoutingOutboundCall:(i,a)=>RoutingOutboundCallServiceApiFp(e).createRoutingOutboundCall(i,a).then(e=>e(r,t)),deleteRoutingOutboundCall:(i,a,n)=>RoutingOutboundCallServiceApiFp(e).deleteRoutingOutboundCall(i,a,n).then(e=>e(r,t)),movePositionRoutingOutboundCall:(i,a,n,s)=>RoutingOutboundCallServiceApiFp(e).movePositionRoutingOutboundCall(i,a,n,s).then(e=>e(r,t)),patchRoutingOutboundCall:(i,a,n)=>RoutingOutboundCallServiceApiFp(e).patchRoutingOutboundCall(i,a,n).then(e=>e(r,t)),readRoutingOutboundCall:(i,a,n)=>RoutingOutboundCallServiceApiFp(e).readRoutingOutboundCall(i,a,n).then(e=>e(r,t)),searchRoutingOutboundCall:(i,a,n,s,o,u,c,l,d,p,h)=>RoutingOutboundCallServiceApiFp(e).searchRoutingOutboundCall(i,a,n,s,o,u,c,l,d,p,h).then(e=>e(r,t)),updateRoutingOutboundCall:(i,a,n)=>RoutingOutboundCallServiceApiFp(e).updateRoutingOutboundCall(i,a,n).then(e=>e(r,t))}};class RoutingOutboundCallServiceApi extends BaseAPI{createRoutingOutboundCall(e,t){return RoutingOutboundCallServiceApiFp(this.configuration).createRoutingOutboundCall(e,t).then(e=>e(this.axios,this.basePath))}deleteRoutingOutboundCall(e,t,r){return RoutingOutboundCallServiceApiFp(this.configuration).deleteRoutingOutboundCall(e,t,r).then(e=>e(this.axios,this.basePath))}movePositionRoutingOutboundCall(e,t,r,i){return RoutingOutboundCallServiceApiFp(this.configuration).movePositionRoutingOutboundCall(e,t,r,i).then(e=>e(this.axios,this.basePath))}patchRoutingOutboundCall(e,t,r){return RoutingOutboundCallServiceApiFp(this.configuration).patchRoutingOutboundCall(e,t,r).then(e=>e(this.axios,this.basePath))}readRoutingOutboundCall(e,t,r){return RoutingOutboundCallServiceApiFp(this.configuration).readRoutingOutboundCall(e,t,r).then(e=>e(this.axios,this.basePath))}searchRoutingOutboundCall(e,t,r,i,a,n,s,o,u,c,l){return RoutingOutboundCallServiceApiFp(this.configuration).searchRoutingOutboundCall(e,t,r,i,a,n,s,o,u,c,l).then(e=>e(this.axios,this.basePath))}updateRoutingOutboundCall(e,t,r){return RoutingOutboundCallServiceApiFp(this.configuration).updateRoutingOutboundCall(e,t,r).then(e=>e(this.axios,this.basePath))}}const RoutingSchemaServiceApiAxiosParamCreator=function(e){return{createRoutingSchema:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRoutingSchema.");const i=parse("/routing/schema",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteRoutingSchema:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteRoutingSchema.");const a="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},patchRoutingSchema:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchRoutingSchema.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchRoutingSchema.");const a="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readRoutingSchema:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readRoutingSchema.");const a="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchRoutingSchema:async(t,r,i,a,n,s,o,u,c,l,d={})=>{const p=parse("/routing/schema",!0);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...d},g={},A={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==t&&(A.page=t),void 0!==r&&(A.size=r),void 0!==i&&(A.q=i),void 0!==a&&(A.sort=a),n&&(A.fields=n),s&&(A.id=s),void 0!==o&&(A.name=o),u&&(A.type=u),void 0!==c&&(A.editor=c),l&&(A.tags=l),p.query={...p.query,...A,...d.query},delete p.search;let m=h&&h.headers?h.headers:{};return y.headers={...g,...m,...d.headers},{url:format(p),options:y}},searchRoutingSchemaTags:async(t,r,i,a,n,s,o={})=>{const u=parse("/routing/schema/tags",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.type=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateRoutingSchema:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRoutingSchema.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateRoutingSchema.");const a="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},RoutingSchemaServiceApiFp=function(e){return{async createRoutingSchema(t,r){const i=await RoutingSchemaServiceApiAxiosParamCreator(e).createRoutingSchema(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteRoutingSchema(t,r,i){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).deleteRoutingSchema(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchRoutingSchema(t,r,i){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).patchRoutingSchema(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readRoutingSchema(t,r,i){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).readRoutingSchema(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchRoutingSchema(t,r,i,a,n,s,o,u,c,l,d){const p=await RoutingSchemaServiceApiAxiosParamCreator(e).searchRoutingSchema(t,r,i,a,n,s,o,u,c,l,d);return(e=globalAxios,t=BASE_PATH)=>{const r={...p.options,url:t+p.url};return e.request(r)}},async searchRoutingSchemaTags(t,r,i,a,n,s,o){const u=await RoutingSchemaServiceApiAxiosParamCreator(e).searchRoutingSchemaTags(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateRoutingSchema(t,r,i){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).updateRoutingSchema(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RoutingSchemaServiceApiFactory=function(e,t,r){return{createRoutingSchema:(i,a)=>RoutingSchemaServiceApiFp(e).createRoutingSchema(i,a).then(e=>e(r,t)),deleteRoutingSchema:(i,a,n)=>RoutingSchemaServiceApiFp(e).deleteRoutingSchema(i,a,n).then(e=>e(r,t)),patchRoutingSchema:(i,a,n)=>RoutingSchemaServiceApiFp(e).patchRoutingSchema(i,a,n).then(e=>e(r,t)),readRoutingSchema:(i,a,n)=>RoutingSchemaServiceApiFp(e).readRoutingSchema(i,a,n).then(e=>e(r,t)),searchRoutingSchema:(i,a,n,s,o,u,c,l,d,p,h)=>RoutingSchemaServiceApiFp(e).searchRoutingSchema(i,a,n,s,o,u,c,l,d,p,h).then(e=>e(r,t)),searchRoutingSchemaTags:(i,a,n,s,o,u,c)=>RoutingSchemaServiceApiFp(e).searchRoutingSchemaTags(i,a,n,s,o,u,c).then(e=>e(r,t)),updateRoutingSchema:(i,a,n)=>RoutingSchemaServiceApiFp(e).updateRoutingSchema(i,a,n).then(e=>e(r,t))}};class RoutingSchemaServiceApi extends BaseAPI{createRoutingSchema(e,t){return RoutingSchemaServiceApiFp(this.configuration).createRoutingSchema(e,t).then(e=>e(this.axios,this.basePath))}deleteRoutingSchema(e,t,r){return RoutingSchemaServiceApiFp(this.configuration).deleteRoutingSchema(e,t,r).then(e=>e(this.axios,this.basePath))}patchRoutingSchema(e,t,r){return RoutingSchemaServiceApiFp(this.configuration).patchRoutingSchema(e,t,r).then(e=>e(this.axios,this.basePath))}readRoutingSchema(e,t,r){return RoutingSchemaServiceApiFp(this.configuration).readRoutingSchema(e,t,r).then(e=>e(this.axios,this.basePath))}searchRoutingSchema(e,t,r,i,a,n,s,o,u,c,l){return RoutingSchemaServiceApiFp(this.configuration).searchRoutingSchema(e,t,r,i,a,n,s,o,u,c,l).then(e=>e(this.axios,this.basePath))}searchRoutingSchemaTags(e,t,r,i,a,n,s){return RoutingSchemaServiceApiFp(this.configuration).searchRoutingSchemaTags(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateRoutingSchema(e,t,r){return RoutingSchemaServiceApiFp(this.configuration).updateRoutingSchema(e,t,r).then(e=>e(this.axios,this.basePath))}}const RoutingVariableServiceApiAxiosParamCreator=function(e){return{createRoutingVariable:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRoutingVariable.");const i=parse("/routing/variables",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteRoutingVariable:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteRoutingVariable.");const a="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readRoutingVariable:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readRoutingVariable.");const a="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchRoutingVariable:async(t,r,i,a={})=>{const n=parse("/routing/variables",!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...a},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==t&&(c.page=t),void 0!==r&&(c.size=r),void 0!==i&&(c.domain_id=i),n.query={...n.query,...c,...a.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...a.headers},{url:format(n),options:o}},updateRoutingVariable:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRoutingVariable.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateRoutingVariable.");const a="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},RoutingVariableServiceApiFp=function(e){return{async createRoutingVariable(t,r){const i=await RoutingVariableServiceApiAxiosParamCreator(e).createRoutingVariable(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteRoutingVariable(t,r,i){const a=await RoutingVariableServiceApiAxiosParamCreator(e).deleteRoutingVariable(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readRoutingVariable(t,r,i){const a=await RoutingVariableServiceApiAxiosParamCreator(e).readRoutingVariable(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchRoutingVariable(t,r,i,a){const n=await RoutingVariableServiceApiAxiosParamCreator(e).searchRoutingVariable(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async updateRoutingVariable(t,r,i){const a=await RoutingVariableServiceApiAxiosParamCreator(e).updateRoutingVariable(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RoutingVariableServiceApiFactory=function(e,t,r){return{createRoutingVariable:(i,a)=>RoutingVariableServiceApiFp(e).createRoutingVariable(i,a).then(e=>e(r,t)),deleteRoutingVariable:(i,a,n)=>RoutingVariableServiceApiFp(e).deleteRoutingVariable(i,a,n).then(e=>e(r,t)),readRoutingVariable:(i,a,n)=>RoutingVariableServiceApiFp(e).readRoutingVariable(i,a,n).then(e=>e(r,t)),searchRoutingVariable:(i,a,n,s)=>RoutingVariableServiceApiFp(e).searchRoutingVariable(i,a,n,s).then(e=>e(r,t)),updateRoutingVariable:(i,a,n)=>RoutingVariableServiceApiFp(e).updateRoutingVariable(i,a,n).then(e=>e(r,t))}};class RoutingVariableServiceApi extends BaseAPI{createRoutingVariable(e,t){return RoutingVariableServiceApiFp(this.configuration).createRoutingVariable(e,t).then(e=>e(this.axios,this.basePath))}deleteRoutingVariable(e,t,r){return RoutingVariableServiceApiFp(this.configuration).deleteRoutingVariable(e,t,r).then(e=>e(this.axios,this.basePath))}readRoutingVariable(e,t,r){return RoutingVariableServiceApiFp(this.configuration).readRoutingVariable(e,t,r).then(e=>e(this.axios,this.basePath))}searchRoutingVariable(e,t,r,i){return RoutingVariableServiceApiFp(this.configuration).searchRoutingVariable(e,t,r,i).then(e=>e(this.axios,this.basePath))}updateRoutingVariable(e,t,r){return RoutingVariableServiceApiFp(this.configuration).updateRoutingVariable(e,t,r).then(e=>e(this.axios,this.basePath))}}const SkillServiceApiAxiosParamCreator=function(e){return{createSkill:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createSkill.");const i=parse("/call_center/skills",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},createSkillAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("skillId","Required parameter skillId was null or undefined when calling createSkillAgent.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createSkillAgent.");const a="/call_center/skills/{skill_id}/agents".replace("{skill_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteSkill.");const a="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},deleteSkillAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("skillId","Required parameter skillId was null or undefined when calling deleteSkillAgent.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling deleteSkillAgent.");const a="/call_center/skills/{skill_id}/agents".replace("{skill_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},patchSkillAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("skillId","Required parameter skillId was null or undefined when calling patchSkillAgent.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchSkillAgent.");const a="/call_center/skills/{skill_id}/agents".replace("{skill_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readSkill.");const a="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchSkill:async(t,r,i,a,n,s,o={})=>{const u=parse("/call_center/skills",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},searchSkillAgent:async(t,r,i,a,n,s,o,u,c={})=>{if(null==t)throw new RequiredError("skillId","Required parameter skillId was null or undefined when calling searchSkillAgent.");const l="/call_center/skills/{skill_id}/agents".replace("{skill_id}",encodeURIComponent(String(t))),d=parse(l,!0);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...c},y={},g={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;y["X-Webitel-Access"]=t}void 0!==r&&(g.page=r),void 0!==i&&(g.size=i),void 0!==a&&(g.q=a),void 0!==n&&(g.sort=n),s&&(g.fields=s),o&&(g.id=o),u&&(g.agent_id=u),d.query={...d.query,...g,...c.query},delete d.search;let A=p&&p.headers?p.headers:{};return h.headers={...y,...A,...c.headers},{url:format(d),options:h}},updateSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateSkill.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateSkill.");const a="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},SkillServiceApiFp=function(e){return{async createSkill(t,r){const i=await SkillServiceApiAxiosParamCreator(e).createSkill(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createSkillAgent(t,r,i){const a=await SkillServiceApiAxiosParamCreator(e).createSkillAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteSkill(t,r,i){const a=await SkillServiceApiAxiosParamCreator(e).deleteSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteSkillAgent(t,r,i){const a=await SkillServiceApiAxiosParamCreator(e).deleteSkillAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchSkillAgent(t,r,i){const a=await SkillServiceApiAxiosParamCreator(e).patchSkillAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readSkill(t,r,i){const a=await SkillServiceApiAxiosParamCreator(e).readSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchSkill(t,r,i,a,n,s,o){const u=await SkillServiceApiAxiosParamCreator(e).searchSkill(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async searchSkillAgent(t,r,i,a,n,s,o,u,c){const l=await SkillServiceApiAxiosParamCreator(e).searchSkillAgent(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async updateSkill(t,r,i){const a=await SkillServiceApiAxiosParamCreator(e).updateSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},SkillServiceApiFactory=function(e,t,r){return{createSkill:(i,a)=>SkillServiceApiFp(e).createSkill(i,a).then(e=>e(r,t)),createSkillAgent:(i,a,n)=>SkillServiceApiFp(e).createSkillAgent(i,a,n).then(e=>e(r,t)),deleteSkill:(i,a,n)=>SkillServiceApiFp(e).deleteSkill(i,a,n).then(e=>e(r,t)),deleteSkillAgent:(i,a,n)=>SkillServiceApiFp(e).deleteSkillAgent(i,a,n).then(e=>e(r,t)),patchSkillAgent:(i,a,n)=>SkillServiceApiFp(e).patchSkillAgent(i,a,n).then(e=>e(r,t)),readSkill:(i,a,n)=>SkillServiceApiFp(e).readSkill(i,a,n).then(e=>e(r,t)),searchSkill:(i,a,n,s,o,u,c)=>SkillServiceApiFp(e).searchSkill(i,a,n,s,o,u,c).then(e=>e(r,t)),searchSkillAgent:(i,a,n,s,o,u,c,l,d)=>SkillServiceApiFp(e).searchSkillAgent(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),updateSkill:(i,a,n)=>SkillServiceApiFp(e).updateSkill(i,a,n).then(e=>e(r,t))}};class SkillServiceApi extends BaseAPI{createSkill(e,t){return SkillServiceApiFp(this.configuration).createSkill(e,t).then(e=>e(this.axios,this.basePath))}createSkillAgent(e,t,r){return SkillServiceApiFp(this.configuration).createSkillAgent(e,t,r).then(e=>e(this.axios,this.basePath))}deleteSkill(e,t,r){return SkillServiceApiFp(this.configuration).deleteSkill(e,t,r).then(e=>e(this.axios,this.basePath))}deleteSkillAgent(e,t,r){return SkillServiceApiFp(this.configuration).deleteSkillAgent(e,t,r).then(e=>e(this.axios,this.basePath))}patchSkillAgent(e,t,r){return SkillServiceApiFp(this.configuration).patchSkillAgent(e,t,r).then(e=>e(this.axios,this.basePath))}readSkill(e,t,r){return SkillServiceApiFp(this.configuration).readSkill(e,t,r).then(e=>e(this.axios,this.basePath))}searchSkill(e,t,r,i,a,n,s){return SkillServiceApiFp(this.configuration).searchSkill(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}searchSkillAgent(e,t,r,i,a,n,s,o,u){return SkillServiceApiFp(this.configuration).searchSkillAgent(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateSkill(e,t,r){return SkillServiceApiFp(this.configuration).updateSkill(e,t,r).then(e=>e(this.axios,this.basePath))}}const SystemSettingServiceApiAxiosParamCreator=function(e){return{createSystemSetting:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createSystemSetting.");const i=parse("/settings",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteSystemSetting:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteSystemSetting.");const i="/settings/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchSystemSetting:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchSystemSetting.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchSystemSetting.");const a="/settings/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readSystemSetting:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readSystemSetting.");const i="/settings/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchAvailableSystemSetting:async(t={})=>{const r=parse("/settings/available",!0);let i;e&&(i=e.baseOptions);const a={method:"GET",...i,...t},n={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;n["X-Webitel-Access"]=t}r.query={...r.query,...t.query},delete r.search;let s=i&&i.headers?i.headers:{};return a.headers={...n,...s,...t.headers},{url:format(r),options:a}},searchSystemSetting:async(t,r,i,a,n,s={})=>{const o=parse("/settings",!0);let u;e&&(u=e.baseOptions);const c={method:"GET",...u,...s},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}void 0!==t&&(d.page=t),void 0!==r&&(d.size=r),void 0!==i&&(d.q=i),void 0!==a&&(d.sort=a),n&&(d.fields=n),o.query={...o.query,...d,...s.query},delete o.search;let p=u&&u.headers?u.headers:{};return c.headers={...l,...p,...s.headers},{url:format(o),options:c}},updateSystemSetting:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateSystemSetting.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateSystemSetting.");const a="/settings/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},SystemSettingServiceApiFp=function(e){return{async createSystemSetting(t,r){const i=await SystemSettingServiceApiAxiosParamCreator(e).createSystemSetting(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteSystemSetting(t,r){const i=await SystemSettingServiceApiAxiosParamCreator(e).deleteSystemSetting(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchSystemSetting(t,r,i){const a=await SystemSettingServiceApiAxiosParamCreator(e).patchSystemSetting(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readSystemSetting(t,r){const i=await SystemSettingServiceApiAxiosParamCreator(e).readSystemSetting(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchAvailableSystemSetting(t){const r=await SystemSettingServiceApiAxiosParamCreator(e).searchAvailableSystemSetting(t);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async searchSystemSetting(t,r,i,a,n,s){const o=await SystemSettingServiceApiAxiosParamCreator(e).searchSystemSetting(t,r,i,a,n,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...o.options,url:t+o.url};return e.request(r)}},async updateSystemSetting(t,r,i){const a=await SystemSettingServiceApiAxiosParamCreator(e).updateSystemSetting(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},SystemSettingServiceApiFactory=function(e,t,r){return{createSystemSetting:(i,a)=>SystemSettingServiceApiFp(e).createSystemSetting(i,a).then(e=>e(r,t)),deleteSystemSetting:(i,a)=>SystemSettingServiceApiFp(e).deleteSystemSetting(i,a).then(e=>e(r,t)),patchSystemSetting:(i,a,n)=>SystemSettingServiceApiFp(e).patchSystemSetting(i,a,n).then(e=>e(r,t)),readSystemSetting:(i,a)=>SystemSettingServiceApiFp(e).readSystemSetting(i,a).then(e=>e(r,t)),searchAvailableSystemSetting:i=>SystemSettingServiceApiFp(e).searchAvailableSystemSetting(i).then(e=>e(r,t)),searchSystemSetting:(i,a,n,s,o,u)=>SystemSettingServiceApiFp(e).searchSystemSetting(i,a,n,s,o,u).then(e=>e(r,t)),updateSystemSetting:(i,a,n)=>SystemSettingServiceApiFp(e).updateSystemSetting(i,a,n).then(e=>e(r,t))}};class SystemSettingServiceApi extends BaseAPI{createSystemSetting(e,t){return SystemSettingServiceApiFp(this.configuration).createSystemSetting(e,t).then(e=>e(this.axios,this.basePath))}deleteSystemSetting(e,t){return SystemSettingServiceApiFp(this.configuration).deleteSystemSetting(e,t).then(e=>e(this.axios,this.basePath))}patchSystemSetting(e,t,r){return SystemSettingServiceApiFp(this.configuration).patchSystemSetting(e,t,r).then(e=>e(this.axios,this.basePath))}readSystemSetting(e,t){return SystemSettingServiceApiFp(this.configuration).readSystemSetting(e,t).then(e=>e(this.axios,this.basePath))}searchAvailableSystemSetting(e){return SystemSettingServiceApiFp(this.configuration).searchAvailableSystemSetting(e).then(e=>e(this.axios,this.basePath))}searchSystemSetting(e,t,r,i,a,n){return SystemSettingServiceApiFp(this.configuration).searchSystemSetting(e,t,r,i,a,n).then(e=>e(this.axios,this.basePath))}updateSystemSetting(e,t,r){return SystemSettingServiceApiFp(this.configuration).updateSystemSetting(e,t,r).then(e=>e(this.axios,this.basePath))}}const TimezonesApiAxiosParamCreator=function(e){return{deleteTimezone:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deleteTimezone.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteTimezone.");const n="/contacts/{contact_id}/timezones/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},deleteTimezones:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deleteTimezones.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteTimezones.");const n="/contacts/{contact_id}/timezones".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),r&&(l.etag=r),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},listTimezones:async(t,r,i,a,n,s,o,u,c={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling listTimezones.");const l="/contacts/{contact_id}/timezones".replace("{contact_id}",encodeURIComponent(String(t))),d=parse(l,!0);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...c},y={},g={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;y["X-Webitel-Access"]=t}void 0!==r&&(g.page=r),void 0!==i&&(g.size=i),void 0!==a&&(g.q=a),n&&(g.sort=n),s&&(g.fields=s),o&&(g.id=o),void 0!==u&&(g.primary=u),d.query={...d.query,...g,...c.query},delete d.search;let A=p&&p.headers?p.headers:{};return h.headers={...y,...A,...c.headers},{url:format(d),options:h}},locateTimezone:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling locateTimezone.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling locateTimezone.");const n="/contacts/{contact_id}/timezones/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},mergeTimezones:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling mergeTimezones.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling mergeTimezones.");const n="/contacts/{contact_id}/timezones".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"POST",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},resetTimezones:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling resetTimezones.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling resetTimezones.");const n="/contacts/{contact_id}/timezones".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},updateTimezone:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updateTimezone.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updateTimezone.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updateTimezone.");const s="/contacts/{contact_id}/timezones/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PUT",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}},updateTimezone2:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updateTimezone2.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updateTimezone2.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updateTimezone2.");const s="/contacts/{contact_id}/timezones/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PATCH",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},TimezonesApiFp=function(e){return{async deleteTimezone(t,r,i,a){const n=await TimezonesApiAxiosParamCreator(e).deleteTimezone(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async deleteTimezones(t,r,i,a){const n=await TimezonesApiAxiosParamCreator(e).deleteTimezones(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async listTimezones(t,r,i,a,n,s,o,u,c){const l=await TimezonesApiAxiosParamCreator(e).listTimezones(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async locateTimezone(t,r,i,a){const n=await TimezonesApiAxiosParamCreator(e).locateTimezone(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async mergeTimezones(t,r,i,a){const n=await TimezonesApiAxiosParamCreator(e).mergeTimezones(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async resetTimezones(t,r,i,a){const n=await TimezonesApiAxiosParamCreator(e).resetTimezones(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async updateTimezone(t,r,i,a,n){const s=await TimezonesApiAxiosParamCreator(e).updateTimezone(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async updateTimezone2(t,r,i,a,n){const s=await TimezonesApiAxiosParamCreator(e).updateTimezone2(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}}}},TimezonesApiFactory=function(e,t,r){return{deleteTimezone:(i,a,n,s)=>TimezonesApiFp(e).deleteTimezone(i,a,n,s).then(e=>e(r,t)),deleteTimezones:(i,a,n,s)=>TimezonesApiFp(e).deleteTimezones(i,a,n,s).then(e=>e(r,t)),listTimezones:(i,a,n,s,o,u,c,l,d)=>TimezonesApiFp(e).listTimezones(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),locateTimezone:(i,a,n,s)=>TimezonesApiFp(e).locateTimezone(i,a,n,s).then(e=>e(r,t)),mergeTimezones:(i,a,n,s)=>TimezonesApiFp(e).mergeTimezones(i,a,n,s).then(e=>e(r,t)),resetTimezones:(i,a,n,s)=>TimezonesApiFp(e).resetTimezones(i,a,n,s).then(e=>e(r,t)),updateTimezone:(i,a,n,s,o)=>TimezonesApiFp(e).updateTimezone(i,a,n,s,o).then(e=>e(r,t)),updateTimezone2:(i,a,n,s,o)=>TimezonesApiFp(e).updateTimezone2(i,a,n,s,o).then(e=>e(r,t))}};class TimezonesApi extends BaseAPI{deleteTimezone(e,t,r,i){return TimezonesApiFp(this.configuration).deleteTimezone(e,t,r,i).then(e=>e(this.axios,this.basePath))}deleteTimezones(e,t,r,i){return TimezonesApiFp(this.configuration).deleteTimezones(e,t,r,i).then(e=>e(this.axios,this.basePath))}listTimezones(e,t,r,i,a,n,s,o,u){return TimezonesApiFp(this.configuration).listTimezones(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}locateTimezone(e,t,r,i){return TimezonesApiFp(this.configuration).locateTimezone(e,t,r,i).then(e=>e(this.axios,this.basePath))}mergeTimezones(e,t,r,i){return TimezonesApiFp(this.configuration).mergeTimezones(e,t,r,i).then(e=>e(this.axios,this.basePath))}resetTimezones(e,t,r,i){return TimezonesApiFp(this.configuration).resetTimezones(e,t,r,i).then(e=>e(this.axios,this.basePath))}updateTimezone(e,t,r,i,a){return TimezonesApiFp(this.configuration).updateTimezone(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}updateTimezone2(e,t,r,i,a){return TimezonesApiFp(this.configuration).updateTimezone2(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}}const TriggerServiceApiAxiosParamCreator=function(e){return{createTrigger:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createTrigger.");const i=parse("/trigger",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},createTriggerJob:async(t,r,i={})=>{if(null==t)throw new RequiredError("triggerId","Required parameter triggerId was null or undefined when calling createTriggerJob.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createTriggerJob.");const a="/trigger/{trigger_id}/job".replace("{trigger_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteTrigger:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteTrigger.");const i="/trigger/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchTrigger:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchTrigger.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchTrigger.");const a="/trigger/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readTrigger:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readTrigger.");const i="/trigger/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchTrigger:async(t,r,i,a,n,s,o,u={})=>{const c=parse("/trigger",!0);let l;e&&(l=e.baseOptions);const d={method:"GET",...l,...u},p={},h={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;p["X-Webitel-Access"]=t}void 0!==t&&(h.page=t),void 0!==r&&(h.size=r),void 0!==i&&(h.q=i),void 0!==a&&(h.sort=a),n&&(h.fields=n),s&&(h.id=s),o&&(h.schema_id=o),c.query={...c.query,...h,...u.query},delete c.search;let y=l&&l.headers?l.headers:{};return d.headers={...p,...y,...u.headers},{url:format(c),options:d}},searchTriggerJob:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y={})=>{if(null==t)throw new RequiredError("triggerId","Required parameter triggerId was null or undefined when calling searchTriggerJob.");const g="/trigger/{trigger_id}/job".replace("{trigger_id}",encodeURIComponent(String(t))),A=parse(g,!0);let m;e&&(m=e.baseOptions);const f={method:"GET",...m,...y},w={},b={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;w["X-Webitel-Access"]=t}void 0!==r&&(b.page=r),void 0!==i&&(b.size=i),void 0!==a&&(b.q=a),void 0!==n&&(b.sort=n),s&&(b.fields=s),void 0!==o&&(b["created_at.from"]=o),void 0!==u&&(b["created_at.to"]=u),void 0!==c&&(b["started_at.from"]=c),void 0!==l&&(b["started_at.to"]=l),void 0!==d&&(b["duration.from"]=d),void 0!==p&&(b["duration.to"]=p),h&&(b.state=h),A.query={...A.query,...b,...y.query},delete A.search;let S=m&&m.headers?m.headers:{};return f.headers={...w,...S,...y.headers},{url:format(A),options:f}},updateTrigger:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateTrigger.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateTrigger.");const a="/trigger/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},TriggerServiceApiFp=function(e){return{async createTrigger(t,r){const i=await TriggerServiceApiAxiosParamCreator(e).createTrigger(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createTriggerJob(t,r,i){const a=await TriggerServiceApiAxiosParamCreator(e).createTriggerJob(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteTrigger(t,r){const i=await TriggerServiceApiAxiosParamCreator(e).deleteTrigger(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchTrigger(t,r,i){const a=await TriggerServiceApiAxiosParamCreator(e).patchTrigger(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readTrigger(t,r){const i=await TriggerServiceApiAxiosParamCreator(e).readTrigger(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchTrigger(t,r,i,a,n,s,o,u){const c=await TriggerServiceApiAxiosParamCreator(e).searchTrigger(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async searchTriggerJob(t,r,i,a,n,s,o,u,c,l,d,p,h,y){const g=await TriggerServiceApiAxiosParamCreator(e).searchTriggerJob(t,r,i,a,n,s,o,u,c,l,d,p,h,y);return(e=globalAxios,t=BASE_PATH)=>{const r={...g.options,url:t+g.url};return e.request(r)}},async updateTrigger(t,r,i){const a=await TriggerServiceApiAxiosParamCreator(e).updateTrigger(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},TriggerServiceApiFactory=function(e,t,r){return{createTrigger:(i,a)=>TriggerServiceApiFp(e).createTrigger(i,a).then(e=>e(r,t)),createTriggerJob:(i,a,n)=>TriggerServiceApiFp(e).createTriggerJob(i,a,n).then(e=>e(r,t)),deleteTrigger:(i,a)=>TriggerServiceApiFp(e).deleteTrigger(i,a).then(e=>e(r,t)),patchTrigger:(i,a,n)=>TriggerServiceApiFp(e).patchTrigger(i,a,n).then(e=>e(r,t)),readTrigger:(i,a)=>TriggerServiceApiFp(e).readTrigger(i,a).then(e=>e(r,t)),searchTrigger:(i,a,n,s,o,u,c,l)=>TriggerServiceApiFp(e).searchTrigger(i,a,n,s,o,u,c,l).then(e=>e(r,t)),searchTriggerJob:(i,a,n,s,o,u,c,l,d,p,h,y,g,A)=>TriggerServiceApiFp(e).searchTriggerJob(i,a,n,s,o,u,c,l,d,p,h,y,g,A).then(e=>e(r,t)),updateTrigger:(i,a,n)=>TriggerServiceApiFp(e).updateTrigger(i,a,n).then(e=>e(r,t))}};class TriggerServiceApi extends BaseAPI{createTrigger(e,t){return TriggerServiceApiFp(this.configuration).createTrigger(e,t).then(e=>e(this.axios,this.basePath))}createTriggerJob(e,t,r){return TriggerServiceApiFp(this.configuration).createTriggerJob(e,t,r).then(e=>e(this.axios,this.basePath))}deleteTrigger(e,t){return TriggerServiceApiFp(this.configuration).deleteTrigger(e,t).then(e=>e(this.axios,this.basePath))}patchTrigger(e,t,r){return TriggerServiceApiFp(this.configuration).patchTrigger(e,t,r).then(e=>e(this.axios,this.basePath))}readTrigger(e,t){return TriggerServiceApiFp(this.configuration).readTrigger(e,t).then(e=>e(this.axios,this.basePath))}searchTrigger(e,t,r,i,a,n,s,o){return TriggerServiceApiFp(this.configuration).searchTrigger(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}searchTriggerJob(e,t,r,i,a,n,s,o,u,c,l,d,p,h){return TriggerServiceApiFp(this.configuration).searchTriggerJob(e,t,r,i,a,n,s,o,u,c,l,d,p,h).then(e=>e(this.axios,this.basePath))}updateTrigger(e,t,r){return TriggerServiceApiFp(this.configuration).updateTrigger(e,t,r).then(e=>e(this.axios,this.basePath))}}const UserHelperServiceApiAxiosParamCreator=function(e){return{defaultDeviceConfig:async(t,r={})=>{if(null==t)throw new RequiredError("type","Required parameter type was null or undefined when calling defaultDeviceConfig.");const i="/user/device/config/{type}".replace("{type}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}}}},UserHelperServiceApiFp=function(e){return{async defaultDeviceConfig(t,r){const i=await UserHelperServiceApiAxiosParamCreator(e).defaultDeviceConfig(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}}}},UserHelperServiceApiFactory=function(e,t,r){return{defaultDeviceConfig:(i,a)=>UserHelperServiceApiFp(e).defaultDeviceConfig(i,a).then(e=>e(r,t))}};class UserHelperServiceApi extends BaseAPI{defaultDeviceConfig(e,t){return UserHelperServiceApiFp(this.configuration).defaultDeviceConfig(e,t).then(e=>e(this.axios,this.basePath))}}const VariablesApiAxiosParamCreator=function(e){return{deleteVariable:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deleteVariable.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteVariable.");const n="/contacts/{contact_id}/variables/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},deleteVariables:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling deleteVariables.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling deleteVariables.");const n="/contacts/{contact_id}/variables".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),r&&(l.etag=r),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},listVariables:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling listVariables.");const c="/contacts/{contact_id}/variables".replace("{contact_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.q=a),n&&(y.sort=n),s&&(y.fields=s),o&&(y.id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},mergeVariables:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling mergeVariables.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling mergeVariables.");const n="/contacts/{contact_id}/variables".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"POST",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},resetVariables:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling resetVariables.");if(null==r)throw new RequiredError("input","Required parameter input was null or undefined when calling resetVariables.");const n="/contacts/{contact_id}/variables".replace("{contact_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}i&&(l.fields=i),c["Content-Type"]="application/json",s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};u.headers={...c,...d,...a.headers};const p="string"!=typeof r||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},updateVariable:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updateVariable.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updateVariable.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updateVariable.");const s="/contacts/{contact_id}/variables/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PUT",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}},updateVariable2:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("contactId","Required parameter contactId was null or undefined when calling updateVariable2.");if(null==r)throw new RequiredError("etag","Required parameter etag was null or undefined when calling updateVariable2.");if(null==i)throw new RequiredError("input","Required parameter input was null or undefined when calling updateVariable2.");const s="/contacts/{contact_id}/variables/{etag}".replace("{contact_id}",encodeURIComponent(String(t))).replace("{etag}",encodeURIComponent(String(r))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PATCH",...u,...n},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}a&&(d.fields=a),l["Content-Type"]="application/json",o.query={...o.query,...d,...n.query},delete o.search;let p=u&&u.headers?u.headers:{};c.headers={...l,...p,...n.headers};const h="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=h?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},VariablesApiFp=function(e){return{async deleteVariable(t,r,i,a){const n=await VariablesApiAxiosParamCreator(e).deleteVariable(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async deleteVariables(t,r,i,a){const n=await VariablesApiAxiosParamCreator(e).deleteVariables(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async listVariables(t,r,i,a,n,s,o,u){const c=await VariablesApiAxiosParamCreator(e).listVariables(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async mergeVariables(t,r,i,a){const n=await VariablesApiAxiosParamCreator(e).mergeVariables(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async resetVariables(t,r,i,a){const n=await VariablesApiAxiosParamCreator(e).resetVariables(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async updateVariable(t,r,i,a,n){const s=await VariablesApiAxiosParamCreator(e).updateVariable(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async updateVariable2(t,r,i,a,n){const s=await VariablesApiAxiosParamCreator(e).updateVariable2(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}}}},VariablesApiFactory=function(e,t,r){return{deleteVariable:(i,a,n,s)=>VariablesApiFp(e).deleteVariable(i,a,n,s).then(e=>e(r,t)),deleteVariables:(i,a,n,s)=>VariablesApiFp(e).deleteVariables(i,a,n,s).then(e=>e(r,t)),listVariables:(i,a,n,s,o,u,c,l)=>VariablesApiFp(e).listVariables(i,a,n,s,o,u,c,l).then(e=>e(r,t)),mergeVariables:(i,a,n,s)=>VariablesApiFp(e).mergeVariables(i,a,n,s).then(e=>e(r,t)),resetVariables:(i,a,n,s)=>VariablesApiFp(e).resetVariables(i,a,n,s).then(e=>e(r,t)),updateVariable:(i,a,n,s,o)=>VariablesApiFp(e).updateVariable(i,a,n,s,o).then(e=>e(r,t)),updateVariable2:(i,a,n,s,o)=>VariablesApiFp(e).updateVariable2(i,a,n,s,o).then(e=>e(r,t))}};class VariablesApi extends BaseAPI{deleteVariable(e,t,r,i){return VariablesApiFp(this.configuration).deleteVariable(e,t,r,i).then(e=>e(this.axios,this.basePath))}deleteVariables(e,t,r,i){return VariablesApiFp(this.configuration).deleteVariables(e,t,r,i).then(e=>e(this.axios,this.basePath))}listVariables(e,t,r,i,a,n,s,o){return VariablesApiFp(this.configuration).listVariables(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}mergeVariables(e,t,r,i){return VariablesApiFp(this.configuration).mergeVariables(e,t,r,i).then(e=>e(this.axios,this.basePath))}resetVariables(e,t,r,i){return VariablesApiFp(this.configuration).resetVariables(e,t,r,i).then(e=>e(this.axios,this.basePath))}updateVariable(e,t,r,i,a){return VariablesApiFp(this.configuration).updateVariable(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}updateVariable2(e,t,r,i,a){return VariablesApiFp(this.configuration).updateVariable2(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}}class Configuration{constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions}}var EngineAuditQuestionType,EngineBoolFilter,EngineCommunicationChannels,EnginePresetQuerySection,EngineRoutingSchemaType,EngineSystemSettingName,EngineTriggerJobState,EngineTriggerType,GoogleProtobufNullValue,HistoryFileJobHistoryFileJobAction,HistoryFileJobHistoryFileJobState,LoggerAction,LoggerAvailableSystemObjects,ProtobufNullValue,StorageImportSourceType,StorageProviderType,StorageServiceType,StorageUploadStatusCode,WebitelContactsAccessMode;!function(e){e.Default="question_default",e.Score="question_score",e.Option="question_option"}(EngineAuditQuestionType||(EngineAuditQuestionType={})),function(e){e.Undefined="undefined",e.True="true",e.False="false"}(EngineBoolFilter||(EngineBoolFilter={})),function(e){e.Undefined="Undefined",e.Phone="Phone",e.Email="Email",e.Messaging="Messaging"}(EngineCommunicationChannels||(EngineCommunicationChannels={})),function(e){e.Default="section_default",e.Calls="section_calls"}(EnginePresetQuerySection||(EnginePresetQuerySection={})),function(e){e.Default="default",e.Voice="voice",e.Chat="chat",e.Processing="processing",e.Service="service"}(EngineRoutingSchemaType||(EngineRoutingSchemaType={})),function(e){e.EmptySystemSettingsName="empty_system_settings_name",e.EnableOmnichannel="enable_omnichannel",e.MemberChunkSize="member_chunk_size"}(EngineSystemSettingName||(EngineSystemSettingName={})),function(e){e.Idle="idle",e.Active="active",e.Done="done",e.Error="error"}(EngineTriggerJobState||(EngineTriggerJobState={})),function(e){e.DefaultTriggerType="default_trigger_type",e.Cron="cron"}(EngineTriggerType||(EngineTriggerType={})),function(e){e.NULLVALUE="NULL_VALUE"}(GoogleProtobufNullValue||(GoogleProtobufNullValue={})),function(e){e.Undefined="undefined",e.STT="STT",e.Delete="delete"}(HistoryFileJobHistoryFileJobAction||(HistoryFileJobHistoryFileJobAction={})),function(e){e.Idle="idle",e.Active="active",e.Finished="finished",e.Error="error"}(HistoryFileJobHistoryFileJobState||(HistoryFileJobHistoryFileJobState={})),function(e){e.DefaultNoAction="default_no_action",e.Create="create",e.Update="update",e.Read="read",e.Delete="delete"}(LoggerAction||(LoggerAction={})),function(e){e.CcQueue="cc_queue",e.Schema="schema"}(LoggerAvailableSystemObjects||(LoggerAvailableSystemObjects={})),function(e){e.NULLVALUE="NULL_VALUE"}(ProtobufNullValue||(ProtobufNullValue={})),function(e){e.DefaultSourceType="DefaultSourceType",e.Dialer="Dialer"}(StorageImportSourceType||(StorageImportSourceType={})),function(e){e.DefaultProvider="DefaultProvider",e.Microsoft="Microsoft",e.Google="Google"}(StorageProviderType||(StorageProviderType={})),function(e){e.DefaultService="DefaultService",e.STT="STT",e.TTS="TTS"}(StorageServiceType||(StorageServiceType={})),function(e){e.Unknown="Unknown",e.Ok="Ok",e.Failed="Failed"}(StorageUploadStatusCode||(StorageUploadStatusCode={})),function(e){e.READ="READ",e.WRITE="WRITE",e.DELETE="DELETE"}(WebitelContactsAccessMode||(WebitelContactsAccessMode={}));class Log{debug(e,...t){this.emitLogMessage("debug",e,t)}info(e,...t){this.emitLogMessage("info",e,t)}warn(e,...t){this.emitLogMessage("warn",e,t)}error(e,...t){this.emitLogMessage("error",e,t)}emitLogMessage(e,t,r){r.length>0?console[e](t,...r):console[e](t)}}class Session{constructor(e){this.session=e.session,this.callId=e.request.getHeader("X-Webitel-Uuid"),this.incoming="incoming"===e.session.direction,this.instanceId=e.request.getHeader("X-Webitel-Sock-Id")}get id(){return this.session.id}getLocalMedia(){if(this.session.connection){const e=this.session.connection.getLocalStreams();if(e.length)return e}return[]}getPeerMedia(){if(this.session.connection){const e=this.session.connection.getRemoteStreams();if(e.length)return e}return[]}answer(e){return new Promise(()=>{this.session.answer(e)})}}class SipPhone extends EventEmitter{constructor(e,t){super(),this.instanceId=e,this.type="webrtc",this.sessionCache=new Map,this.log=new Log,t?(this.log.info(`JsSip version: ${version}`),debug.enable("*")):debug.disable(),this.on("unregistered",()=>{this.sessionCache.clear()})}async callOption(e={}){const t=await this.getUserCallStream(e);return{sessionTimersExpires:120,pcConfig:e.disableStun?void 0:{iceServers:[{urls:["stun:stun.l.google.com:19302"]}]},mediaStream:t}}async answer(e,t){if(this.sessionCache.has(e)){const r=this.sessionCache.get(e),i=await this.callOption(t);return r.answer(i)}return!1}async call(e){const t={};let r=null;if(e.params&&(t.audio=e.params.audio,t.video=e.params.video||!1,t.screen=e.params.screen||!1,t.disableStun=e.params.disableStun||!1),"string"!=typeof e.destination)throw new Error("bad destination type");const i=await this.callOption(t);e.params&&e.params.display&&(r={extraHeaders:[`X-Webitel-Display: ${e.params.display}`]}),await this.ua.call(e.destination,{...i,...r})}async register(e){const t=new WebSocketInterface(e.server),r={realm:e.realm,uri:e.uri,authorization_user:e.authorization_user,ha1:e.ha1,user_agent:SipPhone.userAgent,sockets:[t],session_timers:!0,display_name:e.display_name,register_expires:e.register_expires||90,connection_recovery_min_interval:5,connection_recovery_max_interval:60},i=this.ua=new UA(r);i.on("newRTCSession",e=>{const t=e.session,r=t.id,i=new Session(e);this.storeSession(r,i),t.on("connecting",()=>{this.emit("localStreams",i,t.connection.getLocalStreams())}),t.connection&&t.connection.addEventListener("addstream",e=>{this.emit("peerStreams",i,new Array(e.stream))}),t.on("peerconnection",e=>{e.peerconnection.addEventListener("addstream",async e=>{this.emit("peerStreams",i,new Array(e.stream))})}),t.on("ended",()=>{this.removeSession(r,t.connection)}),t.on("failed",()=>{this.removeSession(r,t.connection)}),t.on("accepted",()=>{i.incoming||this.emit("peerStreams",i,t.connection.getRemoteStreams())}),t.on("confirmed",()=>{}),this.emit("newSession",i)}),i.on("disconnected",e=>{this.emit("unregistered")}),i.on("unregistered",e=>{this.emit("unregistered")}),i.on("registrationFailed",e=>{this.log.error("registrationFailed",e)}),i.on("registered",e=>{this.emit("registered")}),i.start()}async unregister(){this.ua&&(this.ua.terminateSessions(),this.ua.removeAllListeners(),await this.ua.stop(),delete this.ua)}isRegistered(){return!!this.ua&&this.ua.isRegistered()}sipSessionByCallId(e){for(const t of this.allSession)if(t.callId===e)return t;return null}sipSessionBySipId(e){for(const t of this.allSession)if(t.id.startsWith(e))return t;return null}removeSession(e,t){if(t){const e=t.getLocalStreams(),r=t.getRemoteStreams();e&&e.forEach(e=>{e.getTracks().forEach(e=>{e.stop()})}),r&&r.forEach(e=>{e.getTracks().forEach(e=>{e.stop()})})}return!!this.sessionCache.has(e)&&(this.sessionCache.delete(e),!0)}storeSession(e,t){if(this.sessionCache.has(e))throw new Error("Session already store");this.sessionCache.set(e,t)}get allSession(){return Array.from(this.sessionCache.values())}getMediaConstraints(e){return e.screen?{video:!1,audio:!1,screen:!0}:{video:e.video||!1,audio:!0}}getSession(e){return this.sessionCache.has(e)?this.sessionCache.get(e):null}hasSession(e){return this.sessionCache.has(e)}async getUserScreen(){return new Promise(async(e,t)=>{try{e(await navigator.mediaDevices.getDisplayMedia())}catch(e){t(e)}})}async getUserCallStream(e){let t;if(!0===e.screen&&(t=await this.getUserScreen()),!1!==e.audio||e.video){const r=await this.getUserMedia(e.audio,e.video);t?r.getTracks().forEach(e=>{t.addTrack(e)}):t=r}if(!t)throw new Error("bad stream request");return t}async getUserMedia(e,t){return new Promise(async(r,i)=>{const a={audio:!(!1===e),video:void 0};return t&&(a.video={width:{min:10,ideal:1280,max:1920},height:{min:10,ideal:720,max:1080},frameRate:{ideal:10,max:15}}),getMediaStream(a).then(r).catch(i)})}}async function getMediaStream(e){return new Promise((t,r)=>{if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)navigator.mediaDevices.getUserMedia(e).then(e=>t(e)).catch(e=>r(e));else{(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)(e,e=>t(e),e=>r(e))}})}SipPhone.userAgent=`Webitel-Phone/${version}`,SipPhone.sipVersion=version;const VERSION="0.0.2",getVersion=()=>"0.0.2";var TypeErrors,JobState,ChannelName,AgentStatus,ChannelState,ChannelType,CallReportingStatus,EavesdropState,EavesdropType,CallActions,CallDirection,version$1="0.0.2";!function(e){e.RolePermission="api.context.permissions.app_error",e.LicencePermission="api.context.permissions.license",e.PauseNotAllow="app.agent.set_pause.not_allow"}(TypeErrors||(TypeErrors={}));class DeviceNotFoundError extends Error{constructor(e){super(e),this.id=DeviceNotFoundError.id}}DeviceNotFoundError.id="device_not_found";class DeviceNotAllowPermissionError extends Error{constructor(e){super(e),this.id=DeviceNotAllowPermissionError.id}}DeviceNotAllowPermissionError.id="device_not_allow";class RolePermissionError extends Error{constructor(e){super(e),this.id=RolePermissionError.id}}RolePermissionError.id=TypeErrors.RolePermission;class LicencePermissionError extends Error{constructor(e){super(e),this.id=LicencePermissionError.id}}LicencePermissionError.id=TypeErrors.LicencePermission;class PauseNotAllowedError extends Error{constructor(e){super(e),this.id=PauseNotAllowedError.id}}PauseNotAllowedError.id=TypeErrors.PauseNotAllow,function(e){e.Distribute="distribute",e.Offering="offering",e.Bridged="bridged",e.Missed="missed",e.Processing="processing",e.Closed="closed",e.Destroy="destroy"}(JobState||(JobState={})),function(e){e.Call="call",e.Chat="chat",e.Task="task"}(ChannelName||(ChannelName={}));class Task{constructor(e,t,r){this.client=e,this.distribute=r,this.id=t.attempt_id,this.state=JobState.Offering,this.setState(t.status),this.lastStatusChange=t.timestamp,this.createdAt=t.timestamp,this._processing=null,this.offeringAt=0,this.answeredAt=0,this.bridgedAt=0,this.reportedAt=0,this.startProcessingAt=0,this.stopAt=0,this.closedAt=0,this.form=null,this.autoAnswered=!1,this._autoAnswerParam=!1,this._autoAnswerTimerId=null,this.communication=r.communication,this.history=[r]}get queue(){return{id:this.distribute.queue_id,name:this.distribute.queue_name}}get duration(){return Math.round((Date.now()-this.lastStatusChange)/1e3)}get hasForm(){return this.distribute.has_form||!1}get channel(){return this.distribute.channel}get allowAccept(){return this.channel===ChannelName.Task&&0===this.bridgedAt&&0===this.closedAt}get allowDecline(){return this.allowAccept}get allowClose(){return this.channel===ChannelName.Task&&0===this.closedAt&&this.bridgedAt>0}get memberId(){return this.distribute.member_id}get queueId(){return this.distribute.queue_id}get hasReporting(){return this.distribute.has_reporting}get allowReporting(){return this.hasReporting&&this.bridgedAt>0}get agentChannelId(){return this.distribute.agent_channel_id}setState(e){this.state=e}setAnswered(e){this.answeredAt=e,this.lastStatusChange=Date.now(),this._autoAnswerTimerId&&(clearTimeout(this._autoAnswerTimerId),this._autoAnswerTimerId=null)}setOffering(e){this.offeringAt=e.timestamp,e.offering.auto_answer&&this.channel===ChannelType.Job&&(this._autoAnswerParam=e.offering.auto_answer,this.acceptDelay().catch(e=>{this.client.emit("error",e)}))}setBridged(e){this.bridgedAt=e.timestamp,this.lastStatusChange=Date.now(),e.form&&(this.form=e.form),this._autoAnswerTimerId&&(clearTimeout(this._autoAnswerTimerId),this._autoAnswerTimerId=null)}setProcessing(e,t){this.state=JobState.Processing,this.closedAt=e,this.startProcessingAt||(this.startProcessingAt=Date.now()),t.sec&&!t.timeout&&(t.timeout=Date.now()+1e3*t.sec),this._processing=t}setClosed(e){this.stopAt=e,this.state=JobState.Closed}setTransferred(e){this.distribute=e,this.history.push(e)}setMissed(){this.state=JobState.Missed}get processingTimeoutAt(){return this._processing&&this._processing.timeout?this._processing.timeout:null}get processingSec(){return this._processing&&this._processing.sec?this._processing.sec:null}get attempt(){return this}get variables(){const e={};for(const t in this.distribute.variables)t.startsWith("cc_")||(e[t]=this.distribute.variables[t]);return e}get isMember(){return!!this.memberId}get displayNumber(){return this.communication.destination}get displayName(){return this.distribute.member_name||null}get display(){return`${this.displayName} (${this.displayNumber})`}get renewalSec(){return this._processing&&this._processing.renewal_sec?this._processing.renewal_sec:null}get autoAnswer(){return this.autoAnswerDelay>0}get autoAnswerDelay(){return this._autoAnswerParam&&"false"!==`${this._autoAnswerParam}`?isFinite(+this._autoAnswerParam)?+this._autoAnswerParam:this.client.autoAnswerDelayTime:0}async accept(){return this.client.request("cc_agent_task_accept",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})}async acceptDelay(){this._autoAnswerTimerId=setTimeout(async()=>{this.autoAnswered||this.answeredAt||(this.autoAnswered=!0,await this.accept())},this.autoAnswerDelay)}async close(){return this.client.request("cc_agent_task_close",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})}async decline(){return this.client.request("cc_agent_task_close",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})}async reporting(e){const t=await this.client.request("cc_reporting",{attempt_id:this.id,...e});return this.reportedAt=Date.now(),t}async renew(e){return this.client.request("cc_renewal",{attempt_id:this.id,renewal_sec:e||this.processingSec})}async formAction(e,t){if(!this.form)throw new Error("not found active form");const r={};for(const[e,i]of Object.entries(t))r[e]="object"==typeof i?JSON.stringify(i):i;return this.client.request("cc_form_action",{attempt_id:this.id,app_id:this.distribute.app_id,action:e,fields:r})}}!function(e){e.Online="online",e.Offline="offline",e.Pause="pause",e.BreakOut="break_out"}(AgentStatus||(AgentStatus={})),function(e){e.Waiting="waiting",e.Distribute="distribute",e.Offering="offering",e.Answered="answered",e.Active="active",e.Bridged="bridged",e.Hold="hold",e.Missed="missed",e.WrapTime="wrap_time",e.Processing="processing",e.Transfer="transfer",e.Form="form"}(ChannelState||(ChannelState={})),function(e){e.Call="call",e.Email="email",e.Chat="chat",e.Job="task"}(ChannelType||(ChannelType={}));class Agent{constructor(e,t){this.client=e,this.info=t,this.task=new Map,this._channels=new Map,this.initChannels(t.channels),this._listOfflineMembers=null,this.waitingListChats=[],this.waitingListCalls=[],this.lastStatusChange=Date.now()-1e3*this.info.status_duration}get agentId(){return this.info.agent_id}get onDemand(){return this.info.on_demand}get status(){return this.info.status}get statusPayload(){return this.info.status_payload}get isAdmin(){return this.info.is_admin}get isSupervisor(){return this.info.is_supervisor}get team(){return this.info.team}get supervisor(){return this.info.supervisor}get auditor(){return this.info.auditor}get channels(){return Array.from(this._channels.values())}get channel(){return this._channels.get(ChannelType.Call)}get stateDuration(){return Math.round((Date.now()-this.lastStatusChange)/1e3)}setWaitingList(e){if(e){if(this.waitingListCalls.length=0,this.waitingListChats.length=0,this.status!==AgentStatus.Online)return;for(const t of e.calls||[])this.waitingListCalls.push({displayName:t.communication.name||"",displayNumber:t.communication.destination||"",attemptId:t.attempt_id,sessionId:t.session_id,deadline:t.deadline,queue:t.queue,wait:t.wait});for(const t of e.chats||[])this.waitingListChats.push({chat:t.communication.chat||"",displayName:t.communication.name||"",message:t.communication.msg||"",peer:t.communication.destination||"",attemptId:t.attempt_id,sessionId:t.session_id,deadline:t.deadline,queue:t.queue,wait:t.wait})}}deleteWaitingAttempt(e){if(e){const t=e.attempt_id;removeWaitingList(this.waitingListCalls,t)||removeWaitingList(this.waitingListChats,t)}}async interceptAttempt(e){return this.client.request("cc_intercept_attempt",{attempt_id:e,agent_id:this.agentId})}onChannelEvent(e){let t;switch(e.status){case ChannelState.Distribute:const r=e;if(!r)throw new Error("bad event");if(t=new Task(this.client,e,r.distribute),this.task.set(t.id,t),t.agentChannelId)switch(t.channel){case ChannelType.Call:const e=this.client.callById(t.agentChannelId);e&&!e.task&&(e.task=t);break;case ChannelType.Chat:const r=this.client.conversationById(t.agentChannelId);r&&!r.task&&(r.task=t)}break;case ChannelState.Offering:const i=e;(t=this.task.get(e.attempt_id))&&t.setOffering(i);break;case ChannelState.Bridged:const a=e;(t=this.task.get(a.attempt_id))&&t.setBridged(a);break;case ChannelState.Transfer:const n=e;(t=this.task.get(n.to_attempt_id))&&(this.task.delete(t.id),t.id=n.attempt_id,t.setTransferred(n.distribute),this.task.set(t.id,t));break;case ChannelState.Answered:(t=this.task.get(e.attempt_id))&&(t.answeredAt=e.timestamp);break;case ChannelState.Form:const s=e;return void((t=this.task.get(e.attempt_id))&&(t.form=s.form||null));case ChannelState.Missed:if(e.attempt_id&&(t=this.task.get(e.attempt_id))){t.stopAt=e.timestamp;const r=e;if(!r)throw new Error("bad event");return t.setMissed(),this.setChannelStateTimeout(e,r.missed.timeout),this.task.delete(e.attempt_id),this.client.reportingChannelTask(t),t}break;case ChannelState.WrapTime:if(e.attempt_id){if(!e)throw new Error("bad event");t=this.task.get(e.attempt_id),this.task.delete(e.attempt_id),this.client.reportingChannelTask(t)}break;case ChannelState.Processing:if(e.attempt_id){const r=e;if(!r)throw new Error("bad event");if(t=this.task.get(e.attempt_id))return t.setProcessing(e.timestamp,r.processing),this.setChannelStateTimeout(e,r.processing.timeout||0),t}break;case ChannelState.Waiting:e.attempt_id&&(t=this.task.get(e.attempt_id))&&(t.setClosed(e.timestamp),this.task.delete(e.attempt_id),this.client.reportingChannelTask(t))}return this.setChannelState(e),t?(t.setState(e.status),t):void 0}async online(e,t){return this.client.agentSetOnline(this.agentId,e,t)}async waiting(e){return this.client.agentSetWaiting(this.agentId,e)}async pause(e){try{return await this.client.agentSetPause(this.agentId,e)}catch(e){return e.id===TypeErrors.PauseNotAllow?new PauseNotAllowedError(e.detail):e}}async offline(){return this.client.agentSetOffline(this.agentId)}setStatus(e){e.status===AgentStatus.Online?(this.info.on_demand=e.on_demand||!1,this.initChannels(e.channels)):(this.waitingListCalls.length=0,this.waitingListChats.length=0),this.info.status=e.status,this.info.status_payload=e.status_payload?e.status_payload:null,this.lastStatusChange=Date.now()}async directMember(e,t){return this.client.request("cc_member_direct",{agent_id:this.agentId,member_id:e,communication_id:t})}async offlineMembers(e,t,r){return this._listOfflineMembers=await this.client.request("cc_fetch_offline_members",{agent_id:this.agentId,page:t,q:e,per_page:r}),this._listOfflineMembers}hasTask(e){return this.task.has(e.id)}initChannels(e){for(const t of e)this._channels.set(t.channel,t)}getChannel(e){return this._channels.get(e)}setChannelState(e){const t=this.getChannel(e.channel);t&&(t.state=e.status,t.joined_at=e.timestamp,t.timeout=void 0)}setChannelStateTimeout(e,t){const r=this.getChannel(e.channel);r&&(r.state=e.status,r.timeout=t,r.joined_at=e.timestamp)}}function removeWaitingList(e,t){for(let r=0;r<e.length;r++)if(e[r].attemptId===t)return e.splice(r,1),!0;return!1}!function(e){e.Abandoned="abandoned",e.Cancel="cancel",e.Success="success",e.Failed="failed",e.Missed="missed",e.Timeout="timeout",e.Endless="endless",e.Transferred="transferred"}(CallReportingStatus||(CallReportingStatus={})),function(e){e.Muted="muted",e.Conference="conference",e.Prompt="prompt"}(EavesdropState||(EavesdropState={})),function(e){e.Joined="joined",e.Leave="leave",e.Hide="hide"}(EavesdropType||(EavesdropType={})),function(e){e.Ringing="ringing",e.Active="active",e.Bridge="bridge",e.Hold="hold",e.DTMF="dtmf",e.Voice="voice",e.Silence="silence",e.Execute="execute",e.Update="update",e.Hangup="hangup",e.Reporting="reporting",e.PeerStream="peerStream",e.LocalStream="localStream",e.Destroy="destroy",e.Eavesdrop="eavesdrop"}(CallActions||(CallActions={})),function(e){e.Inbound="inbound",e.Outbound="outbound"}(CallDirection||(CallDirection={}));class Call{constructor(e,t){this.client=e;const r=t.data;this._muted=!1,this.voice=!0,this.createdAt=+t.timestamp,this.task=null,this.data=null,this._eavesdrop=null,this._autoAnswerTimerId=null,this._activeCounter=0,this.answeredAt=0,this.hangupAt=0,this.bridgedAt=0,this.reportingAt=0,this.autoAnswered=!1,this.peerStreams=[],this.localStreams=[],r.eavesdrop&&(this._eavesdrop=r.eavesdrop),e.phone&&(r.sip_id?this.setSip(e.phone.sipSessionBySipId(r.sip_id)):this.setSip(e.phone.sipSessionByCallId(t.id))),this.params={},this.id=t.id,this.digits=[],this.applications=[],this.appId=t.app_id,this.setState(t),this.setInfo(r),this.queue&&this.client.agent&&(this.task=this.client.agent.task.get(+this.queue.attempt_id)||null)}setState(e){this.state=e.event}setSip(e){e&&!this.sip&&(this.sip=e,this.localStreams=e.getLocalMedia(),this.peerStreams=e.getPeerMedia())}get duration(){return 0===this.hangupAt?Math.round((Date.now()-this.createdAt)/1e3):Math.round((this.hangupAt-this.createdAt)/1e3)}get allowDtmf(){return this.answeredAt>0&&this.allowHangup}get allowHangup(){return 0===this.hangupAt}get allowHold(){return 0===this.hangupAt&&("active"===this.state||"bridge"===this.state)}get allowAnswer(){return this.client.phone&&0===this.hangupAt&&0===this.answeredAt&&(this.queue||this.direction===CallDirection.Inbound||this.params&&!this.params.autoAnswer)}get allowUnHold(){return 0===this.hangupAt&&"hold"===this.state}get memberCommunication(){return this.task?this.task.communication:null}get isEavesdrop(){return!!this._eavesdrop}get eavesdropName(){return this.isEavesdrop?this._eavesdrop.name:""}get eavesdropNumber(){return this.isEavesdrop?this._eavesdrop.number:""}get eavesdropDuration(){return this.isEavesdrop?this._eavesdrop.duration:0}get eavesdropState(){return this.isEavesdrop?this._eavesdrop.state:null}get eavesdropIsMuted(){return this.eavesdropState===EavesdropState.Muted}get eavesdropIsConference(){return this.eavesdropState===EavesdropState.Conference}get eavesdropIsPrompt(){return this.eavesdropState===EavesdropState.Prompt}async getMember(e){if(!this.isMember)throw new Error("call is not from outbound queue");return this.client.request("cc_member_page",{queue_id:this.task.queueId,member_id:this.task.memberId})}get isMember(){return!(!this.task||!this.task.isMember)}get firstActive(){return 1===this._activeCounter}setActive(e){this._activeCounter++,this._autoAnswerTimerId&&(clearTimeout(this._autoAnswerTimerId),this._autoAnswerTimerId=null),this.answeredAt||(this.direction===CallDirection.Inbound&&(this.bridgedAt=+e.timestamp,this.parentId&&(this.bridgedId=this.parentId)),this.answeredAt=+e.timestamp),this.setState(e)}setBridged(e){const t=e.data;this.bridgedAt||(this.bridgedAt=+e.timestamp),this.bridgedId=t.bridged_id,t.to&&(this.direction===CallDirection.Inbound?this.from=t.to:this.to=t.to),this.bridgedId=t.bridged_id,t.payload&&(this.variables=t.payload),t.queue&&(this.queue=t.queue)}setHold(e){this.setState(e)}setInfo(e){this.parentId=e.parent_id,this.destination=e.destination,this.direction=e.direction,this.from=e.from,this.to=e.to,this.variables=e.payload,this.queue=e.queue||null,this.sipId=e.sip_id||null,this.params=e.params}setPeerStreams(e){this.peerStreams=e||[]}setLocalStreams(e){this.localStreams=e||[]}setVoice(){this.voice=!0}setSilence(){this.voice=!1}setExecute(e){this.applications.push(e.application)}addDigit(e){this.digits.push(e.digit)}setEavesdropState(e){e.type===EavesdropType.Joined?this._eavesdrop=e:e.type===EavesdropType.Leave?this._eavesdrop=null:this._eavesdrop.state=e.state}setHangup(e){const t=e.data;this.hangupAt=+e.timestamp,this.hangupCause=t.cause,this.hangupSipCode=t.sip,this.voice=!1,this.peerStreams=[],+t.reporting_at&&(this.reportingAt=+t.reporting_at),this.setState(e)}get allowReporting(){return this.answeredAt>0&&this.hasReporting}get hasReporting(){return!!this.task&&this.task.hasReporting}get display(){return`${this.displayNumber} (${this.displayName})`}get muted(){return this._muted}get isHold(){return this.state===CallActions.Hold}get allowInboundVideo(){return this.params&&this.params.video||!1}get allowOutboundVideo(){return this.params&&this.params.video||!1}get active(){return 0===this.hangupAt}get displayNumber(){return"inbound"===this.direction?this.from.number:this.to?this.to.number:this.destination}get displayName(){return"inbound"===this.direction?this.from.name:this.to?this.to.name:this.destination}get autoAnswer(){return this.queue&&"offline"===this.queue.queue_type||this.autoAnswerDelay>0}get autoAnswerDelay(){return this.params&&this.params.autoAnswer&&"false"!==`${this.params.autoAnswer}`?isFinite(+this.params.autoAnswer)?+this.params.autoAnswer:this.client.autoAnswerDelayTime:0}get attempt(){return this.task}async answer(e){if(this.sip&&this.client.phone){try{const t=await this.client.phone.callOption(e);await this.sip.answer(t)}catch(e){this.client.handleError(e)}return!0}return!1}answerDelay(e){this.autoAnswered||(this._autoAnswerTimerId&&clearTimeout(this._autoAnswerTimerId),this._autoAnswerTimerId=setTimeout(async()=>{this.autoAnswered||(this.autoAnswered=!0,await this.answer(e))},this.autoAnswerDelay))}async hangup(e){let t=e;return 0!==this.answeredAt||e||(t=this.direction===CallDirection.Inbound?"USER_BUSY":"ORIGINATOR_CANCEL"),this.client.request("call_hangup",{id:this.id,app_id:this.appId,cause:t})}async eavesdrop(e){return e.id=this.id,this.client.request("call_eavesdrop",e)}async changeEavesdropState(e){if(!this.isEavesdrop)throw new Error("this call not in eavesdrop");if(this.eavesdropState===e)throw new Error(`this call already eavesdrop state: ${e}`);return this.client.request("call_eavesdrop_state",{id:this.id,state:e})}async toggleHold(){return this.state===CallActions.Hold?this.unHold():this.hold()}async hold(){if(this.state===CallActions.Hold)throw new Error("Call is hold");return this.client.request("call_hold",{id:this.id,app_id:this.appId})}async unHold(){if(this.state!==CallActions.Hold)throw new Error("Call is active");return this.client.request("call_unhold",{id:this.id,app_id:this.appId})}async sendDTMF(e){return this.client.request("call_dtmf",{id:this.id,app_id:this.appId,dtmf:e})}async blindTransfer(e,t){return t?this.client.request("call_blind_transfer_ext",{id:this.id,app_id:this.appId,destination:e,variables:t}):this.client.request("call_blind_transfer",{id:this.id,app_id:this.appId,destination:e})}async mute(e=!1){const t=await this.client.request("call_mute",{id:this.id,app_id:this.appId,mute:e});return this._muted=e,t}async bridgeTo(e,t){return this.client.request("call_bridge",{from_id:this.id,from_app_id:this.appId,to_id:e.id,to_app_id:e.appId,variables:t})}async reporting(e){if(!this.task)throw new Error("this call not in queue");return this.task.reporting(e)}async renew(e){if(!this.task)throw new Error("this conversation not in queue");return this.task.renew(e)}async callToUser(e){return e.nodeId=this.appId,e.parentCallId=this.id||null,e.sendToCallId=this.parentId||null,this.client.inviteToUser(e)}}function formatWebSocketUri(e){return e.replace(/^http/,"ws")}function formatBaseUri(e){let t=e.replace(/^ws/,"http");return t.endsWith("/")&&(t=t.slice(0,-1)),t.endsWith("/ws")&&(t=t.slice(0,-3)),t}function chunkString(e,t){const r=Math.ceil(e.length/t),i=new Array(r);let a=0;for(let n=0;n<r;n++)i[n]=e.substring(a,a+t),a+=t;return i}const maxSizeMessage=4096;var DeclineCause,ChatActions,ConversationState,NotificationActions;!function(e){e.Timeout="TIMEOUT",e.Busy="BUSY",e.Cancel="CANCEL",e.Transfer="TRANSFER"}(DeclineCause||(DeclineCause={})),function(e){e.Message="message",e.UserInvite="user_invite",e.Invite="invite_conversation",e.Joined="join_conversation",e.Close="close_conversation",e.Leave="leave_conversation",e.Decline="decline_invite",e.Update="update_channel",e.Destroy="destroy",e.MessageDeleted="message_deleted"}(ChatActions||(ChatActions={})),function(e){e.Init="init",e.Invite="invite",e.Active="active",e.Pending="pending",e.Closed="closed"}(ConversationState||(ConversationState={}));class Conversation{constructor(e,t,r,i,a,n){this.client=e,this.conversationId=t,this.title=r,this.channelId=null,this.createdAt=Date.now(),this.answeredAt=0,this.updatedAt=0,this.invitedAt=0,this.closedAt=0,this.task=null,this.data=null,this.queue=null,this.members=(i||[]).map(e=>wrapChannelMember(e)),this._messages=a||[],this.state=ConversationState.Invite,this.variables={},this._hasReporting=!(!n||"true"!==n.cc_reporting),this.autoAnswered=!1,this._autoAnswerParam=!1,this._autoAnswerTimerId=null,this._cause=null,this.lastAction=null;for(const e in n)!e.startsWith("cc_")&&n.hasOwnProperty(e)&&("wbt_auto_answer"===e?this._autoAnswerParam=n.wbt_auto_answer:this.variables[e]=n[e]);n&&n.hasOwnProperty("cc_attempt_id")&&this.client.agent&&(this.queue={id:+n.cc_queue_id||null,name:n.cc_queue_name||""},this.task=this.client.agent.task.get(+n.cc_attempt_id)||null)}setInvite(e,t){this.inviteId=e,this.invitedAt=t,this.autoAnswer&&this.joinDelay().catch(e=>{this.client.emit("error",e)})}get autoAnswer(){return this.autoAnswerDelay>0}get autoAnswerDelay(){return this._autoAnswerParam&&"false"!==`${this._autoAnswerParam}`?isFinite(+this._autoAnswerParam)?+this._autoAnswerParam:this.client.autoAnswerDelayTime:0}setAnswered(e,t,r){this.state=ConversationState.Active,this.answeredAt=t,this.channelId=e,this._autoAnswerTimerId&&(clearTimeout(this._autoAnswerTimerId),this._autoAnswerTimerId=null),this.member=wrapChannelMember(r),this.inviteId=null}setClosed(e){this.state=ConversationState.Closed,this.closedAt=e}setDecline(e){this.setClosed(e.timestamp),this._cause=e.cause||null}setLeave(e){e.cause&&(this._cause=e.cause),this.setClosed(e.timestamp)}setDeletedMessage(e){const t=this._messages;for(let r=0;r<t.length;r++)t[r].id===e.id&&(e.created_at=t[r].created_at,t.splice(r,1,e))}get id(){return this.channelId||this.inviteId||this.conversationId}get cause(){return this._cause}get messages(){return this.getMessages()}getMessages(){return this._messages.map(e=>{const t={id:e.id,type:e.type,member:this.messageMember(e),channelId:e.channel_id,createdAt:e.created_at,updatedAt:e.updated_at,contact:null};return e.hasOwnProperty("file")&&(e.file&&e.file.id>0&&(e.file.url=this.client.fileUrlDownload(e.file.id,e.file.mime),e.file.streamUrl=this.client.fileUrlStream(e.file.id,e.file.mime)),t.file=e.file),e.hasOwnProperty("text")&&(t.text=e.text),e.hasOwnProperty("contact")&&(t.contact=e.contact),t})}async next(){throw new Error("TODO")}async pagination(e,t){throw new Error("TODO")}newMessage(e){this._messages.push(e)}get allowDecline(){return!!this.inviteId}get allowJoin(){return!!this.inviteId}get allowLeave(){return!(!this.channelId||0!==this.closedAt&&this.hasReporting)}get allowReporting(){return this.answeredAt>0&&this.hasReporting}get hasReporting(){return this._hasReporting}get membersId(){const e=[this.id];for(const t of this.members)e.push(t.id);return e}get attempt(){return this.task}get isTransferred(){return(this._cause&&this._cause.toUpperCase())===DeclineCause.Transfer}async decline(e){if(!this.inviteId)throw new Error("This conversation is joined");let t=e;return e||0!==this.answeredAt||(t=DeclineCause.Busy),this.client.request("decline_chat",{invite_id:this.inviteId,cause:t})}async joinDelay(){this.autoAnswered||(this.autoAnswered=!0,this._autoAnswerTimerId=setTimeout(async()=>{this.answeredAt||await this.join()},this.autoAnswerDelay))}async join(){if(!this.inviteId)throw new Error("This conversation is joined");return this.client.request("join_chat",{invite_id:this.inviteId})}async close(e){if(!this.channelId)throw new Error("This conversation not active");return this.client.request("close_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:e})}async leave(e){if(!this.channelId)throw new Error("This conversation not active");return 0===this.closedAt||this.hasReporting||this.cause===DeclineCause.Busy?this.client.request("leave_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:e}):this.client.destroyConversation(this)}async sendText(e){if(!this.channelId)throw new Error("conversation not active");if(!e.length)throw new Error("empty message");const t=chunkString(e,maxSizeMessage);for(let e=0;e<t.length;e++){if(e+1>=t.length)return this.sendMessageTextChunk(t[e]);await this.sendMessageTextChunk(t[e])}}async sendFile(e,t){const r=(await this.client.storeFile(this.conversationId,[e],t))[0];return this.client.request("send_file_chat",{channel_id:this.channelId,conversation_id:this.conversationId,id:r.id,name:e.name,mime:r.mime,url:r.shared,size:r.size})}async send(e,t){if("string"==typeof e)return this.sendText(e);if(e instanceof File)return this.sendFile(e,t);throw new Error("unknown send data")}async addToChat(e,t){return this.client.request("add_to_chat",{channel_id:this.channelId,conversation_id:this.conversationId,user_id:e,title:t})}async startChat(e){return this.client.request("start_chat",{user_id:e})}async updateChannel(){return this.client.request("update_channel_chat",{channel_id:this.channelId})}async reporting(e){if(!this.task)throw new Error("this conversation not in queue");return this.task.reporting(e)}async renew(e){if(!this.task)throw new Error("this conversation not in queue");return this.task.renew(e)}async transferToPlan(e){return this.client.request("blind_transfer_chat",{conversation_id:this.conversationId,channel_id:this.channelId,plan_id:e})}async transferToUser(e){return this.client.request("transfer_user_chat",{conversation_id:this.conversationId,channel_id:this.channelId,user_id:e})}sendMessageTextChunk(e){return this.client.request("send_text_chat",{channel_id:this.channelId,conversation_id:this.conversationId,text:e})}messageMember(e){if(this.member&&e.channel_id===this.channelId)return{self:!0};for(const t of this.members)if(t.id===e.channel_id)return t;return null}}function wrapChannelMember(e){return e.messenger=e.type,e}!function(e){e.HideMember="hide_member",e.HideAttempt="hide_attempt",e.WaitingList="waiting_list"}(NotificationActions||(NotificationActions={}));const SOCKET_URL_SUFFIX="websocket",spamData="\0\0\0\0";class Socket extends EventEmitter{constructor(e){super(),this.host=e}connect(e){this.socket=new WebSocket(`${formatWebSocketUri(this.host)}/${SOCKET_URL_SUFFIX}`),this.socket.onclose=(e=>this.onClose(e.code)),this.socket.onmessage=(e=>this.onMessage(e.data)),this.socket.onopen=(()=>this.onOpen())}send(e){return this.socket.send(JSON.stringify(e)),null}close(e){this.socket.close(e||1e3),delete this.socket,this.onClose(e||1e3)}onOpen(){this.emit("open")}onClose(e){this.emit("close",e),this.off("*")}onMessage(e){if(e!==spamData){const t=JSON.parse(e);this.emit("message",t)}}}const API_HEADER_TOKEN="X-Webitel-Access",WEBSOCKET_AUTHENTICATION_CHALLENGE="authentication_challenge",WEBSOCKET_DEFAULT_DEVICE_CONFIG="user_default_device",WEBSOCKET_AGENT_SESSION="cc_agent_session",WEBSOCKET_PING="ping",WEBSOCKET_MAKE_OUTBOUND_CALL="call_invite",WEBSOCKET_MAKE_USER_CALL="call_user",WEBSOCKET_EVENT_HELLO="hello",WEBSOCKET_EVENT_CALL="call",WEBSOCKET_EVENT_CHAT="chat",WEBSOCKET_EVENT_USER_STATE="user_state",WEBSOCKET_EVENT_AGENT_STATUS="agent_status",WEBSOCKET_EVENT_CHANNEL_STATUS="channel",WEBSOCKET_EVENT_ERROR="error",WEBSOCKET_EVENT_NOTIFICATION="notification",TASK_EVENT="task",JOB_EVENT="job",WEBSOCKET_EVENT_SIP="sip";var HandleError,Response;!function(e){e.NotFoundError="NotFoundError",e.NotAllowedError="NotAllowedError"}(HandleError||(HandleError={})),function(e){e.STATUS_FAIL="FAIL",e.STATUS_OK="OK"}(Response||(Response={}));class Client extends EventEmitter{constructor(e){super(),this._config=e,this.reqSeq=0,this.queueRequest=new Map,this.log=new Log,this.eventHandler=new EventEmitter,this.callStore=new Map,this.conversationStore=new Map,this.pingTimer=null,this.basePath=`${formatBaseUri(e.storageEndpoint||e.endpoint)}`,this.lastError=null}async connect(){await this.connectToSocket()}async disconnect(){this.socket.close()}async subscribeCall(e,t){const r=await this.request("subscribe_call",t);if(this.eventHandler.on(WEBSOCKET_EVENT_CALL,e),r.items&&r.items.length)for(const e of r.items){if(e.hangup_at&&e.hangup_at>0&&!e.task)continue;const t={cc_app_id:"",app_id:e.app_id,event:e.state,id:e.id,timestamp:Date.now(),data:{app_id:e.app_id,event:e.state,id:e.id,timestamp:Date.now(),cc_app_id:"",sip_id:"",parent_id:e.parent_id,direction:e.direction,destination:e.destination,queue:e.queue,from:e.from,to:e.to,payload:e.variables}},r=new Call(this,t);if(r.createdAt=e.created_at,r.answeredAt=e.answered_at||0,r.bridgedAt=e.bridged_at||0,r.hangupAt=e.hangup_at||0,e.task){let t=this.getTask(e.task.attempt_id);t||((t=new Task(this,{attempt_id:e.task.attempt_id,channel:e.task.channel,status:e.task.status,timestamp:Date.now()},e.task)).form=e.task.form||null,e.leaving_at&&e.task.processing_sec&&(t.startProcessingAt=e.leaving_at,t.setProcessing(e.leaving_at,{sec:e.task.processing_sec||0,timeout:e.task.processing_timeout_at||null,renewal_sec:e.task.processing_renewal_sec||0}))),r.task=t,r.queue.reporting="true"}this.callStore.set(r.id,r)}return r}async subscribeChat(e,t){const r=await this.request("subscribe_chat",t);if(this.eventHandler.on(WEBSOCKET_EVENT_CHAT,e),r&&r.items)for(const e of r.items){const t=e.messages.reverse(),r=new Conversation(this,e.id,e.title,e.members,t,e.variables);if(r.createdAt=e.created_at,r.closedAt=e.closed_at,e.task){let t=this.getTask(e.task.attempt_id);t||(t=new Task(this,{attempt_id:e.task.attempt_id,channel:e.task.channel,status:e.task.status,timestamp:Date.now()},e.task),e.leaving_at&&e.task.processing_sec&&(t.startProcessingAt=e.leaving_at,t.setProcessing(e.leaving_at,{sec:e.task.processing_sec||0,timeout:e.task.processing_timeout_at||null,renewal_sec:e.task.processing_renewal_sec||0})),t.form=e.task.form||null),r.task=t}if(e.invite_id)r.setInvite(e.invite_id,e.created_at);else{if(!e.channel_id){this.log.error(`conversation ${e.id} not valid`);continue}r.setAnswered(e.channel_id,e.joined_at,{id:e.channel_id,name:"TODO",type:"webitel"})}this.conversationStore.set(r.id,r)}return r}async subscribeUsersStatus(e,t){const r=await this.request("subscribe_users_status",t);return this.eventHandler.on(WEBSOCKET_EVENT_USER_STATE,e),r}async subscribeAgentsStatus(e,t){const r=await this.request("cc_agent_subscribe_status",t);return this.eventHandler.on(WEBSOCKET_EVENT_AGENT_STATUS,e),r}getTask(e){if(this.agent)return this.agent.task.get(e)}subscribeTask(e){this.eventHandler.on(TASK_EVENT,e)}subscribeJob(e){this.eventHandler.on(JOB_EVENT,e)}async unSubscribe(e,t,r){return this.request(`un_subscribe_${e}`,r)}async destroy(){await this.disconnect(),this.phone&&(await this.phone.unregister(),this.phone.off("*"),delete this.phone),this.eventHandler.off("*")}allCall(){return Array.from(this.callStore.values())}allConversations(){return Array.from(this.conversationStore.values())}allTask(){return this.agent?Array.from(this.agent.task.values()):[]}allJob(){return this.allTask().filter(isJobTask)}callById(e){if(this.callStore.has(e))return this.callStore.get(e)}conversationById(e){if(this.conversationStore.has(e))return this.conversationStore.get(e)}callBySipId(e){for(const t of this.allCall())if(t.sipId&&e.startsWith(t.sipId))return t}async reportingTask(e,t){return this.request("cc_reporting",{attempt_id:e,...t})}async agentActiveTasks(e){return this.request("cc_agent_tasks",{agent_id:e})}async auth(){try{return await this.request(WEBSOCKET_AUTHENTICATION_CHALLENGE,{token:this._config.token})}catch(e){throw this.handleError(e),await this.disconnect(),e}}async ping(){return this.request(WEBSOCKET_PING,{ping:1})}sessionInfo(){return this.connectionInfo.session}get version(){return this.connectionInfo.server_version}get buildVersion(){return version$1}get instanceId(){return this.connectionInfo.sock_id}get autoAnswerDelayTime(){return this._config.autoAnswerDelayTime||400}async agentSession(){if(this.agent)return this.agent;const e=await this.request(WEBSOCKET_AGENT_SESSION);this.agent=new Agent(this,e);const t=await this.agentActiveTasks(this.agent.agentId);for(const e of t.items){const t=new Task(this,{status:e.status,timestamp:Date.now(),channel:e.channel,attempt_id:e.attempt_id},e);t.postProcessData={},t.setState(e.state),e.bridged_at&&(t.bridgedAt=e.bridged_at,t.answeredAt=e.bridged_at),e.leaving_at&&(t.closedAt=e.leaving_at),e.leaving_at&&e.processing_sec&&(t.startProcessingAt=e.leaving_at,t.setProcessing(e.leaving_at,{sec:e.processing_sec||0,timeout:e.processing_timeout_at||null,renewal_sec:e.processing_renewal_sec||0})),t.form=e.form||null,this.agent.task.set(t.id,t)}for(const e of this.allCall())e.task&&this.agent.task.set(e.task.id,e.task);for(const e of this.allConversations())e.task&&this.agent.task.set(e.task.id,e.task);return this.agent}async invite(e){return this.request(WEBSOCKET_MAKE_OUTBOUND_CALL,e)}async call(e){if(this.phone)try{await this.phone.call(e)}catch(e){this.handleError(e)}else await this.invite(e)}async callRecordId(e){return this.request("call_recordings",{id:e})}async eavesdrop(e){return this.request("call_eavesdrop",e)}async agentSetOnline(e,t,r){return this.request("cc_agent_online",{agent_id:e,channels:t,on_demand:r})}async agentSetWaiting(e,t){return this.request("cc_agent_waiting",{agent_id:e,channel:t})}async agentSetPause(e,t){return this.request("cc_agent_pause",{agent_id:e,payload:t})}async agentSetOffline(e){return this.request("cc_agent_offline",{agent_id:e})}inviteToUser(e){return this.request(WEBSOCKET_MAKE_USER_CALL,e)}async answer(e,t){const r=this.callById(e);if(r)return r.answer(t)}request(e,t){return new Promise((r,i)=>{this.queueRequest.set(++this.reqSeq,{resolve:r,reject:i}),this.socket.send({seq:this.reqSeq,action:e,data:t})})}useWebPhone(){return this._config.registerWebDevice||!1}callDestroyed(e){return e.hangupAt>0&&!this.hasAgentTask(e.task)}conversationDestroyed(e){return e.closedAt>0&&(!this.hasAgentTask(e.task)||!e.hasReporting)&&(e.hasReporting||!(e.lastAction===ChatActions.Close&&e.answeredAt>0))}reportingChannelTask(e){switch(e.channel){case ChannelName.Call:for(const e of this.allCall())if(this.callDestroyed(e))return void this.destroyCall(e);break;case ChannelName.Chat:if(e.agentChannelId){const t=this.conversationById(e.agentChannelId);if(t&&this.conversationDestroyed(t))return void this.destroyConversation(t)}}}async registerCallClient(e){this.phone=e,this.subscribePhone(e);try{const e=await this.deviceConfig(this.phone.type);await this.phone.register(e)}catch(e){this.log.error(e)}}subscribePhone(e){e.on("peerStreams",(e,t)=>{const r=this.callBySession(e);r&&!r.peerStreams.length&&(r.setPeerStreams(t),this.eventHandler.emit(WEBSOCKET_EVENT_CALL,CallActions.PeerStream,r))}),e.on("localStreams",(e,t)=>{const r=this.callBySession(e);r&&!r.localStreams.length&&(r.setLocalStreams(t),this.eventHandler.emit(WEBSOCKET_EVENT_CALL,CallActions.LocalStream,r))}),e.on("newSession",this.onNewCallSession.bind(this)),e.on("registered",()=>this.emit("phone_registered",!0)),e.on("unregistered",()=>this.emit("phone_registered",!1))}phoneIsRegister(){return!(!this.phone||!this.phone.isRegistered)&&this.phone.isRegistered()}async deviceConfig(e){return this.request(WEBSOCKET_DEFAULT_DEVICE_CONFIG,{name:e})}async storeFile(e,t,r){if(!t||t.length<1)throw new Error("no files");const i=new FormData;for(const e of t)i.append(e.name,e);const a=(await globalAxios.post(`${this.basePath}/api/storage/file/${e}/upload`,i,{headers:{[API_HEADER_TOKEN]:this._config.token},onUploadProgress:r})).data;for(const e of a)e.shared=this.basePath+e.shared;return a}fileUrlDownload(e,t){const r=this.fileUrlParams(t);return`${this.basePath}/api/storage/file/${e}/download?${r.join("&")}`}fileUrlStream(e,t){const r=this.fileUrlParams(t);return`${this.basePath}/api/storage/file/${e}/stream?${r.join("&")}`}handleError(e){if(e)switch(e.name){case HandleError.NotFoundError:this.emit("error",new DeviceNotFoundError(e.message));break;case HandleError.NotAllowedError:this.emit("error",new DeviceNotAllowPermissionError(e.message));break;default:this.emit("error",e)}}destroyConversation(e){this.conversationStore.delete(e.id),this.eventHandler.emit(WEBSOCKET_EVENT_CHAT,ChatActions.Destroy,e)}async onMessage(e){if(this.log.debug("receive message: ",e),e.seq_reply>0){if(this.queueRequest.has(e.seq_reply)){const t=this.queueRequest.get(e.seq_reply);if(this.queueRequest.delete(e.seq_reply),e.status===Response.STATUS_OK)t.resolve(e.data);else{const r=e.error;r&&r.id===TypeErrors.RolePermission?t.reject(new RolePermissionError(r.detail)):r&&r.id===TypeErrors.LicencePermission?t.reject(new LicencePermissionError(r.detail)):t.reject(e.error)}}}else switch(e.event){case WEBSOCKET_EVENT_HELLO:await this.connected(e.data),this.log.debug(`opened session ${this.connectionInfo.sock_id} for userId=${this.connectionInfo.session.user_id}`);break;case WEBSOCKET_EVENT_CALL:await this.handleCallEvents(e.data.call);break;case WEBSOCKET_EVENT_CHAT:await this.handleChatEvents(e.data);break;case WEBSOCKET_EVENT_USER_STATE:this.handleUserStateEvent(e.data.state);break;case WEBSOCKET_EVENT_SIP:this.eventHandler.emit(WEBSOCKET_EVENT_SIP,e.data);break;case WEBSOCKET_EVENT_AGENT_STATUS:this.handleAgentStatus(e.data);break;case WEBSOCKET_EVENT_CHANNEL_STATUS:this.handleChannelEvents(e.data);break;case WEBSOCKET_EVENT_ERROR:this.lastError=e.data.error;break;case WEBSOCKET_EVENT_NOTIFICATION:this.handleNotification(e.data.notification);break;default:this.log.error(`event ${e.event} not handler`)}}handleNotification(e){switch(e.action){case NotificationActions.HideMember:if(this.agent&&this.agent._listOfflineMembers){const t=this.agent._listOfflineMembers;if(t.items)for(let r=0;r<t.items.length;r++)if(t.items[r].id===e.body.member_id){t.items.splice(r,1);break}}break;case NotificationActions.WaitingList:this.agent&&this.agent.setWaitingList(e.body);break;case NotificationActions.HideAttempt:this.agent&&this.agent.deleteWaitingAttempt(e.body);break;default:this.log.error(`notification "${e.action}" not handled`)}}handleAgentStatus(e){this.agent&&e.agent_id===this.agent.agentId&&this.agent.setStatus(e),this.eventHandler.emit(WEBSOCKET_EVENT_AGENT_STATUS,e,this.agent)}handleChannelEvents(e){if(this.agent){e.timestamp=Date.now();const t=this.agent.onChannelEvent(e)||void 0;this.eventHandler.emit(TASK_EVENT,e.status,t),t&&isJobTask(t)&&(this.eventHandler.emit(JOB_EVENT,t.state,t),isDestroyJob(t.state)&&this.eventHandler.emit(JOB_EVENT,JobState.Destroy,t))}}async pingServer(){if(this.pingTimer&&this.connectionInfo.ping_interval){const e=setTimeout(async()=>{this.log.error("close socket without pong"),this.socket.close(3005)},2e3);await this.ping(),clearTimeout(e)}this.connectionInfo.ping_interval&&(this.pingTimer=setTimeout(this.pingServer.bind(this),+this.connectionInfo.ping_interval))}async connected(e){if(this.connectionInfo=e,e.ping_interval&&await this.pingServer(),this.useWebPhone())return this.registerCallClient(new SipPhone(this.instanceId,this._config.debug))}callBySession(e){for(const t of this.allCall())if(t.sip&&t.sip.id===e.id)return t}async onNewCallSession(e){let t;(t=e.callId?this.callById(e.callId):this.callBySipId(e.id))&&(t.setSip(e),this.checkAutoAnswer(t))}checkAutoAnswer(e){e.autoAnswer&&e.answerDelay({video:e.params.video,screen:e.params.screen,disableStun:e.params.disableStun})}connectToSocket(){return new Promise((e,t)=>{try{this.socket=new Socket(this._config.endpoint),this.socket.connect(this._config.token)}catch(e){return void t(e)}this.socket.on("message",this.onMessage.bind(this)),this.socket.on("close",e=>{this.pingTimer&&clearTimeout(this.pingTimer),this.log.error("socket close code: ",e),1e3!==e&&(this.emit("disconnected",e,this.lastError),t(new Error(`close socket code: ${e}`))),this.eventHandler.off("*")}),this.socket.on("open",()=>{e(null),this.emit("connected")})})}handleUserStateEvent(e){this.eventHandler.emit(WEBSOCKET_EVENT_USER_STATE,e)}async handleCallEvents(e){let t;switch(e.timestamp=Date.now(),e.event){case CallActions.Ringing:t=new Call(this,e),this.callStore.set(t.id,t),this.checkAutoAnswer(t);break;case CallActions.Active:(t=this.callById(e.id))&&t.setActive(e);break;case CallActions.Bridge:(t=this.callById(e.id))&&t.setBridged(e);break;case CallActions.Execute:(t=this.callById(e.id))&&t.setExecute(e.data);break;case CallActions.DTMF:(t=this.callById(e.id))&&t.addDigit(e.data);break;case CallActions.Eavesdrop:(t=this.callById(e.id))&&t.setEavesdropState(e.data);break;case CallActions.Voice:(t=this.callById(e.id))&&t.setVoice();break;case CallActions.Silence:(t=this.callById(e.id))&&t.setSilence();break;case CallActions.Hold:(t=this.callById(e.id))&&t.setHold(e);break;case CallActions.Hangup:(t=this.callById(e.id))&&t.setHangup(e);break;default:throw new Error("Unhandled action")}t&&(this.eventHandler.emit(WEBSOCKET_EVENT_CALL,e.event,t),this.callDestroyed(t)&&this.destroyCall(t))}async handleChatEvents(e){let t;const r=Date.now();switch(e.action){case ChatActions.UserInvite:const i=e.data;(t=new Conversation(this,i.conversation_id,i.title,i.members,i.messages,i.variables)).setInvite(i.invite_id,r),this.conversationStore.set(t.id,t);break;case ChatActions.MessageDeleted:const a=e.data;for(const e of this.allConversations())if(!e.closedAt&&e.membersId.indexOf(a.channel_id)>-1){t=e;break}return void(t&&t.setDeletedMessage(a));case ChatActions.Joined:const n=e.data;(t=this.conversationById(n.member.id))&&t.setAnswered(n.member.id,r,n.member);break;case ChatActions.Message:const s=e.data;s.timestamp=r;for(const e of this.allConversations())!e.closedAt&&e.membersId.indexOf(s.channel_id)>-1&&(t=e);t&&t.newMessage(s);break;case ChatActions.Close:const o=e.data;for(const e of this.allConversations())!e.closedAt&&e.membersId.indexOf(o.from_channel_id)>-1&&(t=e);t&&t.setClosed(r);break;case ChatActions.Leave:const u=e.data;(t=this.conversationById(u.leaved_channel_id))&&t.setLeave(u);break;case ChatActions.Decline:const c=e.data;(t=this.conversationById(c.invite_id))&&t.setDecline(c)}t&&(t.lastAction=e.action,this.eventHandler.emit(WEBSOCKET_EVENT_CHAT,e.action,t),this.conversationDestroyed(t)&&this.destroyConversation(t))}hasAgentTask(e){return!(!this.agent||!e)&&this.agent.hasTask(e)}destroyCall(e){this.callStore.delete(e.id),this.eventHandler.emit(WEBSOCKET_EVENT_CALL,CallActions.Destroy,e)}fileUrlParams(e){const t=[`access_token=${this._config.token}`];if(e){const r=e.replace(/.*;source=([-._A-Za-z0-9/]+).*/,"$1");r&&t.push(`source=${r}`)}return t}}function isJobTask(e){return e.channel===ChannelName.Task}function isDestroyJob(e){return[ChannelState.Missed.toString(),ChannelState.Waiting,ChannelState.WrapTime,JobState.Closed].indexOf(e)>-1}class SipClient extends EventEmitter{}var commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var ee=createCommonjsModule(function(e,t){var r=commonjsGlobal&&commonjsGlobal.__generator||function(e,t){var r,i,a,n,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return n={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function o(n){return function(o){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,i&&(a=2&n[0]?i.return:n[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,n[1])).done)return a;switch(i=0,a&&(n=[2&n[0],a.value]),n[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,i=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(!(a=(a=s.trys).length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=t.call(e,s)}catch(e){n=[6,e],i=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.$listeners=Symbol("EventEmitter.listeners"),t.$addListener=Symbol("EventEmitter.addListener");var i=function(){function e(){this[t.$listeners]={}}return e.count=function(e,r){var i=0,a=e[t.$listeners][r];if(a)for(var n=a.first;++i&&n.next;)n=n.next;return i},e.has=function(e,r){if("*"==r){for(r in e[t.$listeners])return!0;return!1}return void 0!==e[t.$listeners][r]},e.keys=function(e){return Object.keys(e[t.$listeners])},e.unhandle=function(e,r,i,a){return e.on(r,function(){for(var a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];if(!e[t.$listeners][r].first.next)return i.apply(void 0,a)},a)},e.prototype.on=function(e,r,i){return"function"==typeof r?this[t.$addListener](e,r,i):this[t.$addListener](e,void 0,r)},e.prototype.one=function(e,r,i){return"function"==typeof r?this[t.$addListener](e,r,i,!0):this[t.$addListener](e,void 0,r,!0)},e.prototype.off=function(e,r){if("*"==e){var i=this[t.$listeners];if(this[t.$listeners]={},this._onEventUnhandled)for(var a in i)this._onEventUnhandled(a);return this}if("function"==typeof r){var n=this[t.$listeners][e];if(n&&function(e,t){var r=null,i=e.first;for(;;)if(t(i))if(r){if(r.next=i.next,!i.next)break;i=i.next}else{if(!i.next)return null;e.first=i=i.next}else{if(r=i,!i.next)break;i=i.next}return e.last=r,e}(n,function(e){return e.fn==r}))return this}return delete this[t.$listeners][e],this._onEventUnhandled&&this._onEventUnhandled(e),this},e.prototype.emit=function(e){for(var t,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];for(var a=this.listeners(e);;){var n=a.next(),s=n.value;if(n.done)return t;var o=s.apply(void 0,r);void 0!==o&&(t=o)}},e.prototype.listeners=function(e){var i,a,n;return r(this,function(r){switch(r.label){case 0:if(!(i=this[t.$listeners][e]))return[2];a=null,n=i.first,r.label=1;case 1:return[4,n.fn];case 2:if(r.sent(),n.once){if(!a)return n.next?(i.first=n=n.next,[3,1]):(delete this[t.$listeners][e],this._onEventUnhandled&&this._onEventUnhandled(e),[2]);a.next=n.next}else a=n;return n.next?(n=n.next,[3,1]):(i.last=n,[2]);case 3:return[2]}})},e.prototype[t.$addListener]=function(e,r,i,n){var s=this;if(void 0===n&&(n=!1),"object"==typeof e){var o,u=function(){if("function"==typeof e[o]){var r=e[o],u=a(c[t.$listeners],o,{fn:r,once:n,next:null});i&&i.push({dispose:function(){return s.off(o,r)}}),r==u.first.fn&&c._onEventHandled&&c._onEventHandled(o)}},c=this;for(o in e)u();return this}if("function"==typeof r){var l=e,d=a(this[t.$listeners],l,{fn:r,once:n,next:null});i&&i.push({dispose:function(){return s.off(l,r)}}),r==d.first.fn&&this._onEventHandled&&this._onEventHandled(e)}return r},e.ev=t.$listeners,e}();function a(e,t,r){var i=e[t];return i?(i.last.next=r,i.last=r):e[t]=i={first:r,last:r},i}t.EventEmitter=i});unwrapExports(ee);var ee_1=ee.$listeners,ee_2=ee.$addListener,ee_3=ee.EventEmitter;class Session$1{constructor(e,t){this.client=e,this.callId=t,this.incoming=!1,this.instanceId="fixme"}get id(){return this.callId}getLocalMedia(){return[]}getPeerMedia(){return[]}answer(e){return new Promise(e=>{this.client.answer(this.id),e()})}}class ExternalClient extends ee_3{constructor(e){super(),this.config=e,this.type="external",this.schema="wtel://"}async callOption(e){return e}async register(e){}async unregister(){}async call(e){e.destination&&this.exec(e.destination)}answer(e){this.exec(e,"answer")}isRegistered(){return!1}sipSessionByCallId(e){return new Session$1(this,e)}sipSessionBySipId(e){return null}open(e){this.exec(encodeURIComponent(JSON.stringify({token:e,...this.config})),"open")}exec(e,t){let r=`${this.schema}${e}`;t&&(r+=` ${t}`);const i=document.createElement("a");i.download="File name",i.href=r,i.click()}}export{AgentPauseCauseServiceApiAxiosParamCreator,AgentPauseCauseServiceApiFp,AgentPauseCauseServiceApiFactory,AgentPauseCauseServiceApi,AgentServiceApiAxiosParamCreator,AgentServiceApiFp,AgentServiceApiFactory,AgentServiceApi,AgentSkillServiceApiAxiosParamCreator,AgentSkillServiceApiFp,AgentSkillServiceApiFactory,AgentSkillServiceApi,AgentTeamServiceApiAxiosParamCreator,AgentTeamServiceApiFp,AgentTeamServiceApiFactory,AgentTeamServiceApi,AuditFormServiceApiAxiosParamCreator,AuditFormServiceApiFp,AuditFormServiceApiFactory,AuditFormServiceApi,BackendProfileServiceApiAxiosParamCreator,BackendProfileServiceApiFp,BackendProfileServiceApiFactory,BackendProfileServiceApi,BucketServiceApiAxiosParamCreator,BucketServiceApiFp,BucketServiceApiFactory,BucketServiceApi,CalendarServiceApiAxiosParamCreator,CalendarServiceApiFp,CalendarServiceApiFactory,CalendarServiceApi,CallServiceApiAxiosParamCreator,CallServiceApiFp,CallServiceApiFactory,CallServiceApi,CatalogApiAxiosParamCreator,CatalogApiFp,CatalogApiFactory,CatalogApi,ChatHelperServiceApiAxiosParamCreator,ChatHelperServiceApiFp,ChatHelperServiceApiFactory,ChatHelperServiceApi,CognitiveProfileServiceApiAxiosParamCreator,CognitiveProfileServiceApiFp,CognitiveProfileServiceApiFactory,CognitiveProfileServiceApi,CommunicationTypeServiceApiAxiosParamCreator,CommunicationTypeServiceApiFp,CommunicationTypeServiceApiFactory,CommunicationTypeServiceApi,ConfigServiceApiAxiosParamCreator,ConfigServiceApiFp,ConfigServiceApiFactory,ConfigServiceApi,ContactsApiAxiosParamCreator,ContactsApiFp,ContactsApiFactory,ContactsApi,EmailProfileServiceApiAxiosParamCreator,EmailProfileServiceApiFp,EmailProfileServiceApiFactory,EmailProfileServiceApi,EmailsApiAxiosParamCreator,EmailsApiFp,EmailsApiFactory,EmailsApi,FileServiceApiAxiosParamCreator,FileServiceApiFp,FileServiceApiFactory,FileServiceApi,FileTranscriptServiceApiAxiosParamCreator,FileTranscriptServiceApiFp,FileTranscriptServiceApiFactory,FileTranscriptServiceApi,ImportTemplateServiceApiAxiosParamCreator,ImportTemplateServiceApiFp,ImportTemplateServiceApiFactory,ImportTemplateServiceApi,LabelsApiAxiosParamCreator,LabelsApiFp,LabelsApiFactory,LabelsApi,ListServiceApiAxiosParamCreator,ListServiceApiFp,ListServiceApiFactory,ListServiceApi,LoggerServiceApiAxiosParamCreator,LoggerServiceApiFp,LoggerServiceApiFactory,LoggerServiceApi,ManagersApiAxiosParamCreator,ManagersApiFp,ManagersApiFactory,ManagersApi,MediaFileServiceApiAxiosParamCreator,MediaFileServiceApiFp,MediaFileServiceApiFactory,MediaFileServiceApi,MemberServiceApiAxiosParamCreator,MemberServiceApiFp,MemberServiceApiFactory,MemberServiceApi,OutboundResourceGroupServiceApiAxiosParamCreator,OutboundResourceGroupServiceApiFp,OutboundResourceGroupServiceApiFactory,OutboundResourceGroupServiceApi,OutboundResourceServiceApiAxiosParamCreator,OutboundResourceServiceApiFp,OutboundResourceServiceApiFactory,OutboundResourceServiceApi,PhonesApiAxiosParamCreator,PhonesApiFp,PhonesApiFactory,PhonesApi,PresetQueryServiceApiAxiosParamCreator,PresetQueryServiceApiFp,PresetQueryServiceApiFactory,PresetQueryServiceApi,QueueBucketServiceApiAxiosParamCreator,QueueBucketServiceApiFp,QueueBucketServiceApiFactory,QueueBucketServiceApi,QueueHookServiceApiAxiosParamCreator,QueueHookServiceApiFp,QueueHookServiceApiFactory,QueueHookServiceApi,QueueResourcesServiceApiAxiosParamCreator,QueueResourcesServiceApiFp,QueueResourcesServiceApiFactory,QueueResourcesServiceApi,QueueServiceApiAxiosParamCreator,QueueServiceApiFp,QueueServiceApiFactory,QueueServiceApi,QueueSkillServiceApiAxiosParamCreator,QueueSkillServiceApiFp,QueueSkillServiceApiFactory,QueueSkillServiceApi,RegionServiceApiAxiosParamCreator,RegionServiceApiFp,RegionServiceApiFactory,RegionServiceApi,RoutingChatPlanServiceApiAxiosParamCreator,RoutingChatPlanServiceApiFp,RoutingChatPlanServiceApiFactory,RoutingChatPlanServiceApi,RoutingOutboundCallServiceApiAxiosParamCreator,RoutingOutboundCallServiceApiFp,RoutingOutboundCallServiceApiFactory,RoutingOutboundCallServiceApi,RoutingSchemaServiceApiAxiosParamCreator,RoutingSchemaServiceApiFp,RoutingSchemaServiceApiFactory,RoutingSchemaServiceApi,RoutingVariableServiceApiAxiosParamCreator,RoutingVariableServiceApiFp,RoutingVariableServiceApiFactory,RoutingVariableServiceApi,SkillServiceApiAxiosParamCreator,SkillServiceApiFp,SkillServiceApiFactory,SkillServiceApi,SystemSettingServiceApiAxiosParamCreator,SystemSettingServiceApiFp,SystemSettingServiceApiFactory,SystemSettingServiceApi,TimezonesApiAxiosParamCreator,TimezonesApiFp,TimezonesApiFactory,TimezonesApi,TriggerServiceApiAxiosParamCreator,TriggerServiceApiFp,TriggerServiceApiFactory,TriggerServiceApi,UserHelperServiceApiAxiosParamCreator,UserHelperServiceApiFp,UserHelperServiceApiFactory,UserHelperServiceApi,VariablesApiAxiosParamCreator,VariablesApiFp,VariablesApiFactory,VariablesApi,Configuration,EngineAuditQuestionType,EngineBoolFilter,EngineCommunicationChannels,EnginePresetQuerySection,EngineRoutingSchemaType,EngineSystemSettingName,EngineTriggerJobState,EngineTriggerType,GoogleProtobufNullValue,HistoryFileJobHistoryFileJobAction,HistoryFileJobHistoryFileJobState,LoggerAction,LoggerAvailableSystemObjects,ProtobufNullValue,StorageImportSourceType,StorageProviderType,StorageServiceType,StorageUploadStatusCode,WebitelContactsAccessMode,JobState,Response,Client,CallReportingStatus,EavesdropState,EavesdropType,CallActions,CallDirection,Call,AgentStatus,ChannelState,ChannelType,Agent,DeclineCause,ChatActions,ConversationState,Conversation,TypeErrors,DeviceNotFoundError,DeviceNotAllowPermissionError,RolePermissionError,LicencePermissionError,PauseNotAllowedError,SipClient,ExternalClient,SipPhone,Log};
2
2
  //# sourceMappingURL=index.esm.min.js.map