webitel-sdk 0.1.133 → 0.1.136

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 (57) hide show
  1. package/bundles/index.esm.min.js +1 -1
  2. package/bundles/index.esm.min.js.map +1 -1
  3. package/bundles/index.umd.min.js +1 -1
  4. package/bundles/index.umd.min.js.map +1 -1
  5. package/esm2015/api/email-profile-service-api.js +122 -41
  6. package/esm2015/api/email-profile-service-api.js.map +1 -1
  7. package/esm2015/api/engine-patch-email-profile-request.js +13 -0
  8. package/esm2015/api/engine-patch-email-profile-request.js.map +1 -0
  9. package/esm2015/api/index.js.map +1 -1
  10. package/esm5/api/email-profile-service-api.js +135 -41
  11. package/esm5/api/email-profile-service-api.js.map +1 -1
  12. package/esm5/api/engine-patch-email-profile-request.js +13 -0
  13. package/esm5/api/engine-patch-email-profile-request.js.map +1 -0
  14. package/esm5/api/index.js.map +1 -1
  15. package/package.json +3 -3
  16. package/types/api/agent-pause-cause-service-api.d.ts +6 -6
  17. package/types/api/agent-service-api.d.ts +19 -19
  18. package/types/api/agent-skill-service-api.d.ts +7 -7
  19. package/types/api/agent-team-service-api.d.ts +5 -5
  20. package/types/api/backend-profile-service-api.d.ts +6 -6
  21. package/types/api/bucket-service-api.d.ts +5 -5
  22. package/types/api/calendar-service-api.d.ts +6 -6
  23. package/types/api/call-service-api.d.ts +15 -15
  24. package/types/api/cognitive-profile-service-api.d.ts +6 -6
  25. package/types/api/communication-type-service-api.d.ts +5 -5
  26. package/types/api/email-profile-service-api.d.ts +48 -26
  27. package/types/api/email-profile-service-api.d.ts.map +1 -1
  28. package/types/api/engine-create-email-profile-request.d.ts +8 -14
  29. package/types/api/engine-create-email-profile-request.d.ts.map +1 -1
  30. package/types/api/engine-email-profile.d.ts +0 -6
  31. package/types/api/engine-email-profile.d.ts.map +1 -1
  32. package/types/api/engine-patch-email-profile-request.d.ts +92 -0
  33. package/types/api/engine-patch-email-profile-request.d.ts.map +1 -0
  34. package/types/api/engine-update-email-profile-request.d.ts +9 -15
  35. package/types/api/engine-update-email-profile-request.d.ts.map +1 -1
  36. package/types/api/file-service-api.d.ts +1 -1
  37. package/types/api/file-transcript-service-api.d.ts +2 -2
  38. package/types/api/import-template-service-api.d.ts +6 -6
  39. package/types/api/index.d.ts +1 -0
  40. package/types/api/index.d.ts.map +1 -1
  41. package/types/api/list-service-api.d.ts +10 -10
  42. package/types/api/media-file-service-api.d.ts +3 -3
  43. package/types/api/member-service-api.d.ts +17 -17
  44. package/types/api/outbound-resource-group-service-api.d.ts +10 -10
  45. package/types/api/outbound-resource-service-api.d.ts +11 -11
  46. package/types/api/queue-bucket-service-api.d.ts +6 -6
  47. package/types/api/queue-hook-service-api.d.ts +6 -6
  48. package/types/api/queue-resources-service-api.d.ts +5 -5
  49. package/types/api/queue-service-api.d.ts +7 -7
  50. package/types/api/queue-skill-service-api.d.ts +6 -6
  51. package/types/api/region-service-api.d.ts +6 -6
  52. package/types/api/routing-chat-plan-service-api.d.ts +6 -6
  53. package/types/api/routing-outbound-call-service-api.d.ts +7 -7
  54. package/types/api/routing-schema-service-api.d.ts +6 -6
  55. package/types/api/routing-variable-service-api.d.ts +5 -5
  56. package/types/api/skill-service-api.d.ts +5 -5
  57. package/types/api/user-helper-service-api.d.ts +1 -1
@@ -1,2 +1,2 @@
1
- import{parse,format}from"url";import globalAxios from"axios";import{EventEmitter}from"ee-ts";import{debug,WebSocketInterface,UA}from"jssip";const BASE_PATH="https://dev.webitel.com/api".replace(/\/+$/,"");class BaseAPI{constructor(e,t=BASE_PATH,i=globalAxios){this.basePath=t,this.axios=i,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,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgentPauseCause.");const r=parse("/call_center/pause_causes",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteAgentPauseCause:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteAgentPauseCause.");const r="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},patchAgentPauseCause:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchAgentPauseCause.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readAgentPauseCause:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readAgentPauseCause.");const r="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},searchAgentPauseCause:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentPauseCause.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},AgentPauseCauseServiceApiFp=function(e){return{async createAgentPauseCause(t,i){const r=await AgentPauseCauseServiceApiAxiosParamCreator(e).createAgentPauseCause(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteAgentPauseCause(t,i){const r=await AgentPauseCauseServiceApiAxiosParamCreator(e).deleteAgentPauseCause(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async patchAgentPauseCause(t,i,r){const a=await AgentPauseCauseServiceApiAxiosParamCreator(e).patchAgentPauseCause(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readAgentPauseCause(t,i){const r=await AgentPauseCauseServiceApiAxiosParamCreator(e).readAgentPauseCause(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async searchAgentPauseCause(t,i,r,a,n,s,o){const u=await AgentPauseCauseServiceApiAxiosParamCreator(e).searchAgentPauseCause(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async updateAgentPauseCause(t,i,r){const a=await AgentPauseCauseServiceApiAxiosParamCreator(e).updateAgentPauseCause(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},AgentPauseCauseServiceApiFactory=function(e,t,i){return{createAgentPauseCause:(r,a)=>AgentPauseCauseServiceApiFp(e).createAgentPauseCause(r,a).then(e=>e(i,t)),deleteAgentPauseCause:(r,a)=>AgentPauseCauseServiceApiFp(e).deleteAgentPauseCause(r,a).then(e=>e(i,t)),patchAgentPauseCause:(r,a,n)=>AgentPauseCauseServiceApiFp(e).patchAgentPauseCause(r,a,n).then(e=>e(i,t)),readAgentPauseCause:(r,a)=>AgentPauseCauseServiceApiFp(e).readAgentPauseCause(r,a).then(e=>e(i,t)),searchAgentPauseCause:(r,a,n,s,o,u,c)=>AgentPauseCauseServiceApiFp(e).searchAgentPauseCause(r,a,n,s,o,u,c).then(e=>e(i,t)),updateAgentPauseCause:(r,a,n)=>AgentPauseCauseServiceApiFp(e).updateAgentPauseCause(r,a,n).then(e=>e(i,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,i){return AgentPauseCauseServiceApiFp(this.configuration).patchAgentPauseCause(e,t,i).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,i,r,a,n,s){return AgentPauseCauseServiceApiFp(this.configuration).searchAgentPauseCause(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}updateAgentPauseCause(e,t,i){return AgentPauseCauseServiceApiFp(this.configuration).updateAgentPauseCause(e,t,i).then(e=>e(this.axios,this.basePath))}}const AgentServiceApiAxiosParamCreator=function(e){return{agentSetState:async(t,i,r={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentSetState.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},agentStateHistory:async(t,i,r,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!==i&&(y.page=i),void 0!==r&&(y.size=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...u.headers},{url:format(l),options:p}},agentTodayStatistics:async(t,i,r={})=>{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,...r},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}i&&(c.fields=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},createAgent:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgent.");const r=parse("/call_center/agents",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteAgent:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},patchAgent:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchAgent.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readAgent:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchAgent:async(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b={})=>{const S=parse("/call_center/agents",!0);let w;e&&(w=e.baseOptions);const v={method:"GET",...w,...b},q={},C={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;q["X-Webitel-Access"]=t}void 0!==t&&(C.page=t),void 0!==i&&(C.size=i),void 0!==r&&(C.q=r),void 0!==a&&(C.sort=a),n&&(C.fields=n),s&&(C.id=s),o&&(C.allow_channels=o),u&&(C.supervisor_id=u),c&&(C.team_id=c),l&&(C.region_id=l),d&&(C.auditor_id=d),void 0!==p&&(C.is_supervisor=p),h&&(C.skill_id=h),y&&(C.queue_id=y),void 0!==A&&(C.not_supervisor=A),g&&(C.user_id=g),m&&(C.extension=m),f&&(C.not_team_id=f),S.query={...S.query,...C,...b.query},delete S.search;let R=w&&w.headers?w.headers:{};return v.headers={...q,...R,...b.headers},{url:format(S),options:v}},searchAgentCallStatistics:async(t,i,r,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={},A={};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&&(A.page=t),void 0!==i&&(A.size=i),void 0!==r&&(A["time.from"]=r),void 0!==a&&(A["time.to"]=a),n&&(A.agent_id=n),void 0!==s&&(A.domain_id=s),void 0!==o&&(A.q=o),u&&(A.fields=u),void 0!==c&&(A.sort=c),d.query={...d.query,...A,...l.query},delete d.search;let g=p&&p.headers?p.headers:{};return h.headers={...y,...g,...l.headers},{url:format(d),options:h}},searchAgentInQueue:async(t,i,r,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!==i&&(h.page=i),void 0!==r&&(h.size=r),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,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchAgentInTeam:async(t,i,r,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!==i&&(p.page=i),void 0!==r&&(p.size=r),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,i,r,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!==i&&(y.size=i),void 0!==r&&(y["joined_at.from"]=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...c.headers},{url:format(l),options:p}},searchAgentStatusStatistic:async(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b={})=>{const S=parse("/call_center/agents/reports/status",!0);let w;e&&(w=e.baseOptions);const v={method:"GET",...w,...b},q={},C={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;q["X-Webitel-Access"]=t}void 0!==t&&(C.page=t),void 0!==i&&(C.size=i),void 0!==r&&(C.q=r),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),A&&(C.skill_id=A),g&&(C.region_id=g),m&&(C.supervisor_id=m),f&&(C.auditor_id=f),S.query={...S.query,...C,...b.query},delete S.search;let R=w&&w.headers?w.headers:{};return v.headers={...q,...R,...b.headers},{url:format(S),options:v}},searchAgentStatusStatisticItem:async(t,i,r,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!==i&&(l["time.from"]=i),void 0!==r&&(l["time.to"]=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}},searchLookupUsersAgentNotExists:async(t,i,r,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!==i&&(l.size=i),void 0!==r&&(l.q=r),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,i,r={})=>{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,...r},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!==i&&(c.allow_change=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},updateAgent:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgent.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},updateAgentStatus:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentStatus.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},AgentServiceApiFp=function(e){return{async agentSetState(t,i,r){const a=await AgentServiceApiAxiosParamCreator(e).agentSetState(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async agentStateHistory(t,i,r,a,n,s,o,u){const c=await AgentServiceApiAxiosParamCreator(e).agentStateHistory(t,i,r,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const i={...c.options,url:t+c.url};return e.request(i)}},async agentTodayStatistics(t,i,r){const a=await AgentServiceApiAxiosParamCreator(e).agentTodayStatistics(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async createAgent(t,i){const r=await AgentServiceApiAxiosParamCreator(e).createAgent(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteAgent(t,i,r){const a=await AgentServiceApiAxiosParamCreator(e).deleteAgent(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async patchAgent(t,i,r){const a=await AgentServiceApiAxiosParamCreator(e).patchAgent(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readAgent(t,i,r){const a=await AgentServiceApiAxiosParamCreator(e).readAgent(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchAgent(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b){const S=await AgentServiceApiAxiosParamCreator(e).searchAgent(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b);return(e=globalAxios,t=BASE_PATH)=>{const i={...S.options,url:t+S.url};return e.request(i)}},async searchAgentCallStatistics(t,i,r,a,n,s,o,u,c,l){const d=await AgentServiceApiAxiosParamCreator(e).searchAgentCallStatistics(t,i,r,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const i={...d.options,url:t+d.url};return e.request(i)}},async searchAgentInQueue(t,i,r,a,n,s,o){const u=await AgentServiceApiAxiosParamCreator(e).searchAgentInQueue(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async searchAgentInQueueStatistics(t,i,r){const a=await AgentServiceApiAxiosParamCreator(e).searchAgentInQueueStatistics(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchAgentInTeam(t,i,r,a,n,s){const o=await AgentServiceApiAxiosParamCreator(e).searchAgentInTeam(t,i,r,a,n,s);return(e=globalAxios,t=BASE_PATH)=>{const i={...o.options,url:t+o.url};return e.request(i)}},async searchAgentStateHistory(t,i,r,a,n,s,o,u,c){const l=await AgentServiceApiAxiosParamCreator(e).searchAgentStateHistory(t,i,r,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const i={...l.options,url:t+l.url};return e.request(i)}},async searchAgentStatusStatistic(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b){const S=await AgentServiceApiAxiosParamCreator(e).searchAgentStatusStatistic(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b);return(e=globalAxios,t=BASE_PATH)=>{const i={...S.options,url:t+S.url};return e.request(i)}},async searchAgentStatusStatisticItem(t,i,r,a){const n=await AgentServiceApiAxiosParamCreator(e).searchAgentStatusStatisticItem(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async searchLookupUsersAgentNotExists(t,i,r,a,n){const s=await AgentServiceApiAxiosParamCreator(e).searchLookupUsersAgentNotExists(t,i,r,a,n);return(e=globalAxios,t=BASE_PATH)=>{const i={...s.options,url:t+s.url};return e.request(i)}},async searchPauseCauseForAgent(t,i,r){const a=await AgentServiceApiAxiosParamCreator(e).searchPauseCauseForAgent(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async updateAgent(t,i,r){const a=await AgentServiceApiAxiosParamCreator(e).updateAgent(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async updateAgentStatus(t,i,r){const a=await AgentServiceApiAxiosParamCreator(e).updateAgentStatus(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},AgentServiceApiFactory=function(e,t,i){return{agentSetState:(r,a,n)=>AgentServiceApiFp(e).agentSetState(r,a,n).then(e=>e(i,t)),agentStateHistory:(r,a,n,s,o,u,c,l)=>AgentServiceApiFp(e).agentStateHistory(r,a,n,s,o,u,c,l).then(e=>e(i,t)),agentTodayStatistics:(r,a,n)=>AgentServiceApiFp(e).agentTodayStatistics(r,a,n).then(e=>e(i,t)),createAgent:(r,a)=>AgentServiceApiFp(e).createAgent(r,a).then(e=>e(i,t)),deleteAgent:(r,a,n)=>AgentServiceApiFp(e).deleteAgent(r,a,n).then(e=>e(i,t)),patchAgent:(r,a,n)=>AgentServiceApiFp(e).patchAgent(r,a,n).then(e=>e(i,t)),readAgent:(r,a,n)=>AgentServiceApiFp(e).readAgent(r,a,n).then(e=>e(i,t)),searchAgent:(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w)=>AgentServiceApiFp(e).searchAgent(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w).then(e=>e(i,t)),searchAgentCallStatistics:(r,a,n,s,o,u,c,l,d,p)=>AgentServiceApiFp(e).searchAgentCallStatistics(r,a,n,s,o,u,c,l,d,p).then(e=>e(i,t)),searchAgentInQueue:(r,a,n,s,o,u,c)=>AgentServiceApiFp(e).searchAgentInQueue(r,a,n,s,o,u,c).then(e=>e(i,t)),searchAgentInQueueStatistics:(r,a,n)=>AgentServiceApiFp(e).searchAgentInQueueStatistics(r,a,n).then(e=>e(i,t)),searchAgentInTeam:(r,a,n,s,o,u)=>AgentServiceApiFp(e).searchAgentInTeam(r,a,n,s,o,u).then(e=>e(i,t)),searchAgentStateHistory:(r,a,n,s,o,u,c,l,d)=>AgentServiceApiFp(e).searchAgentStateHistory(r,a,n,s,o,u,c,l,d).then(e=>e(i,t)),searchAgentStatusStatistic:(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w)=>AgentServiceApiFp(e).searchAgentStatusStatistic(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w).then(e=>e(i,t)),searchAgentStatusStatisticItem:(r,a,n,s)=>AgentServiceApiFp(e).searchAgentStatusStatisticItem(r,a,n,s).then(e=>e(i,t)),searchLookupUsersAgentNotExists:(r,a,n,s,o)=>AgentServiceApiFp(e).searchLookupUsersAgentNotExists(r,a,n,s,o).then(e=>e(i,t)),searchPauseCauseForAgent:(r,a,n)=>AgentServiceApiFp(e).searchPauseCauseForAgent(r,a,n).then(e=>e(i,t)),updateAgent:(r,a,n)=>AgentServiceApiFp(e).updateAgent(r,a,n).then(e=>e(i,t)),updateAgentStatus:(r,a,n)=>AgentServiceApiFp(e).updateAgentStatus(r,a,n).then(e=>e(i,t))}};class AgentServiceApi extends BaseAPI{agentSetState(e,t,i){return AgentServiceApiFp(this.configuration).agentSetState(e,t,i).then(e=>e(this.axios,this.basePath))}agentStateHistory(e,t,i,r,a,n,s,o){return AgentServiceApiFp(this.configuration).agentStateHistory(e,t,i,r,a,n,s,o).then(e=>e(this.axios,this.basePath))}agentTodayStatistics(e,t,i){return AgentServiceApiFp(this.configuration).agentTodayStatistics(e,t,i).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,i){return AgentServiceApiFp(this.configuration).deleteAgent(e,t,i).then(e=>e(this.axios,this.basePath))}patchAgent(e,t,i){return AgentServiceApiFp(this.configuration).patchAgent(e,t,i).then(e=>e(this.axios,this.basePath))}readAgent(e,t,i){return AgentServiceApiFp(this.configuration).readAgent(e,t,i).then(e=>e(this.axios,this.basePath))}searchAgent(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f){return AgentServiceApiFp(this.configuration).searchAgent(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f).then(e=>e(this.axios,this.basePath))}searchAgentCallStatistics(e,t,i,r,a,n,s,o,u,c){return AgentServiceApiFp(this.configuration).searchAgentCallStatistics(e,t,i,r,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}searchAgentInQueue(e,t,i,r,a,n,s){return AgentServiceApiFp(this.configuration).searchAgentInQueue(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}searchAgentInQueueStatistics(e,t,i){return AgentServiceApiFp(this.configuration).searchAgentInQueueStatistics(e,t,i).then(e=>e(this.axios,this.basePath))}searchAgentInTeam(e,t,i,r,a,n){return AgentServiceApiFp(this.configuration).searchAgentInTeam(e,t,i,r,a,n).then(e=>e(this.axios,this.basePath))}searchAgentStateHistory(e,t,i,r,a,n,s,o,u){return AgentServiceApiFp(this.configuration).searchAgentStateHistory(e,t,i,r,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}searchAgentStatusStatistic(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f){return AgentServiceApiFp(this.configuration).searchAgentStatusStatistic(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f).then(e=>e(this.axios,this.basePath))}searchAgentStatusStatisticItem(e,t,i,r){return AgentServiceApiFp(this.configuration).searchAgentStatusStatisticItem(e,t,i,r).then(e=>e(this.axios,this.basePath))}searchLookupUsersAgentNotExists(e,t,i,r,a){return AgentServiceApiFp(this.configuration).searchLookupUsersAgentNotExists(e,t,i,r,a).then(e=>e(this.axios,this.basePath))}searchPauseCauseForAgent(e,t,i){return AgentServiceApiFp(this.configuration).searchPauseCauseForAgent(e,t,i).then(e=>e(this.axios,this.basePath))}updateAgent(e,t,i){return AgentServiceApiFp(this.configuration).updateAgent(e,t,i).then(e=>e(this.axios,this.basePath))}updateAgentStatus(e,t,i){return AgentServiceApiFp(this.configuration).updateAgentStatus(e,t,i).then(e=>e(this.axios,this.basePath))}}const AgentSkillServiceApiAxiosParamCreator=function(e){return{createAgentSkill:async(t,i,r={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling createAgentSkill.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteAgentSkill:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling deleteAgentSkill.");if(null==i)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(i))),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!==r&&(l.domain_id=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}},patchAgentSkill:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling patchAgentSkill.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling patchAgentSkill.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},readAgentSkill:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling readAgentSkill.");if(null==i)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(i))),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.domain_id=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}},searchAgentSkill:async(t,i,r,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling searchAgentSkill.");const c="/call_center/agents/{agent_id}/skills".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!==i&&(y.page=i),void 0!==r&&(y.size=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...u.headers},{url:format(l),options:p}},searchLookupAgentNotExistsSkill:async(t,i,r,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!==i&&(p.page=i),void 0!==r&&(p.size=r),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,i,r,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling updateAgentSkill.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentSkill.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},AgentSkillServiceApiFp=function(e){return{async createAgentSkill(t,i,r){const a=await AgentSkillServiceApiAxiosParamCreator(e).createAgentSkill(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteAgentSkill(t,i,r,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).deleteAgentSkill(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async patchAgentSkill(t,i,r,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).patchAgentSkill(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async readAgentSkill(t,i,r,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).readAgentSkill(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async searchAgentSkill(t,i,r,a,n,s,o,u){const c=await AgentSkillServiceApiAxiosParamCreator(e).searchAgentSkill(t,i,r,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const i={...c.options,url:t+c.url};return e.request(i)}},async searchLookupAgentNotExistsSkill(t,i,r,a,n,s){const o=await AgentSkillServiceApiAxiosParamCreator(e).searchLookupAgentNotExistsSkill(t,i,r,a,n,s);return(e=globalAxios,t=BASE_PATH)=>{const i={...o.options,url:t+o.url};return e.request(i)}},async updateAgentSkill(t,i,r,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).updateAgentSkill(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},AgentSkillServiceApiFactory=function(e,t,i){return{createAgentSkill:(r,a,n)=>AgentSkillServiceApiFp(e).createAgentSkill(r,a,n).then(e=>e(i,t)),deleteAgentSkill:(r,a,n,s)=>AgentSkillServiceApiFp(e).deleteAgentSkill(r,a,n,s).then(e=>e(i,t)),patchAgentSkill:(r,a,n,s)=>AgentSkillServiceApiFp(e).patchAgentSkill(r,a,n,s).then(e=>e(i,t)),readAgentSkill:(r,a,n,s)=>AgentSkillServiceApiFp(e).readAgentSkill(r,a,n,s).then(e=>e(i,t)),searchAgentSkill:(r,a,n,s,o,u,c,l)=>AgentSkillServiceApiFp(e).searchAgentSkill(r,a,n,s,o,u,c,l).then(e=>e(i,t)),searchLookupAgentNotExistsSkill:(r,a,n,s,o,u)=>AgentSkillServiceApiFp(e).searchLookupAgentNotExistsSkill(r,a,n,s,o,u).then(e=>e(i,t)),updateAgentSkill:(r,a,n,s)=>AgentSkillServiceApiFp(e).updateAgentSkill(r,a,n,s).then(e=>e(i,t))}};class AgentSkillServiceApi extends BaseAPI{createAgentSkill(e,t,i){return AgentSkillServiceApiFp(this.configuration).createAgentSkill(e,t,i).then(e=>e(this.axios,this.basePath))}deleteAgentSkill(e,t,i,r){return AgentSkillServiceApiFp(this.configuration).deleteAgentSkill(e,t,i,r).then(e=>e(this.axios,this.basePath))}patchAgentSkill(e,t,i,r){return AgentSkillServiceApiFp(this.configuration).patchAgentSkill(e,t,i,r).then(e=>e(this.axios,this.basePath))}readAgentSkill(e,t,i,r){return AgentSkillServiceApiFp(this.configuration).readAgentSkill(e,t,i,r).then(e=>e(this.axios,this.basePath))}searchAgentSkill(e,t,i,r,a,n,s,o){return AgentSkillServiceApiFp(this.configuration).searchAgentSkill(e,t,i,r,a,n,s,o).then(e=>e(this.axios,this.basePath))}searchLookupAgentNotExistsSkill(e,t,i,r,a,n){return AgentSkillServiceApiFp(this.configuration).searchLookupAgentNotExistsSkill(e,t,i,r,a,n).then(e=>e(this.axios,this.basePath))}updateAgentSkill(e,t,i,r){return AgentSkillServiceApiFp(this.configuration).updateAgentSkill(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const AgentTeamServiceApiAxiosParamCreator=function(e){return{createAgentTeam:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgentTeam.");const r=parse("/call_center/teams",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteAgentTeam:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readAgentTeam:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchAgentTeam:async(t,i,r,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!==i&&(y.size=i),void 0!==r&&(y.q=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...c.headers},{url:format(l),options:p}},updateAgentTeam:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentTeam.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},AgentTeamServiceApiFp=function(e){return{async createAgentTeam(t,i){const r=await AgentTeamServiceApiAxiosParamCreator(e).createAgentTeam(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteAgentTeam(t,i,r){const a=await AgentTeamServiceApiAxiosParamCreator(e).deleteAgentTeam(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readAgentTeam(t,i,r){const a=await AgentTeamServiceApiAxiosParamCreator(e).readAgentTeam(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchAgentTeam(t,i,r,a,n,s,o,u,c){const l=await AgentTeamServiceApiAxiosParamCreator(e).searchAgentTeam(t,i,r,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const i={...l.options,url:t+l.url};return e.request(i)}},async updateAgentTeam(t,i,r){const a=await AgentTeamServiceApiAxiosParamCreator(e).updateAgentTeam(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},AgentTeamServiceApiFactory=function(e,t,i){return{createAgentTeam:(r,a)=>AgentTeamServiceApiFp(e).createAgentTeam(r,a).then(e=>e(i,t)),deleteAgentTeam:(r,a,n)=>AgentTeamServiceApiFp(e).deleteAgentTeam(r,a,n).then(e=>e(i,t)),readAgentTeam:(r,a,n)=>AgentTeamServiceApiFp(e).readAgentTeam(r,a,n).then(e=>e(i,t)),searchAgentTeam:(r,a,n,s,o,u,c,l,d)=>AgentTeamServiceApiFp(e).searchAgentTeam(r,a,n,s,o,u,c,l,d).then(e=>e(i,t)),updateAgentTeam:(r,a,n)=>AgentTeamServiceApiFp(e).updateAgentTeam(r,a,n).then(e=>e(i,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,i){return AgentTeamServiceApiFp(this.configuration).deleteAgentTeam(e,t,i).then(e=>e(this.axios,this.basePath))}readAgentTeam(e,t,i){return AgentTeamServiceApiFp(this.configuration).readAgentTeam(e,t,i).then(e=>e(this.axios,this.basePath))}searchAgentTeam(e,t,i,r,a,n,s,o,u){return AgentTeamServiceApiFp(this.configuration).searchAgentTeam(e,t,i,r,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateAgentTeam(e,t,i){return AgentTeamServiceApiFp(this.configuration).updateAgentTeam(e,t,i).then(e=>e(this.axios,this.basePath))}}const BackendProfileServiceApiAxiosParamCreator=function(e){return{createBackendProfile:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createBackendProfile.");const r=parse("/storage/backend_profiles",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteBackendProfile:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},patchBackendProfile:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchBackendProfile.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readBackendProfile:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchBackendProfile:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateBackendProfile.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},BackendProfileServiceApiFp=function(e){return{async createBackendProfile(t,i){const r=await BackendProfileServiceApiAxiosParamCreator(e).createBackendProfile(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteBackendProfile(t,i,r){const a=await BackendProfileServiceApiAxiosParamCreator(e).deleteBackendProfile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async patchBackendProfile(t,i,r){const a=await BackendProfileServiceApiAxiosParamCreator(e).patchBackendProfile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readBackendProfile(t,i,r){const a=await BackendProfileServiceApiAxiosParamCreator(e).readBackendProfile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchBackendProfile(t,i,r,a,n,s,o){const u=await BackendProfileServiceApiAxiosParamCreator(e).searchBackendProfile(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async updateBackendProfile(t,i,r){const a=await BackendProfileServiceApiAxiosParamCreator(e).updateBackendProfile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},BackendProfileServiceApiFactory=function(e,t,i){return{createBackendProfile:(r,a)=>BackendProfileServiceApiFp(e).createBackendProfile(r,a).then(e=>e(i,t)),deleteBackendProfile:(r,a,n)=>BackendProfileServiceApiFp(e).deleteBackendProfile(r,a,n).then(e=>e(i,t)),patchBackendProfile:(r,a,n)=>BackendProfileServiceApiFp(e).patchBackendProfile(r,a,n).then(e=>e(i,t)),readBackendProfile:(r,a,n)=>BackendProfileServiceApiFp(e).readBackendProfile(r,a,n).then(e=>e(i,t)),searchBackendProfile:(r,a,n,s,o,u,c)=>BackendProfileServiceApiFp(e).searchBackendProfile(r,a,n,s,o,u,c).then(e=>e(i,t)),updateBackendProfile:(r,a,n)=>BackendProfileServiceApiFp(e).updateBackendProfile(r,a,n).then(e=>e(i,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,i){return BackendProfileServiceApiFp(this.configuration).deleteBackendProfile(e,t,i).then(e=>e(this.axios,this.basePath))}patchBackendProfile(e,t,i){return BackendProfileServiceApiFp(this.configuration).patchBackendProfile(e,t,i).then(e=>e(this.axios,this.basePath))}readBackendProfile(e,t,i){return BackendProfileServiceApiFp(this.configuration).readBackendProfile(e,t,i).then(e=>e(this.axios,this.basePath))}searchBackendProfile(e,t,i,r,a,n,s){return BackendProfileServiceApiFp(this.configuration).searchBackendProfile(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}updateBackendProfile(e,t,i){return BackendProfileServiceApiFp(this.configuration).updateBackendProfile(e,t,i).then(e=>e(this.axios,this.basePath))}}const BucketServiceApiAxiosParamCreator=function(e){return{createBucket:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createBucket.");const r=parse("/call_center/buckets",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteBucket:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readBucket:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchBucket:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateBucket.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},BucketServiceApiFp=function(e){return{async createBucket(t,i){const r=await BucketServiceApiAxiosParamCreator(e).createBucket(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteBucket(t,i,r){const a=await BucketServiceApiAxiosParamCreator(e).deleteBucket(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readBucket(t,i,r){const a=await BucketServiceApiAxiosParamCreator(e).readBucket(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchBucket(t,i,r,a,n,s,o){const u=await BucketServiceApiAxiosParamCreator(e).searchBucket(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async updateBucket(t,i,r){const a=await BucketServiceApiAxiosParamCreator(e).updateBucket(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},BucketServiceApiFactory=function(e,t,i){return{createBucket:(r,a)=>BucketServiceApiFp(e).createBucket(r,a).then(e=>e(i,t)),deleteBucket:(r,a,n)=>BucketServiceApiFp(e).deleteBucket(r,a,n).then(e=>e(i,t)),readBucket:(r,a,n)=>BucketServiceApiFp(e).readBucket(r,a,n).then(e=>e(i,t)),searchBucket:(r,a,n,s,o,u,c)=>BucketServiceApiFp(e).searchBucket(r,a,n,s,o,u,c).then(e=>e(i,t)),updateBucket:(r,a,n)=>BucketServiceApiFp(e).updateBucket(r,a,n).then(e=>e(i,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,i){return BucketServiceApiFp(this.configuration).deleteBucket(e,t,i).then(e=>e(this.axios,this.basePath))}readBucket(e,t,i){return BucketServiceApiFp(this.configuration).readBucket(e,t,i).then(e=>e(this.axios,this.basePath))}searchBucket(e,t,i,r,a,n,s){return BucketServiceApiFp(this.configuration).searchBucket(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}updateBucket(e,t,i){return BucketServiceApiFp(this.configuration).updateBucket(e,t,i).then(e=>e(this.axios,this.basePath))}}const CalendarServiceApiAxiosParamCreator=function(e){return{createCalendar:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCalendar.");const r=parse("/calendars",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteCalendar:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readCalendar:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchCalendar:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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,i,r,a={})=>{const n=parse("/calendars/timezones",!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!==i&&(c.size=i),void 0!==r&&(c.q=r),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}},updateCalendar:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCalendar.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},CalendarServiceApiFp=function(e){return{async createCalendar(t,i){const r=await CalendarServiceApiAxiosParamCreator(e).createCalendar(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteCalendar(t,i,r){const a=await CalendarServiceApiAxiosParamCreator(e).deleteCalendar(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readCalendar(t,i,r){const a=await CalendarServiceApiAxiosParamCreator(e).readCalendar(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchCalendar(t,i,r,a,n,s,o){const u=await CalendarServiceApiAxiosParamCreator(e).searchCalendar(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async searchTimezones(t,i,r,a){const n=await CalendarServiceApiAxiosParamCreator(e).searchTimezones(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async updateCalendar(t,i,r){const a=await CalendarServiceApiAxiosParamCreator(e).updateCalendar(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},CalendarServiceApiFactory=function(e,t,i){return{createCalendar:(r,a)=>CalendarServiceApiFp(e).createCalendar(r,a).then(e=>e(i,t)),deleteCalendar:(r,a,n)=>CalendarServiceApiFp(e).deleteCalendar(r,a,n).then(e=>e(i,t)),readCalendar:(r,a,n)=>CalendarServiceApiFp(e).readCalendar(r,a,n).then(e=>e(i,t)),searchCalendar:(r,a,n,s,o,u,c)=>CalendarServiceApiFp(e).searchCalendar(r,a,n,s,o,u,c).then(e=>e(i,t)),searchTimezones:(r,a,n,s)=>CalendarServiceApiFp(e).searchTimezones(r,a,n,s).then(e=>e(i,t)),updateCalendar:(r,a,n)=>CalendarServiceApiFp(e).updateCalendar(r,a,n).then(e=>e(i,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,i){return CalendarServiceApiFp(this.configuration).deleteCalendar(e,t,i).then(e=>e(this.axios,this.basePath))}readCalendar(e,t,i){return CalendarServiceApiFp(this.configuration).readCalendar(e,t,i).then(e=>e(this.axios,this.basePath))}searchCalendar(e,t,i,r,a,n,s){return CalendarServiceApiFp(this.configuration).searchCalendar(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}searchTimezones(e,t,i,r){return CalendarServiceApiFp(this.configuration).searchTimezones(e,t,i,r).then(e=>e(this.axios,this.basePath))}updateCalendar(e,t,i){return CalendarServiceApiFp(this.configuration).updateCalendar(e,t,i).then(e=>e(this.axios,this.basePath))}}const CallServiceApiAxiosParamCreator=function(e){return{aggregateHistoryCall:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling aggregateHistoryCall.");const r=parse("/calls/history/aggregate",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},blindTransferCall:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling blindTransferCall.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},confirmPush:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling confirmPush.");const r="/calls/active/{id}/confirm_push".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"PATCH",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},createCall:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCall.");const r=parse("/calls",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},createCallAnnotation:async(t,i,r={})=>{if(null==t)throw new RequiredError("callId","Required parameter callId was null or undefined when calling createCallAnnotation.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteCallAnnotation:async(t,i,r={})=>{if(null==t)throw new RequiredError("callId","Required parameter callId was null or undefined when calling deleteCallAnnotation.");if(null==i)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(i))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...r.headers},{url:format(n),options:o}},dtmfCall:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling dtmfCall.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},eavesdropCall:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling eavesdropCall.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},hangupCall:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling hangupCall.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},holdCall:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling holdCall.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readCall:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchActiveCall:async(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K={})=>{const k=parse("/calls/active",!0);let x;e&&(x=e.baseOptions);const O={method:"GET",...x,...K},I={},F={};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&&(F.page=t),void 0!==i&&(F.size=i),void 0!==r&&(F.q=r),void 0!==a&&(F.sort=a),n&&(F.fields=n),void 0!==s&&(F["created_at.from"]=s),void 0!==o&&(F["created_at.to"]=o),u&&(F.user_id=u),c&&(F.agent_id=c),l&&(F.queue_id=l),d&&(F.team_id=d),p&&(F.member_id=p),h&&(F.gateway_id=h),void 0!==y&&(F["duration.from"]=y),void 0!==A&&(F["duration.to"]=A),void 0!==g&&(F.skip_parent=g),void 0!==m&&(F.parent_id=m),f&&(F.cause=f),void 0!==b&&(F.exists_file=b),void 0!==S&&(F.domain_id=S),void 0!==w&&(F.number=w),v&&(F.direction=v),void 0!==q&&(F["answered_at.from"]=q),void 0!==C&&(F["answered_at.to"]=C),void 0!==R&&(F.missed=R),void 0!==P&&(F["stored_at.from"]=P),void 0!==_&&(F["stored_at.to"]=_),T&&(F.supervisor_id=T),E&&(F.state=E),k.query={...k.query,...F,...K.query},delete k.search;let B=x&&x.headers?x.headers:{};return O.headers={...I,...B,...K.headers},{url:format(k),options:O}},searchHistoryCall:async(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K,k,x,O,I,F,B={})=>{const W=parse("/calls/history",!0);let H;e&&(H=e.baseOptions);const X={method:"GET",...H,...B},Q={},U={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;Q["X-Webitel-Access"]=t}void 0!==t&&(U.page=t),void 0!==i&&(U.size=i),void 0!==r&&(U.q=r),void 0!==a&&(U.sort=a),n&&(U.fields=n),void 0!==s&&(U["created_at.from"]=s),void 0!==o&&(U["created_at.to"]=o),u&&(U.user_id=u),c&&(U.agent_id=c),l&&(U.queue_id=l),d&&(U.team_id=d),p&&(U.member_id=p),h&&(U.gateway_id=h),void 0!==y&&(U["duration.from"]=y),void 0!==A&&(U["duration.to"]=A),void 0!==g&&(U.skip_parent=g),void 0!==m&&(U.parent_id=m),f&&(U.cause=f),void 0!==b&&(U.has_file=b),void 0!==S&&(U.domain_id=S),void 0!==w&&(U.number=w),void 0!==v&&(U.direction=v),void 0!==q&&(U["answered_at.from"]=q),void 0!==C&&(U["answered_at.to"]=C),void 0!==R&&(U.missed=R),void 0!==P&&(U["stored_at.from"]=P),void 0!==_&&(U["stored_at.to"]=_),T&&(U.id=T),E&&(U.transfer_from=E),K&&(U.transfer_to=K),k&&(U.dependency_id=k),x&&(U.tags=x),O&&(U.amd_result=O),void 0!==I&&(U.fts=I),F&&(U.directions=F),W.query={...W.query,...U,...B.query},delete W.search;let G=H&&H.headers?H.headers:{};return X.headers={...Q,...G,...B.headers},{url:format(W),options:X}},unHoldCall:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling unHoldCall.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},updateCallAnnotation:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("callId","Required parameter callId was null or undefined when calling updateCallAnnotation.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCallAnnotation.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},CallServiceApiFp=function(e){return{async aggregateHistoryCall(t,i){const r=await CallServiceApiAxiosParamCreator(e).aggregateHistoryCall(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async blindTransferCall(t,i,r){const a=await CallServiceApiAxiosParamCreator(e).blindTransferCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async confirmPush(t,i){const r=await CallServiceApiAxiosParamCreator(e).confirmPush(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async createCall(t,i){const r=await CallServiceApiAxiosParamCreator(e).createCall(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async createCallAnnotation(t,i,r){const a=await CallServiceApiAxiosParamCreator(e).createCallAnnotation(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteCallAnnotation(t,i,r){const a=await CallServiceApiAxiosParamCreator(e).deleteCallAnnotation(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async dtmfCall(t,i,r){const a=await CallServiceApiAxiosParamCreator(e).dtmfCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async eavesdropCall(t,i,r){const a=await CallServiceApiAxiosParamCreator(e).eavesdropCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async hangupCall(t,i,r){const a=await CallServiceApiAxiosParamCreator(e).hangupCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async holdCall(t,i,r){const a=await CallServiceApiAxiosParamCreator(e).holdCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readCall(t,i,r){const a=await CallServiceApiAxiosParamCreator(e).readCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchActiveCall(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K){const k=await CallServiceApiAxiosParamCreator(e).searchActiveCall(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K);return(e=globalAxios,t=BASE_PATH)=>{const i={...k.options,url:t+k.url};return e.request(i)}},async searchHistoryCall(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K,k,x,O,I,F,B){const W=await CallServiceApiAxiosParamCreator(e).searchHistoryCall(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K,k,x,O,I,F,B);return(e=globalAxios,t=BASE_PATH)=>{const i={...W.options,url:t+W.url};return e.request(i)}},async unHoldCall(t,i,r){const a=await CallServiceApiAxiosParamCreator(e).unHoldCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async updateCallAnnotation(t,i,r,a){const n=await CallServiceApiAxiosParamCreator(e).updateCallAnnotation(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},CallServiceApiFactory=function(e,t,i){return{aggregateHistoryCall:(r,a)=>CallServiceApiFp(e).aggregateHistoryCall(r,a).then(e=>e(i,t)),blindTransferCall:(r,a,n)=>CallServiceApiFp(e).blindTransferCall(r,a,n).then(e=>e(i,t)),confirmPush:(r,a)=>CallServiceApiFp(e).confirmPush(r,a).then(e=>e(i,t)),createCall:(r,a)=>CallServiceApiFp(e).createCall(r,a).then(e=>e(i,t)),createCallAnnotation:(r,a,n)=>CallServiceApiFp(e).createCallAnnotation(r,a,n).then(e=>e(i,t)),deleteCallAnnotation:(r,a,n)=>CallServiceApiFp(e).deleteCallAnnotation(r,a,n).then(e=>e(i,t)),dtmfCall:(r,a,n)=>CallServiceApiFp(e).dtmfCall(r,a,n).then(e=>e(i,t)),eavesdropCall:(r,a,n)=>CallServiceApiFp(e).eavesdropCall(r,a,n).then(e=>e(i,t)),hangupCall:(r,a,n)=>CallServiceApiFp(e).hangupCall(r,a,n).then(e=>e(i,t)),holdCall:(r,a,n)=>CallServiceApiFp(e).holdCall(r,a,n).then(e=>e(i,t)),readCall:(r,a,n)=>CallServiceApiFp(e).readCall(r,a,n).then(e=>e(i,t)),searchActiveCall:(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K,k,x)=>CallServiceApiFp(e).searchActiveCall(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K,k,x).then(e=>e(i,t)),searchHistoryCall:(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K,k,x,O,I,F,B,W,H)=>CallServiceApiFp(e).searchHistoryCall(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K,k,x,O,I,F,B,W,H).then(e=>e(i,t)),unHoldCall:(r,a,n)=>CallServiceApiFp(e).unHoldCall(r,a,n).then(e=>e(i,t)),updateCallAnnotation:(r,a,n,s)=>CallServiceApiFp(e).updateCallAnnotation(r,a,n,s).then(e=>e(i,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,i){return CallServiceApiFp(this.configuration).blindTransferCall(e,t,i).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,i){return CallServiceApiFp(this.configuration).createCallAnnotation(e,t,i).then(e=>e(this.axios,this.basePath))}deleteCallAnnotation(e,t,i){return CallServiceApiFp(this.configuration).deleteCallAnnotation(e,t,i).then(e=>e(this.axios,this.basePath))}dtmfCall(e,t,i){return CallServiceApiFp(this.configuration).dtmfCall(e,t,i).then(e=>e(this.axios,this.basePath))}eavesdropCall(e,t,i){return CallServiceApiFp(this.configuration).eavesdropCall(e,t,i).then(e=>e(this.axios,this.basePath))}hangupCall(e,t,i){return CallServiceApiFp(this.configuration).hangupCall(e,t,i).then(e=>e(this.axios,this.basePath))}holdCall(e,t,i){return CallServiceApiFp(this.configuration).holdCall(e,t,i).then(e=>e(this.axios,this.basePath))}readCall(e,t,i){return CallServiceApiFp(this.configuration).readCall(e,t,i).then(e=>e(this.axios,this.basePath))}searchActiveCall(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E){return CallServiceApiFp(this.configuration).searchActiveCall(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E).then(e=>e(this.axios,this.basePath))}searchHistoryCall(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K,k,x,O,I,F){return CallServiceApiFp(this.configuration).searchHistoryCall(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K,k,x,O,I,F).then(e=>e(this.axios,this.basePath))}unHoldCall(e,t,i){return CallServiceApiFp(this.configuration).unHoldCall(e,t,i).then(e=>e(this.axios,this.basePath))}updateCallAnnotation(e,t,i,r){return CallServiceApiFp(this.configuration).updateCallAnnotation(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const CognitiveProfileServiceApiAxiosParamCreator=function(e){return{createCognitiveProfile:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCognitiveProfile.");const r=parse("/storage/cognitive_profiles",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteCognitiveProfile:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteCognitiveProfile.");const r="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},patchCognitiveProfile:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchCognitiveProfile.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readCognitiveProfile:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readCognitiveProfile.");const r="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},searchCognitiveProfile:async(t,i,r,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!==i&&(y.size=i),void 0!==r&&(y.q=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...c.headers},{url:format(l),options:p}},updateCognitiveProfile:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCognitiveProfile.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},CognitiveProfileServiceApiFp=function(e){return{async createCognitiveProfile(t,i){const r=await CognitiveProfileServiceApiAxiosParamCreator(e).createCognitiveProfile(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteCognitiveProfile(t,i){const r=await CognitiveProfileServiceApiAxiosParamCreator(e).deleteCognitiveProfile(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async patchCognitiveProfile(t,i,r){const a=await CognitiveProfileServiceApiAxiosParamCreator(e).patchCognitiveProfile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readCognitiveProfile(t,i){const r=await CognitiveProfileServiceApiAxiosParamCreator(e).readCognitiveProfile(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async searchCognitiveProfile(t,i,r,a,n,s,o,u,c){const l=await CognitiveProfileServiceApiAxiosParamCreator(e).searchCognitiveProfile(t,i,r,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const i={...l.options,url:t+l.url};return e.request(i)}},async updateCognitiveProfile(t,i,r){const a=await CognitiveProfileServiceApiAxiosParamCreator(e).updateCognitiveProfile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},CognitiveProfileServiceApiFactory=function(e,t,i){return{createCognitiveProfile:(r,a)=>CognitiveProfileServiceApiFp(e).createCognitiveProfile(r,a).then(e=>e(i,t)),deleteCognitiveProfile:(r,a)=>CognitiveProfileServiceApiFp(e).deleteCognitiveProfile(r,a).then(e=>e(i,t)),patchCognitiveProfile:(r,a,n)=>CognitiveProfileServiceApiFp(e).patchCognitiveProfile(r,a,n).then(e=>e(i,t)),readCognitiveProfile:(r,a)=>CognitiveProfileServiceApiFp(e).readCognitiveProfile(r,a).then(e=>e(i,t)),searchCognitiveProfile:(r,a,n,s,o,u,c,l,d)=>CognitiveProfileServiceApiFp(e).searchCognitiveProfile(r,a,n,s,o,u,c,l,d).then(e=>e(i,t)),updateCognitiveProfile:(r,a,n)=>CognitiveProfileServiceApiFp(e).updateCognitiveProfile(r,a,n).then(e=>e(i,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,i){return CognitiveProfileServiceApiFp(this.configuration).patchCognitiveProfile(e,t,i).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,i,r,a,n,s,o,u){return CognitiveProfileServiceApiFp(this.configuration).searchCognitiveProfile(e,t,i,r,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateCognitiveProfile(e,t,i){return CognitiveProfileServiceApiFp(this.configuration).updateCognitiveProfile(e,t,i).then(e=>e(this.axios,this.basePath))}}const CommunicationTypeServiceApiAxiosParamCreator=function(e){return{createCommunicationType:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCommunicationType.");const r=parse("/call_center/communication_type",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteCommunicationType:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readCommunicationType:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchCommunicationType:async(t,i,r,a,n,s,o={})=>{const u=parse("/call_center/communication_type",!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!==i&&(p.size=i),void 0!==r&&(p.q=r),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}},updateCommunicationType:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCommunicationType.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},CommunicationTypeServiceApiFp=function(e){return{async createCommunicationType(t,i){const r=await CommunicationTypeServiceApiAxiosParamCreator(e).createCommunicationType(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteCommunicationType(t,i,r){const a=await CommunicationTypeServiceApiAxiosParamCreator(e).deleteCommunicationType(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readCommunicationType(t,i,r){const a=await CommunicationTypeServiceApiAxiosParamCreator(e).readCommunicationType(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchCommunicationType(t,i,r,a,n,s,o){const u=await CommunicationTypeServiceApiAxiosParamCreator(e).searchCommunicationType(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async updateCommunicationType(t,i,r){const a=await CommunicationTypeServiceApiAxiosParamCreator(e).updateCommunicationType(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},CommunicationTypeServiceApiFactory=function(e,t,i){return{createCommunicationType:(r,a)=>CommunicationTypeServiceApiFp(e).createCommunicationType(r,a).then(e=>e(i,t)),deleteCommunicationType:(r,a,n)=>CommunicationTypeServiceApiFp(e).deleteCommunicationType(r,a,n).then(e=>e(i,t)),readCommunicationType:(r,a,n)=>CommunicationTypeServiceApiFp(e).readCommunicationType(r,a,n).then(e=>e(i,t)),searchCommunicationType:(r,a,n,s,o,u,c)=>CommunicationTypeServiceApiFp(e).searchCommunicationType(r,a,n,s,o,u,c).then(e=>e(i,t)),updateCommunicationType:(r,a,n)=>CommunicationTypeServiceApiFp(e).updateCommunicationType(r,a,n).then(e=>e(i,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,i){return CommunicationTypeServiceApiFp(this.configuration).deleteCommunicationType(e,t,i).then(e=>e(this.axios,this.basePath))}readCommunicationType(e,t,i){return CommunicationTypeServiceApiFp(this.configuration).readCommunicationType(e,t,i).then(e=>e(this.axios,this.basePath))}searchCommunicationType(e,t,i,r,a,n,s){return CommunicationTypeServiceApiFp(this.configuration).searchCommunicationType(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}updateCommunicationType(e,t,i){return CommunicationTypeServiceApiFp(this.configuration).updateCommunicationType(e,t,i).then(e=>e(this.axios,this.basePath))}}const EmailProfileServiceApiAxiosParamCreator=function(e){return{createEmailProfile:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createEmailProfile.");const r=parse("/email/profile",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteEmailProfile:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteEmailProfile.");const a="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readEmailProfile:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readEmailProfile.");const a="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchEmailProfile:async(t,i,r,a,n,s,o={})=>{const u=parse("/email/profile",!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!==i&&(p.size=i),void 0!==r&&(p.q=r),void 0!==a&&(p.sort=a),n&&(p.fields=n),void 0!==s&&(p.domain_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}},updateEmailProfile:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateEmailProfile.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},EmailProfileServiceApiFp=function(e){return{async createEmailProfile(t,i){const r=await EmailProfileServiceApiAxiosParamCreator(e).createEmailProfile(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteEmailProfile(t,i,r){const a=await EmailProfileServiceApiAxiosParamCreator(e).deleteEmailProfile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readEmailProfile(t,i,r){const a=await EmailProfileServiceApiAxiosParamCreator(e).readEmailProfile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchEmailProfile(t,i,r,a,n,s,o){const u=await EmailProfileServiceApiAxiosParamCreator(e).searchEmailProfile(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async updateEmailProfile(t,i,r){const a=await EmailProfileServiceApiAxiosParamCreator(e).updateEmailProfile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},EmailProfileServiceApiFactory=function(e,t,i){return{createEmailProfile:(r,a)=>EmailProfileServiceApiFp(e).createEmailProfile(r,a).then(e=>e(i,t)),deleteEmailProfile:(r,a,n)=>EmailProfileServiceApiFp(e).deleteEmailProfile(r,a,n).then(e=>e(i,t)),readEmailProfile:(r,a,n)=>EmailProfileServiceApiFp(e).readEmailProfile(r,a,n).then(e=>e(i,t)),searchEmailProfile:(r,a,n,s,o,u,c)=>EmailProfileServiceApiFp(e).searchEmailProfile(r,a,n,s,o,u,c).then(e=>e(i,t)),updateEmailProfile:(r,a,n)=>EmailProfileServiceApiFp(e).updateEmailProfile(r,a,n).then(e=>e(i,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,i){return EmailProfileServiceApiFp(this.configuration).deleteEmailProfile(e,t,i).then(e=>e(this.axios,this.basePath))}readEmailProfile(e,t,i){return EmailProfileServiceApiFp(this.configuration).readEmailProfile(e,t,i).then(e=>e(this.axios,this.basePath))}searchEmailProfile(e,t,i,r,a,n,s){return EmailProfileServiceApiFp(this.configuration).searchEmailProfile(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}updateEmailProfile(e,t,i){return EmailProfileServiceApiFp(this.configuration).updateEmailProfile(e,t,i).then(e=>e(this.axios,this.basePath))}}const FileServiceApiAxiosParamCreator=function(e){return{deleteFiles:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling deleteFiles.");const r=parse("/storage/file",!0);let a;e&&(a=e.baseOptions);const n={method:"DELETE",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}}}},FileServiceApiFp=function(e){return{async deleteFiles(t,i){const r=await FileServiceApiAxiosParamCreator(e).deleteFiles(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}}}},FileServiceApiFactory=function(e,t,i){return{deleteFiles:(r,a)=>FileServiceApiFp(e).deleteFiles(r,a).then(e=>e(i,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,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createFileTranscript.");const r=parse("/storage/transcript_file",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},getFileTranscriptPhrases:async(t,i,r,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!==i&&(l.page=i),void 0!==r&&(l.size=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}}}},FileTranscriptServiceApiFp=function(e){return{async createFileTranscript(t,i){const r=await FileTranscriptServiceApiAxiosParamCreator(e).createFileTranscript(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async getFileTranscriptPhrases(t,i,r,a){const n=await FileTranscriptServiceApiAxiosParamCreator(e).getFileTranscriptPhrases(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},FileTranscriptServiceApiFactory=function(e,t,i){return{createFileTranscript:(r,a)=>FileTranscriptServiceApiFp(e).createFileTranscript(r,a).then(e=>e(i,t)),getFileTranscriptPhrases:(r,a,n,s)=>FileTranscriptServiceApiFp(e).getFileTranscriptPhrases(r,a,n,s).then(e=>e(i,t))}};class FileTranscriptServiceApi extends BaseAPI{createFileTranscript(e,t){return FileTranscriptServiceApiFp(this.configuration).createFileTranscript(e,t).then(e=>e(this.axios,this.basePath))}getFileTranscriptPhrases(e,t,i,r){return FileTranscriptServiceApiFp(this.configuration).getFileTranscriptPhrases(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const ImportTemplateServiceApiAxiosParamCreator=function(e){return{createImportTemplate:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createImportTemplate.");const r=parse("/storage/import_templates",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteImportTemplate:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteImportTemplate.");const r="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},patchImportTemplate:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchImportTemplate.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readImportTemplate:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readImportTemplate.");const r="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},searchImportTemplate:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateImportTemplate.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},ImportTemplateServiceApiFp=function(e){return{async createImportTemplate(t,i){const r=await ImportTemplateServiceApiAxiosParamCreator(e).createImportTemplate(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteImportTemplate(t,i){const r=await ImportTemplateServiceApiAxiosParamCreator(e).deleteImportTemplate(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async patchImportTemplate(t,i,r){const a=await ImportTemplateServiceApiAxiosParamCreator(e).patchImportTemplate(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readImportTemplate(t,i){const r=await ImportTemplateServiceApiAxiosParamCreator(e).readImportTemplate(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async searchImportTemplate(t,i,r,a,n,s,o){const u=await ImportTemplateServiceApiAxiosParamCreator(e).searchImportTemplate(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async updateImportTemplate(t,i,r){const a=await ImportTemplateServiceApiAxiosParamCreator(e).updateImportTemplate(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},ImportTemplateServiceApiFactory=function(e,t,i){return{createImportTemplate:(r,a)=>ImportTemplateServiceApiFp(e).createImportTemplate(r,a).then(e=>e(i,t)),deleteImportTemplate:(r,a)=>ImportTemplateServiceApiFp(e).deleteImportTemplate(r,a).then(e=>e(i,t)),patchImportTemplate:(r,a,n)=>ImportTemplateServiceApiFp(e).patchImportTemplate(r,a,n).then(e=>e(i,t)),readImportTemplate:(r,a)=>ImportTemplateServiceApiFp(e).readImportTemplate(r,a).then(e=>e(i,t)),searchImportTemplate:(r,a,n,s,o,u,c)=>ImportTemplateServiceApiFp(e).searchImportTemplate(r,a,n,s,o,u,c).then(e=>e(i,t)),updateImportTemplate:(r,a,n)=>ImportTemplateServiceApiFp(e).updateImportTemplate(r,a,n).then(e=>e(i,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,i){return ImportTemplateServiceApiFp(this.configuration).patchImportTemplate(e,t,i).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,i,r,a,n,s){return ImportTemplateServiceApiFp(this.configuration).searchImportTemplate(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}updateImportTemplate(e,t,i){return ImportTemplateServiceApiFp(this.configuration).updateImportTemplate(e,t,i).then(e=>e(this.axios,this.basePath))}}const ListServiceApiAxiosParamCreator=function(e){return{createList:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createList.");const r=parse("/call_center/list",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},createListCommunication:async(t,i,r={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling createListCommunication.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteList:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},deleteListCommunication:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling deleteListCommunication.");if(null==i)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(i))),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!==r&&(l.domain_id=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}},readList:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readListCommunication:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling readListCommunication.");if(null==i)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(i))),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.domain_id=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}},searchList:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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,i,r,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling searchListCommunication.");const c="/call_center/list/{list_id}/communication".replace("{list_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!==i&&(y.page=i),void 0!==r&&(y.size=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...u.headers},{url:format(l),options:p}},updateList:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateList.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},updateListCommunication:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling updateListCommunication.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateListCommunication.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},ListServiceApiFp=function(e){return{async createList(t,i){const r=await ListServiceApiAxiosParamCreator(e).createList(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async createListCommunication(t,i,r){const a=await ListServiceApiAxiosParamCreator(e).createListCommunication(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteList(t,i,r){const a=await ListServiceApiAxiosParamCreator(e).deleteList(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteListCommunication(t,i,r,a){const n=await ListServiceApiAxiosParamCreator(e).deleteListCommunication(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async readList(t,i,r){const a=await ListServiceApiAxiosParamCreator(e).readList(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readListCommunication(t,i,r,a){const n=await ListServiceApiAxiosParamCreator(e).readListCommunication(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async searchList(t,i,r,a,n,s,o){const u=await ListServiceApiAxiosParamCreator(e).searchList(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async searchListCommunication(t,i,r,a,n,s,o,u){const c=await ListServiceApiAxiosParamCreator(e).searchListCommunication(t,i,r,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const i={...c.options,url:t+c.url};return e.request(i)}},async updateList(t,i,r){const a=await ListServiceApiAxiosParamCreator(e).updateList(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async updateListCommunication(t,i,r,a){const n=await ListServiceApiAxiosParamCreator(e).updateListCommunication(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},ListServiceApiFactory=function(e,t,i){return{createList:(r,a)=>ListServiceApiFp(e).createList(r,a).then(e=>e(i,t)),createListCommunication:(r,a,n)=>ListServiceApiFp(e).createListCommunication(r,a,n).then(e=>e(i,t)),deleteList:(r,a,n)=>ListServiceApiFp(e).deleteList(r,a,n).then(e=>e(i,t)),deleteListCommunication:(r,a,n,s)=>ListServiceApiFp(e).deleteListCommunication(r,a,n,s).then(e=>e(i,t)),readList:(r,a,n)=>ListServiceApiFp(e).readList(r,a,n).then(e=>e(i,t)),readListCommunication:(r,a,n,s)=>ListServiceApiFp(e).readListCommunication(r,a,n,s).then(e=>e(i,t)),searchList:(r,a,n,s,o,u,c)=>ListServiceApiFp(e).searchList(r,a,n,s,o,u,c).then(e=>e(i,t)),searchListCommunication:(r,a,n,s,o,u,c,l)=>ListServiceApiFp(e).searchListCommunication(r,a,n,s,o,u,c,l).then(e=>e(i,t)),updateList:(r,a,n)=>ListServiceApiFp(e).updateList(r,a,n).then(e=>e(i,t)),updateListCommunication:(r,a,n,s)=>ListServiceApiFp(e).updateListCommunication(r,a,n,s).then(e=>e(i,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,i){return ListServiceApiFp(this.configuration).createListCommunication(e,t,i).then(e=>e(this.axios,this.basePath))}deleteList(e,t,i){return ListServiceApiFp(this.configuration).deleteList(e,t,i).then(e=>e(this.axios,this.basePath))}deleteListCommunication(e,t,i,r){return ListServiceApiFp(this.configuration).deleteListCommunication(e,t,i,r).then(e=>e(this.axios,this.basePath))}readList(e,t,i){return ListServiceApiFp(this.configuration).readList(e,t,i).then(e=>e(this.axios,this.basePath))}readListCommunication(e,t,i,r){return ListServiceApiFp(this.configuration).readListCommunication(e,t,i,r).then(e=>e(this.axios,this.basePath))}searchList(e,t,i,r,a,n,s){return ListServiceApiFp(this.configuration).searchList(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}searchListCommunication(e,t,i,r,a,n,s,o){return ListServiceApiFp(this.configuration).searchListCommunication(e,t,i,r,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateList(e,t,i){return ListServiceApiFp(this.configuration).updateList(e,t,i).then(e=>e(this.axios,this.basePath))}updateListCommunication(e,t,i,r){return ListServiceApiFp(this.configuration).updateListCommunication(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const MediaFileServiceApiAxiosParamCreator=function(e){return{deleteMediaFile:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readMediaFile:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchMediaFile:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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,i,r){const a=await MediaFileServiceApiAxiosParamCreator(e).deleteMediaFile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readMediaFile(t,i,r){const a=await MediaFileServiceApiAxiosParamCreator(e).readMediaFile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchMediaFile(t,i,r,a,n,s,o){const u=await MediaFileServiceApiAxiosParamCreator(e).searchMediaFile(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}}}},MediaFileServiceApiFactory=function(e,t,i){return{deleteMediaFile:(r,a,n)=>MediaFileServiceApiFp(e).deleteMediaFile(r,a,n).then(e=>e(i,t)),readMediaFile:(r,a,n)=>MediaFileServiceApiFp(e).readMediaFile(r,a,n).then(e=>e(i,t)),searchMediaFile:(r,a,n,s,o,u,c)=>MediaFileServiceApiFp(e).searchMediaFile(r,a,n,s,o,u,c).then(e=>e(i,t))}};class MediaFileServiceApi extends BaseAPI{deleteMediaFile(e,t,i){return MediaFileServiceApiFp(this.configuration).deleteMediaFile(e,t,i).then(e=>e(this.axios,this.basePath))}readMediaFile(e,t,i){return MediaFileServiceApiFp(this.configuration).readMediaFile(e,t,i).then(e=>e(this.axios,this.basePath))}searchMediaFile(e,t,i,r,a,n,s){return MediaFileServiceApiFp(this.configuration).searchMediaFile(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}}const MemberServiceApiAxiosParamCreator=function(e){return{attemptCallback:async(t,i,r={})=>{if(null==t)throw new RequiredError("attemptId","Required parameter attemptId was null or undefined when calling attemptCallback.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},attemptResult:async(t,i,r,a,n={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling attemptResult.");if(null==i)throw new RequiredError("memberId","Required parameter memberId was null or undefined when calling attemptResult.");if(null==r)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(i))).replace("{attempt_id}",encodeURIComponent(String(r))),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,i,r={})=>{if(null==t)throw new RequiredError("attemptId","Required parameter attemptId was null or undefined when calling attemptsRenewalResult.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},createAttempt:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createAttempt.");if(null==i)throw new RequiredError("memberId","Required parameter memberId was null or undefined when calling createAttempt.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},createMember:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createMember.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},createMemberBulk:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createMemberBulk.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteMember:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteMember.");if(null==i)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(i))),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!==r&&(l.domain_id=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}},deleteMembers:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteMembers.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},patchMember:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchMember.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling patchMember.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},readMember:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readMember.");if(null==i)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(i))),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.domain_id=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}},resetMembers:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling resetMembers.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},searchAttempts:async(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S={})=>{const w=parse("/call_center/queues/attempts/active",!0);let v;e&&(v=e.baseOptions);const q={method:"GET",...v,...S},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!==i&&(R.size=i),void 0!==r&&(R.q=r),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!==A&&(R["leaving_at.to"]=A),void 0!==g&&(R["offering_at.from"]=g),void 0!==m&&(R["offering_at.to"]=m),void 0!==f&&(R["duration.from"]=f),void 0!==b&&(R["duration.to"]=b),w.query={...w.query,...R,...S.query},delete w.search;let P=v&&v.headers?v.headers:{};return q.headers={...C,...P,...S.headers},{url:format(w),options:q}},searchAttemptsHistory:async(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S={})=>{const w=parse("/call_center/queues/attempts/history",!0);let v;e&&(v=e.baseOptions);const q={method:"GET",...v,...S},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!==i&&(R.size=i),void 0!==r&&(R.q=r),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!==A&&(R["leaving_at.to"]=A),void 0!==g&&(R["offering_at.from"]=g),void 0!==m&&(R["offering_at.to"]=m),void 0!==f&&(R["duration.from"]=f),void 0!==b&&(R["duration.to"]=b),w.query={...w.query,...R,...S.query},delete w.search;let P=v&&v.headers?v.headers:{};return q.headers={...C,...P,...S.headers},{url:format(w),options:q}},searchMemberAttempts:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchMemberAttempts.");if(null==i)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(i))),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.domain_id=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}},searchMemberInQueue:async(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchMemberInQueue.");const v="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(t))),q=parse(v,!0);let C;e&&(C=e.baseOptions);const R={method:"GET",...C,...w},P={},_={};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!==i&&(_.page=i),void 0!==r&&(_.size=r),void 0!==a&&(_.q=a),void 0!==n&&(_.sort=n),s&&(_.fields=s),o&&(_.id=o),u&&(_.bucket_id=u),void 0!==c&&(_.destination=c),void 0!==l&&(_["created_at.from"]=l),void 0!==d&&(_["created_at.to"]=d),void 0!==p&&(_["offering_at.from"]=p),void 0!==h&&(_["offering_at.to"]=h),y&&(_.stop_cause=y),void 0!==A&&(_["priority.from"]=A),void 0!==g&&(_["priority.to"]=g),void 0!==m&&(_.name=m),void 0!==f&&(_["attempts.from"]=f),void 0!==b&&(_["attempts.to"]=b),S&&(_.agent_id=S),q.query={...q.query,..._,...w.query},delete q.search;let T=C&&C.headers?C.headers:{};return R.headers={...P,...T,...w.headers},{url:format(q),options:R}},searchMembers:async(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w={})=>{const v=parse("/call_center/members",!0);let q;e&&(q=e.baseOptions);const C={method:"GET",...q,...w},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!==i&&(P.size=i),void 0!==r&&(P.q=r),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!==A&&(P["priority.from"]=A),void 0!==g&&(P["priority.to"]=g),void 0!==m&&(P.name=m),void 0!==f&&(P["attempts.from"]=f),void 0!==b&&(P["attempts.to"]=b),S&&(P.agent_id=S),v.query={...v.query,...P,...w.query},delete v.search;let _=q&&q.headers?q.headers:{};return C.headers={...R,..._,...w.headers},{url:format(v),options:C}},updateMember:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateMember.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateMember.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},MemberServiceApiFp=function(e){return{async attemptCallback(t,i,r){const a=await MemberServiceApiAxiosParamCreator(e).attemptCallback(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async attemptResult(t,i,r,a,n){const s=await MemberServiceApiAxiosParamCreator(e).attemptResult(t,i,r,a,n);return(e=globalAxios,t=BASE_PATH)=>{const i={...s.options,url:t+s.url};return e.request(i)}},async attemptsRenewalResult(t,i,r){const a=await MemberServiceApiAxiosParamCreator(e).attemptsRenewalResult(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async createAttempt(t,i,r,a){const n=await MemberServiceApiAxiosParamCreator(e).createAttempt(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async createMember(t,i,r){const a=await MemberServiceApiAxiosParamCreator(e).createMember(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async createMemberBulk(t,i,r){const a=await MemberServiceApiAxiosParamCreator(e).createMemberBulk(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteMember(t,i,r,a){const n=await MemberServiceApiAxiosParamCreator(e).deleteMember(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async deleteMembers(t,i,r){const a=await MemberServiceApiAxiosParamCreator(e).deleteMembers(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async patchMember(t,i,r,a){const n=await MemberServiceApiAxiosParamCreator(e).patchMember(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async readMember(t,i,r,a){const n=await MemberServiceApiAxiosParamCreator(e).readMember(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async resetMembers(t,i,r){const a=await MemberServiceApiAxiosParamCreator(e).resetMembers(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchAttempts(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S){const w=await MemberServiceApiAxiosParamCreator(e).searchAttempts(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S);return(e=globalAxios,t=BASE_PATH)=>{const i={...w.options,url:t+w.url};return e.request(i)}},async searchAttemptsHistory(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S){const w=await MemberServiceApiAxiosParamCreator(e).searchAttemptsHistory(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S);return(e=globalAxios,t=BASE_PATH)=>{const i={...w.options,url:t+w.url};return e.request(i)}},async searchMemberAttempts(t,i,r,a){const n=await MemberServiceApiAxiosParamCreator(e).searchMemberAttempts(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async searchMemberInQueue(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w){const v=await MemberServiceApiAxiosParamCreator(e).searchMemberInQueue(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w);return(e=globalAxios,t=BASE_PATH)=>{const i={...v.options,url:t+v.url};return e.request(i)}},async searchMembers(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w){const v=await MemberServiceApiAxiosParamCreator(e).searchMembers(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w);return(e=globalAxios,t=BASE_PATH)=>{const i={...v.options,url:t+v.url};return e.request(i)}},async updateMember(t,i,r,a){const n=await MemberServiceApiAxiosParamCreator(e).updateMember(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},MemberServiceApiFactory=function(e,t,i){return{attemptCallback:(r,a,n)=>MemberServiceApiFp(e).attemptCallback(r,a,n).then(e=>e(i,t)),attemptResult:(r,a,n,s,o)=>MemberServiceApiFp(e).attemptResult(r,a,n,s,o).then(e=>e(i,t)),attemptsRenewalResult:(r,a,n)=>MemberServiceApiFp(e).attemptsRenewalResult(r,a,n).then(e=>e(i,t)),createAttempt:(r,a,n,s)=>MemberServiceApiFp(e).createAttempt(r,a,n,s).then(e=>e(i,t)),createMember:(r,a,n)=>MemberServiceApiFp(e).createMember(r,a,n).then(e=>e(i,t)),createMemberBulk:(r,a,n)=>MemberServiceApiFp(e).createMemberBulk(r,a,n).then(e=>e(i,t)),deleteMember:(r,a,n,s)=>MemberServiceApiFp(e).deleteMember(r,a,n,s).then(e=>e(i,t)),deleteMembers:(r,a,n)=>MemberServiceApiFp(e).deleteMembers(r,a,n).then(e=>e(i,t)),patchMember:(r,a,n,s)=>MemberServiceApiFp(e).patchMember(r,a,n,s).then(e=>e(i,t)),readMember:(r,a,n,s)=>MemberServiceApiFp(e).readMember(r,a,n,s).then(e=>e(i,t)),resetMembers:(r,a,n)=>MemberServiceApiFp(e).resetMembers(r,a,n).then(e=>e(i,t)),searchAttempts:(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v)=>MemberServiceApiFp(e).searchAttempts(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v).then(e=>e(i,t)),searchAttemptsHistory:(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v)=>MemberServiceApiFp(e).searchAttemptsHistory(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v).then(e=>e(i,t)),searchMemberAttempts:(r,a,n,s)=>MemberServiceApiFp(e).searchMemberAttempts(r,a,n,s).then(e=>e(i,t)),searchMemberInQueue:(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q)=>MemberServiceApiFp(e).searchMemberInQueue(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q).then(e=>e(i,t)),searchMembers:(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q)=>MemberServiceApiFp(e).searchMembers(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q).then(e=>e(i,t)),updateMember:(r,a,n,s)=>MemberServiceApiFp(e).updateMember(r,a,n,s).then(e=>e(i,t))}};class MemberServiceApi extends BaseAPI{attemptCallback(e,t,i){return MemberServiceApiFp(this.configuration).attemptCallback(e,t,i).then(e=>e(this.axios,this.basePath))}attemptResult(e,t,i,r,a){return MemberServiceApiFp(this.configuration).attemptResult(e,t,i,r,a).then(e=>e(this.axios,this.basePath))}attemptsRenewalResult(e,t,i){return MemberServiceApiFp(this.configuration).attemptsRenewalResult(e,t,i).then(e=>e(this.axios,this.basePath))}createAttempt(e,t,i,r){return MemberServiceApiFp(this.configuration).createAttempt(e,t,i,r).then(e=>e(this.axios,this.basePath))}createMember(e,t,i){return MemberServiceApiFp(this.configuration).createMember(e,t,i).then(e=>e(this.axios,this.basePath))}createMemberBulk(e,t,i){return MemberServiceApiFp(this.configuration).createMemberBulk(e,t,i).then(e=>e(this.axios,this.basePath))}deleteMember(e,t,i,r){return MemberServiceApiFp(this.configuration).deleteMember(e,t,i,r).then(e=>e(this.axios,this.basePath))}deleteMembers(e,t,i){return MemberServiceApiFp(this.configuration).deleteMembers(e,t,i).then(e=>e(this.axios,this.basePath))}patchMember(e,t,i,r){return MemberServiceApiFp(this.configuration).patchMember(e,t,i,r).then(e=>e(this.axios,this.basePath))}readMember(e,t,i,r){return MemberServiceApiFp(this.configuration).readMember(e,t,i,r).then(e=>e(this.axios,this.basePath))}resetMembers(e,t,i){return MemberServiceApiFp(this.configuration).resetMembers(e,t,i).then(e=>e(this.axios,this.basePath))}searchAttempts(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b){return MemberServiceApiFp(this.configuration).searchAttempts(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b).then(e=>e(this.axios,this.basePath))}searchAttemptsHistory(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b){return MemberServiceApiFp(this.configuration).searchAttemptsHistory(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b).then(e=>e(this.axios,this.basePath))}searchMemberAttempts(e,t,i,r){return MemberServiceApiFp(this.configuration).searchMemberAttempts(e,t,i,r).then(e=>e(this.axios,this.basePath))}searchMemberInQueue(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S){return MemberServiceApiFp(this.configuration).searchMemberInQueue(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S).then(e=>e(this.axios,this.basePath))}searchMembers(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S){return MemberServiceApiFp(this.configuration).searchMembers(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S).then(e=>e(this.axios,this.basePath))}updateMember(e,t,i,r){return MemberServiceApiFp(this.configuration).updateMember(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const OutboundResourceGroupServiceApiAxiosParamCreator=function(e){return{createOutboundResourceGroup:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createOutboundResourceGroup.");const r=parse("/call_center/resource_group",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},createOutboundResourceInGroup:async(t,i,r={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling createOutboundResourceInGroup.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteOutboundResourceGroup:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},deleteOutboundResourceInGroup:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling deleteOutboundResourceInGroup.");if(null==i)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(i))),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!==r&&(l.domain_id=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}},readOutboundResourceGroup:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readOutboundResourceInGroup:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling readOutboundResourceInGroup.");if(null==i)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(i))),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.domain_id=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}},searchOutboundResourceGroup:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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,i,r,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!==i&&(y.page=i),void 0!==r&&(y.size=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...u.headers},{url:format(l),options:p}},updateOutboundResourceGroup:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResourceGroup.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},updateOutboundResourceInGroup:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling updateOutboundResourceInGroup.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResourceInGroup.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},OutboundResourceGroupServiceApiFp=function(e){return{async createOutboundResourceGroup(t,i){const r=await OutboundResourceGroupServiceApiAxiosParamCreator(e).createOutboundResourceGroup(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async createOutboundResourceInGroup(t,i,r){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).createOutboundResourceInGroup(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteOutboundResourceGroup(t,i,r){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).deleteOutboundResourceGroup(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteOutboundResourceInGroup(t,i,r,a){const n=await OutboundResourceGroupServiceApiAxiosParamCreator(e).deleteOutboundResourceInGroup(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async readOutboundResourceGroup(t,i,r){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).readOutboundResourceGroup(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readOutboundResourceInGroup(t,i,r,a){const n=await OutboundResourceGroupServiceApiAxiosParamCreator(e).readOutboundResourceInGroup(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async searchOutboundResourceGroup(t,i,r,a,n,s,o){const u=await OutboundResourceGroupServiceApiAxiosParamCreator(e).searchOutboundResourceGroup(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async searchOutboundResourceInGroup(t,i,r,a,n,s,o,u){const c=await OutboundResourceGroupServiceApiAxiosParamCreator(e).searchOutboundResourceInGroup(t,i,r,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const i={...c.options,url:t+c.url};return e.request(i)}},async updateOutboundResourceGroup(t,i,r){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).updateOutboundResourceGroup(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async updateOutboundResourceInGroup(t,i,r,a){const n=await OutboundResourceGroupServiceApiAxiosParamCreator(e).updateOutboundResourceInGroup(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},OutboundResourceGroupServiceApiFactory=function(e,t,i){return{createOutboundResourceGroup:(r,a)=>OutboundResourceGroupServiceApiFp(e).createOutboundResourceGroup(r,a).then(e=>e(i,t)),createOutboundResourceInGroup:(r,a,n)=>OutboundResourceGroupServiceApiFp(e).createOutboundResourceInGroup(r,a,n).then(e=>e(i,t)),deleteOutboundResourceGroup:(r,a,n)=>OutboundResourceGroupServiceApiFp(e).deleteOutboundResourceGroup(r,a,n).then(e=>e(i,t)),deleteOutboundResourceInGroup:(r,a,n,s)=>OutboundResourceGroupServiceApiFp(e).deleteOutboundResourceInGroup(r,a,n,s).then(e=>e(i,t)),readOutboundResourceGroup:(r,a,n)=>OutboundResourceGroupServiceApiFp(e).readOutboundResourceGroup(r,a,n).then(e=>e(i,t)),readOutboundResourceInGroup:(r,a,n,s)=>OutboundResourceGroupServiceApiFp(e).readOutboundResourceInGroup(r,a,n,s).then(e=>e(i,t)),searchOutboundResourceGroup:(r,a,n,s,o,u,c)=>OutboundResourceGroupServiceApiFp(e).searchOutboundResourceGroup(r,a,n,s,o,u,c).then(e=>e(i,t)),searchOutboundResourceInGroup:(r,a,n,s,o,u,c,l)=>OutboundResourceGroupServiceApiFp(e).searchOutboundResourceInGroup(r,a,n,s,o,u,c,l).then(e=>e(i,t)),updateOutboundResourceGroup:(r,a,n)=>OutboundResourceGroupServiceApiFp(e).updateOutboundResourceGroup(r,a,n).then(e=>e(i,t)),updateOutboundResourceInGroup:(r,a,n,s)=>OutboundResourceGroupServiceApiFp(e).updateOutboundResourceInGroup(r,a,n,s).then(e=>e(i,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,i){return OutboundResourceGroupServiceApiFp(this.configuration).createOutboundResourceInGroup(e,t,i).then(e=>e(this.axios,this.basePath))}deleteOutboundResourceGroup(e,t,i){return OutboundResourceGroupServiceApiFp(this.configuration).deleteOutboundResourceGroup(e,t,i).then(e=>e(this.axios,this.basePath))}deleteOutboundResourceInGroup(e,t,i,r){return OutboundResourceGroupServiceApiFp(this.configuration).deleteOutboundResourceInGroup(e,t,i,r).then(e=>e(this.axios,this.basePath))}readOutboundResourceGroup(e,t,i){return OutboundResourceGroupServiceApiFp(this.configuration).readOutboundResourceGroup(e,t,i).then(e=>e(this.axios,this.basePath))}readOutboundResourceInGroup(e,t,i,r){return OutboundResourceGroupServiceApiFp(this.configuration).readOutboundResourceInGroup(e,t,i,r).then(e=>e(this.axios,this.basePath))}searchOutboundResourceGroup(e,t,i,r,a,n,s){return OutboundResourceGroupServiceApiFp(this.configuration).searchOutboundResourceGroup(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}searchOutboundResourceInGroup(e,t,i,r,a,n,s,o){return OutboundResourceGroupServiceApiFp(this.configuration).searchOutboundResourceInGroup(e,t,i,r,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateOutboundResourceGroup(e,t,i){return OutboundResourceGroupServiceApiFp(this.configuration).updateOutboundResourceGroup(e,t,i).then(e=>e(this.axios,this.basePath))}updateOutboundResourceInGroup(e,t,i,r){return OutboundResourceGroupServiceApiFp(this.configuration).updateOutboundResourceInGroup(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const OutboundResourceServiceApiAxiosParamCreator=function(e){return{createOutboundResource:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createOutboundResource.");const r=parse("/call_center/resources",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},createOutboundResourceDisplay:async(t,i,r={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling createOutboundResourceDisplay.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteOutboundResource:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},deleteOutboundResourceDisplay:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling deleteOutboundResourceDisplay.");if(null==i)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(i))),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!==r&&(l.domain_id=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}},patchOutboundResource:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchOutboundResource.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readOutboundResource:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readOutboundResourceDisplay:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling readOutboundResourceDisplay.");if(null==i)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(i))),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.domain_id=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}},searchOutboundResource:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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,i,r,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!==i&&(y.page=i),void 0!==r&&(y.size=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...u.headers},{url:format(l),options:p}},updateOutboundResource:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResource.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},updateOutboundResourceDisplay:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling updateOutboundResourceDisplay.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResourceDisplay.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},OutboundResourceServiceApiFp=function(e){return{async createOutboundResource(t,i){const r=await OutboundResourceServiceApiAxiosParamCreator(e).createOutboundResource(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async createOutboundResourceDisplay(t,i,r){const a=await OutboundResourceServiceApiAxiosParamCreator(e).createOutboundResourceDisplay(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteOutboundResource(t,i,r){const a=await OutboundResourceServiceApiAxiosParamCreator(e).deleteOutboundResource(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteOutboundResourceDisplay(t,i,r,a){const n=await OutboundResourceServiceApiAxiosParamCreator(e).deleteOutboundResourceDisplay(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async patchOutboundResource(t,i,r){const a=await OutboundResourceServiceApiAxiosParamCreator(e).patchOutboundResource(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readOutboundResource(t,i,r){const a=await OutboundResourceServiceApiAxiosParamCreator(e).readOutboundResource(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readOutboundResourceDisplay(t,i,r,a){const n=await OutboundResourceServiceApiAxiosParamCreator(e).readOutboundResourceDisplay(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async searchOutboundResource(t,i,r,a,n,s,o){const u=await OutboundResourceServiceApiAxiosParamCreator(e).searchOutboundResource(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async searchOutboundResourceDisplay(t,i,r,a,n,s,o,u){const c=await OutboundResourceServiceApiAxiosParamCreator(e).searchOutboundResourceDisplay(t,i,r,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const i={...c.options,url:t+c.url};return e.request(i)}},async updateOutboundResource(t,i,r){const a=await OutboundResourceServiceApiAxiosParamCreator(e).updateOutboundResource(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async updateOutboundResourceDisplay(t,i,r,a){const n=await OutboundResourceServiceApiAxiosParamCreator(e).updateOutboundResourceDisplay(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},OutboundResourceServiceApiFactory=function(e,t,i){return{createOutboundResource:(r,a)=>OutboundResourceServiceApiFp(e).createOutboundResource(r,a).then(e=>e(i,t)),createOutboundResourceDisplay:(r,a,n)=>OutboundResourceServiceApiFp(e).createOutboundResourceDisplay(r,a,n).then(e=>e(i,t)),deleteOutboundResource:(r,a,n)=>OutboundResourceServiceApiFp(e).deleteOutboundResource(r,a,n).then(e=>e(i,t)),deleteOutboundResourceDisplay:(r,a,n,s)=>OutboundResourceServiceApiFp(e).deleteOutboundResourceDisplay(r,a,n,s).then(e=>e(i,t)),patchOutboundResource:(r,a,n)=>OutboundResourceServiceApiFp(e).patchOutboundResource(r,a,n).then(e=>e(i,t)),readOutboundResource:(r,a,n)=>OutboundResourceServiceApiFp(e).readOutboundResource(r,a,n).then(e=>e(i,t)),readOutboundResourceDisplay:(r,a,n,s)=>OutboundResourceServiceApiFp(e).readOutboundResourceDisplay(r,a,n,s).then(e=>e(i,t)),searchOutboundResource:(r,a,n,s,o,u,c)=>OutboundResourceServiceApiFp(e).searchOutboundResource(r,a,n,s,o,u,c).then(e=>e(i,t)),searchOutboundResourceDisplay:(r,a,n,s,o,u,c,l)=>OutboundResourceServiceApiFp(e).searchOutboundResourceDisplay(r,a,n,s,o,u,c,l).then(e=>e(i,t)),updateOutboundResource:(r,a,n)=>OutboundResourceServiceApiFp(e).updateOutboundResource(r,a,n).then(e=>e(i,t)),updateOutboundResourceDisplay:(r,a,n,s)=>OutboundResourceServiceApiFp(e).updateOutboundResourceDisplay(r,a,n,s).then(e=>e(i,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,i){return OutboundResourceServiceApiFp(this.configuration).createOutboundResourceDisplay(e,t,i).then(e=>e(this.axios,this.basePath))}deleteOutboundResource(e,t,i){return OutboundResourceServiceApiFp(this.configuration).deleteOutboundResource(e,t,i).then(e=>e(this.axios,this.basePath))}deleteOutboundResourceDisplay(e,t,i,r){return OutboundResourceServiceApiFp(this.configuration).deleteOutboundResourceDisplay(e,t,i,r).then(e=>e(this.axios,this.basePath))}patchOutboundResource(e,t,i){return OutboundResourceServiceApiFp(this.configuration).patchOutboundResource(e,t,i).then(e=>e(this.axios,this.basePath))}readOutboundResource(e,t,i){return OutboundResourceServiceApiFp(this.configuration).readOutboundResource(e,t,i).then(e=>e(this.axios,this.basePath))}readOutboundResourceDisplay(e,t,i,r){return OutboundResourceServiceApiFp(this.configuration).readOutboundResourceDisplay(e,t,i,r).then(e=>e(this.axios,this.basePath))}searchOutboundResource(e,t,i,r,a,n,s){return OutboundResourceServiceApiFp(this.configuration).searchOutboundResource(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}searchOutboundResourceDisplay(e,t,i,r,a,n,s,o){return OutboundResourceServiceApiFp(this.configuration).searchOutboundResourceDisplay(e,t,i,r,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateOutboundResource(e,t,i){return OutboundResourceServiceApiFp(this.configuration).updateOutboundResource(e,t,i).then(e=>e(this.axios,this.basePath))}updateOutboundResourceDisplay(e,t,i,r){return OutboundResourceServiceApiFp(this.configuration).updateOutboundResourceDisplay(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const QueueBucketServiceApiAxiosParamCreator=function(e){return{createQueueBucket:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueBucket.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteQueueBucket:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueBucket.");if(null==i)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(i))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...r.headers},{url:format(n),options:o}},patchQueueBucket:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchQueueBucket.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueueBucket.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},readQueueBucket:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueBucket.");if(null==i)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(i))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...r.headers},{url:format(n),options:o}},searchQueueBucket:async(t,i,r,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!==i&&(y.page=i),void 0!==r&&(y.size=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...u.headers},{url:format(l),options:p}},updateQueueBucket:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueBucket.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueBucket.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},QueueBucketServiceApiFp=function(e){return{async createQueueBucket(t,i,r){const a=await QueueBucketServiceApiAxiosParamCreator(e).createQueueBucket(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteQueueBucket(t,i,r){const a=await QueueBucketServiceApiAxiosParamCreator(e).deleteQueueBucket(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async patchQueueBucket(t,i,r,a){const n=await QueueBucketServiceApiAxiosParamCreator(e).patchQueueBucket(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async readQueueBucket(t,i,r){const a=await QueueBucketServiceApiAxiosParamCreator(e).readQueueBucket(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchQueueBucket(t,i,r,a,n,s,o,u){const c=await QueueBucketServiceApiAxiosParamCreator(e).searchQueueBucket(t,i,r,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const i={...c.options,url:t+c.url};return e.request(i)}},async updateQueueBucket(t,i,r,a){const n=await QueueBucketServiceApiAxiosParamCreator(e).updateQueueBucket(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},QueueBucketServiceApiFactory=function(e,t,i){return{createQueueBucket:(r,a,n)=>QueueBucketServiceApiFp(e).createQueueBucket(r,a,n).then(e=>e(i,t)),deleteQueueBucket:(r,a,n)=>QueueBucketServiceApiFp(e).deleteQueueBucket(r,a,n).then(e=>e(i,t)),patchQueueBucket:(r,a,n,s)=>QueueBucketServiceApiFp(e).patchQueueBucket(r,a,n,s).then(e=>e(i,t)),readQueueBucket:(r,a,n)=>QueueBucketServiceApiFp(e).readQueueBucket(r,a,n).then(e=>e(i,t)),searchQueueBucket:(r,a,n,s,o,u,c,l)=>QueueBucketServiceApiFp(e).searchQueueBucket(r,a,n,s,o,u,c,l).then(e=>e(i,t)),updateQueueBucket:(r,a,n,s)=>QueueBucketServiceApiFp(e).updateQueueBucket(r,a,n,s).then(e=>e(i,t))}};class QueueBucketServiceApi extends BaseAPI{createQueueBucket(e,t,i){return QueueBucketServiceApiFp(this.configuration).createQueueBucket(e,t,i).then(e=>e(this.axios,this.basePath))}deleteQueueBucket(e,t,i){return QueueBucketServiceApiFp(this.configuration).deleteQueueBucket(e,t,i).then(e=>e(this.axios,this.basePath))}patchQueueBucket(e,t,i,r){return QueueBucketServiceApiFp(this.configuration).patchQueueBucket(e,t,i,r).then(e=>e(this.axios,this.basePath))}readQueueBucket(e,t,i){return QueueBucketServiceApiFp(this.configuration).readQueueBucket(e,t,i).then(e=>e(this.axios,this.basePath))}searchQueueBucket(e,t,i,r,a,n,s,o){return QueueBucketServiceApiFp(this.configuration).searchQueueBucket(e,t,i,r,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateQueueBucket(e,t,i,r){return QueueBucketServiceApiFp(this.configuration).updateQueueBucket(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const QueueHookServiceApiAxiosParamCreator=function(e){return{createQueueHook:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueHook.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteQueueHook:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueHook.");if(null==i)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(i))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...r.headers},{url:format(n),options:o}},patchQueueHook:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchQueueHook.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueueHook.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},readQueueHook:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueHook.");if(null==i)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(i))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...r.headers},{url:format(n),options:o}},searchQueueHook:async(t,i,r,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},A={},g={};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!==i&&(g.page=i),void 0!==r&&(g.size=r),void 0!==a&&(g.q=a),void 0!==n&&(g.sort=n),s&&(g.fields=s),o&&(g.id=o),u&&(g.schema_id=u),c&&(g.event=c),p.query={...p.query,...g,...l.query},delete p.search;let m=h&&h.headers?h.headers:{};return y.headers={...A,...m,...l.headers},{url:format(p),options:y}},updateQueueHook:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueHook.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueHook.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},QueueHookServiceApiFp=function(e){return{async createQueueHook(t,i,r){const a=await QueueHookServiceApiAxiosParamCreator(e).createQueueHook(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteQueueHook(t,i,r){const a=await QueueHookServiceApiAxiosParamCreator(e).deleteQueueHook(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async patchQueueHook(t,i,r,a){const n=await QueueHookServiceApiAxiosParamCreator(e).patchQueueHook(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async readQueueHook(t,i,r){const a=await QueueHookServiceApiAxiosParamCreator(e).readQueueHook(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchQueueHook(t,i,r,a,n,s,o,u,c,l){const d=await QueueHookServiceApiAxiosParamCreator(e).searchQueueHook(t,i,r,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const i={...d.options,url:t+d.url};return e.request(i)}},async updateQueueHook(t,i,r,a){const n=await QueueHookServiceApiAxiosParamCreator(e).updateQueueHook(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},QueueHookServiceApiFactory=function(e,t,i){return{createQueueHook:(r,a,n)=>QueueHookServiceApiFp(e).createQueueHook(r,a,n).then(e=>e(i,t)),deleteQueueHook:(r,a,n)=>QueueHookServiceApiFp(e).deleteQueueHook(r,a,n).then(e=>e(i,t)),patchQueueHook:(r,a,n,s)=>QueueHookServiceApiFp(e).patchQueueHook(r,a,n,s).then(e=>e(i,t)),readQueueHook:(r,a,n)=>QueueHookServiceApiFp(e).readQueueHook(r,a,n).then(e=>e(i,t)),searchQueueHook:(r,a,n,s,o,u,c,l,d,p)=>QueueHookServiceApiFp(e).searchQueueHook(r,a,n,s,o,u,c,l,d,p).then(e=>e(i,t)),updateQueueHook:(r,a,n,s)=>QueueHookServiceApiFp(e).updateQueueHook(r,a,n,s).then(e=>e(i,t))}};class QueueHookServiceApi extends BaseAPI{createQueueHook(e,t,i){return QueueHookServiceApiFp(this.configuration).createQueueHook(e,t,i).then(e=>e(this.axios,this.basePath))}deleteQueueHook(e,t,i){return QueueHookServiceApiFp(this.configuration).deleteQueueHook(e,t,i).then(e=>e(this.axios,this.basePath))}patchQueueHook(e,t,i,r){return QueueHookServiceApiFp(this.configuration).patchQueueHook(e,t,i,r).then(e=>e(this.axios,this.basePath))}readQueueHook(e,t,i){return QueueHookServiceApiFp(this.configuration).readQueueHook(e,t,i).then(e=>e(this.axios,this.basePath))}searchQueueHook(e,t,i,r,a,n,s,o,u,c){return QueueHookServiceApiFp(this.configuration).searchQueueHook(e,t,i,r,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}updateQueueHook(e,t,i,r){return QueueHookServiceApiFp(this.configuration).updateQueueHook(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const QueueResourcesServiceApiAxiosParamCreator=function(e){return{createQueueResourceGroup:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueResourceGroup.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteQueueResourceGroup:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueResourceGroup.");if(null==i)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(i))),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!==r&&(l.domain_id=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}},readQueueResourceGroup:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueResourceGroup.");if(null==i)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(i))),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.domain_id=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}},searchQueueResourceGroup:async(t,i,r,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!==i&&(y.page=i),void 0!==r&&(y.size=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...u.headers},{url:format(l),options:p}},updateQueueResourceGroup:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueResourceGroup.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueResourceGroup.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},QueueResourcesServiceApiFp=function(e){return{async createQueueResourceGroup(t,i,r){const a=await QueueResourcesServiceApiAxiosParamCreator(e).createQueueResourceGroup(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteQueueResourceGroup(t,i,r,a){const n=await QueueResourcesServiceApiAxiosParamCreator(e).deleteQueueResourceGroup(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async readQueueResourceGroup(t,i,r,a){const n=await QueueResourcesServiceApiAxiosParamCreator(e).readQueueResourceGroup(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async searchQueueResourceGroup(t,i,r,a,n,s,o,u){const c=await QueueResourcesServiceApiAxiosParamCreator(e).searchQueueResourceGroup(t,i,r,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const i={...c.options,url:t+c.url};return e.request(i)}},async updateQueueResourceGroup(t,i,r,a){const n=await QueueResourcesServiceApiAxiosParamCreator(e).updateQueueResourceGroup(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},QueueResourcesServiceApiFactory=function(e,t,i){return{createQueueResourceGroup:(r,a,n)=>QueueResourcesServiceApiFp(e).createQueueResourceGroup(r,a,n).then(e=>e(i,t)),deleteQueueResourceGroup:(r,a,n,s)=>QueueResourcesServiceApiFp(e).deleteQueueResourceGroup(r,a,n,s).then(e=>e(i,t)),readQueueResourceGroup:(r,a,n,s)=>QueueResourcesServiceApiFp(e).readQueueResourceGroup(r,a,n,s).then(e=>e(i,t)),searchQueueResourceGroup:(r,a,n,s,o,u,c,l)=>QueueResourcesServiceApiFp(e).searchQueueResourceGroup(r,a,n,s,o,u,c,l).then(e=>e(i,t)),updateQueueResourceGroup:(r,a,n,s)=>QueueResourcesServiceApiFp(e).updateQueueResourceGroup(r,a,n,s).then(e=>e(i,t))}};class QueueResourcesServiceApi extends BaseAPI{createQueueResourceGroup(e,t,i){return QueueResourcesServiceApiFp(this.configuration).createQueueResourceGroup(e,t,i).then(e=>e(this.axios,this.basePath))}deleteQueueResourceGroup(e,t,i,r){return QueueResourcesServiceApiFp(this.configuration).deleteQueueResourceGroup(e,t,i,r).then(e=>e(this.axios,this.basePath))}readQueueResourceGroup(e,t,i,r){return QueueResourcesServiceApiFp(this.configuration).readQueueResourceGroup(e,t,i,r).then(e=>e(this.axios,this.basePath))}searchQueueResourceGroup(e,t,i,r,a,n,s,o){return QueueResourcesServiceApiFp(this.configuration).searchQueueResourceGroup(e,t,i,r,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateQueueResourceGroup(e,t,i,r){return QueueResourcesServiceApiFp(this.configuration).updateQueueResourceGroup(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const QueueServiceApiAxiosParamCreator=function(e){return{createQueue:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createQueue.");const r=parse("/call_center/queues",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteQueue:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},patchQueue:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueue.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readQueue:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchQueue:async(t,i,r,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!==i&&(h.size=i),void 0!==r&&(h.q=r),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,i,r,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 A={method:"GET",...y,...p},g={},m={};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&&(m.page=t),void 0!==i&&(m.size=i),void 0!==r&&(m["joined_at.from"]=r),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 A.headers={...g,...f,...p.headers},{url:format(h),options:A}},updateQueue:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueue.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},QueueServiceApiFp=function(e){return{async createQueue(t,i){const r=await QueueServiceApiAxiosParamCreator(e).createQueue(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteQueue(t,i,r){const a=await QueueServiceApiAxiosParamCreator(e).deleteQueue(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async patchQueue(t,i,r){const a=await QueueServiceApiAxiosParamCreator(e).patchQueue(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readQueue(t,i,r){const a=await QueueServiceApiAxiosParamCreator(e).readQueue(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchQueue(t,i,r,a,n,s,o,u){const c=await QueueServiceApiAxiosParamCreator(e).searchQueue(t,i,r,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const i={...c.options,url:t+c.url};return e.request(i)}},async searchQueueReportGeneral(t,i,r,a,n,s,o,u,c,l,d,p){const h=await QueueServiceApiAxiosParamCreator(e).searchQueueReportGeneral(t,i,r,a,n,s,o,u,c,l,d,p);return(e=globalAxios,t=BASE_PATH)=>{const i={...h.options,url:t+h.url};return e.request(i)}},async updateQueue(t,i,r){const a=await QueueServiceApiAxiosParamCreator(e).updateQueue(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},QueueServiceApiFactory=function(e,t,i){return{createQueue:(r,a)=>QueueServiceApiFp(e).createQueue(r,a).then(e=>e(i,t)),deleteQueue:(r,a,n)=>QueueServiceApiFp(e).deleteQueue(r,a,n).then(e=>e(i,t)),patchQueue:(r,a,n)=>QueueServiceApiFp(e).patchQueue(r,a,n).then(e=>e(i,t)),readQueue:(r,a,n)=>QueueServiceApiFp(e).readQueue(r,a,n).then(e=>e(i,t)),searchQueue:(r,a,n,s,o,u,c,l)=>QueueServiceApiFp(e).searchQueue(r,a,n,s,o,u,c,l).then(e=>e(i,t)),searchQueueReportGeneral:(r,a,n,s,o,u,c,l,d,p,h,y)=>QueueServiceApiFp(e).searchQueueReportGeneral(r,a,n,s,o,u,c,l,d,p,h,y).then(e=>e(i,t)),updateQueue:(r,a,n)=>QueueServiceApiFp(e).updateQueue(r,a,n).then(e=>e(i,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,i){return QueueServiceApiFp(this.configuration).deleteQueue(e,t,i).then(e=>e(this.axios,this.basePath))}patchQueue(e,t,i){return QueueServiceApiFp(this.configuration).patchQueue(e,t,i).then(e=>e(this.axios,this.basePath))}readQueue(e,t,i){return QueueServiceApiFp(this.configuration).readQueue(e,t,i).then(e=>e(this.axios,this.basePath))}searchQueue(e,t,i,r,a,n,s,o){return QueueServiceApiFp(this.configuration).searchQueue(e,t,i,r,a,n,s,o).then(e=>e(this.axios,this.basePath))}searchQueueReportGeneral(e,t,i,r,a,n,s,o,u,c,l,d){return QueueServiceApiFp(this.configuration).searchQueueReportGeneral(e,t,i,r,a,n,s,o,u,c,l,d).then(e=>e(this.axios,this.basePath))}updateQueue(e,t,i){return QueueServiceApiFp(this.configuration).updateQueue(e,t,i).then(e=>e(this.axios,this.basePath))}}const QueueSkillServiceApiAxiosParamCreator=function(e){return{createQueueSkill:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueSkill.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteQueueSkill:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueSkill.");if(null==i)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(i))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...r.headers},{url:format(n),options:o}},patchQueueSkill:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchQueueSkill.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueueSkill.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},readQueueSkill:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueSkill.");if(null==i)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(i))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...r.headers},{url:format(n),options:o}},searchQueueSkill:async(t,i,r,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 A="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(t))),g=parse(A,!0);let m;e&&(m=e.baseOptions);const f={method:"GET",...m,...y},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!==i&&(S.page=i),void 0!==r&&(S.size=r),void 0!==a&&(S.q=a),void 0!==n&&(S.sort=n),s&&(S.fields=s),o&&(S.id=o),u&&(S.skill_id=u),c&&(S.bucket_id=c),l&&(S.lvl=l),d&&(S.min_capacity=d),p&&(S.max_capacity=p),void 0!==h&&(S.enabled=h),g.query={...g.query,...S,...y.query},delete g.search;let w=m&&m.headers?m.headers:{};return f.headers={...b,...w,...y.headers},{url:format(g),options:f}},updateQueueSkill:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueSkill.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueSkill.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},QueueSkillServiceApiFp=function(e){return{async createQueueSkill(t,i,r){const a=await QueueSkillServiceApiAxiosParamCreator(e).createQueueSkill(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteQueueSkill(t,i,r){const a=await QueueSkillServiceApiAxiosParamCreator(e).deleteQueueSkill(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async patchQueueSkill(t,i,r,a){const n=await QueueSkillServiceApiAxiosParamCreator(e).patchQueueSkill(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async readQueueSkill(t,i,r){const a=await QueueSkillServiceApiAxiosParamCreator(e).readQueueSkill(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchQueueSkill(t,i,r,a,n,s,o,u,c,l,d,p,h,y){const A=await QueueSkillServiceApiAxiosParamCreator(e).searchQueueSkill(t,i,r,a,n,s,o,u,c,l,d,p,h,y);return(e=globalAxios,t=BASE_PATH)=>{const i={...A.options,url:t+A.url};return e.request(i)}},async updateQueueSkill(t,i,r,a){const n=await QueueSkillServiceApiAxiosParamCreator(e).updateQueueSkill(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},QueueSkillServiceApiFactory=function(e,t,i){return{createQueueSkill:(r,a,n)=>QueueSkillServiceApiFp(e).createQueueSkill(r,a,n).then(e=>e(i,t)),deleteQueueSkill:(r,a,n)=>QueueSkillServiceApiFp(e).deleteQueueSkill(r,a,n).then(e=>e(i,t)),patchQueueSkill:(r,a,n,s)=>QueueSkillServiceApiFp(e).patchQueueSkill(r,a,n,s).then(e=>e(i,t)),readQueueSkill:(r,a,n)=>QueueSkillServiceApiFp(e).readQueueSkill(r,a,n).then(e=>e(i,t)),searchQueueSkill:(r,a,n,s,o,u,c,l,d,p,h,y,A,g)=>QueueSkillServiceApiFp(e).searchQueueSkill(r,a,n,s,o,u,c,l,d,p,h,y,A,g).then(e=>e(i,t)),updateQueueSkill:(r,a,n,s)=>QueueSkillServiceApiFp(e).updateQueueSkill(r,a,n,s).then(e=>e(i,t))}};class QueueSkillServiceApi extends BaseAPI{createQueueSkill(e,t,i){return QueueSkillServiceApiFp(this.configuration).createQueueSkill(e,t,i).then(e=>e(this.axios,this.basePath))}deleteQueueSkill(e,t,i){return QueueSkillServiceApiFp(this.configuration).deleteQueueSkill(e,t,i).then(e=>e(this.axios,this.basePath))}patchQueueSkill(e,t,i,r){return QueueSkillServiceApiFp(this.configuration).patchQueueSkill(e,t,i,r).then(e=>e(this.axios,this.basePath))}readQueueSkill(e,t,i){return QueueSkillServiceApiFp(this.configuration).readQueueSkill(e,t,i).then(e=>e(this.axios,this.basePath))}searchQueueSkill(e,t,i,r,a,n,s,o,u,c,l,d,p,h){return QueueSkillServiceApiFp(this.configuration).searchQueueSkill(e,t,i,r,a,n,s,o,u,c,l,d,p,h).then(e=>e(this.axios,this.basePath))}updateQueueSkill(e,t,i,r){return QueueSkillServiceApiFp(this.configuration).updateQueueSkill(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const RegionServiceApiAxiosParamCreator=function(e){return{createRegion:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRegion.");const r=parse("/regions",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteRegion:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteRegion.");const r="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},patchRegion:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchRegion.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readRegion:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readRegion.");const r="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},searchRegion:async(t,i,r,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={},A={};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&&(A.page=t),void 0!==i&&(A.size=i),void 0!==r&&(A.q=r),void 0!==a&&(A.sort=a),n&&(A.fields=n),s&&(A.id=s),void 0!==o&&(A.name=o),void 0!==u&&(A.description=u),c&&(A.timezone_id=c),d.query={...d.query,...A,...l.query},delete d.search;let g=p&&p.headers?p.headers:{};return h.headers={...y,...g,...l.headers},{url:format(d),options:h}},updateRegion:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRegion.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},RegionServiceApiFp=function(e){return{async createRegion(t,i){const r=await RegionServiceApiAxiosParamCreator(e).createRegion(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteRegion(t,i){const r=await RegionServiceApiAxiosParamCreator(e).deleteRegion(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async patchRegion(t,i,r){const a=await RegionServiceApiAxiosParamCreator(e).patchRegion(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readRegion(t,i){const r=await RegionServiceApiAxiosParamCreator(e).readRegion(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async searchRegion(t,i,r,a,n,s,o,u,c,l){const d=await RegionServiceApiAxiosParamCreator(e).searchRegion(t,i,r,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const i={...d.options,url:t+d.url};return e.request(i)}},async updateRegion(t,i,r){const a=await RegionServiceApiAxiosParamCreator(e).updateRegion(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},RegionServiceApiFactory=function(e,t,i){return{createRegion:(r,a)=>RegionServiceApiFp(e).createRegion(r,a).then(e=>e(i,t)),deleteRegion:(r,a)=>RegionServiceApiFp(e).deleteRegion(r,a).then(e=>e(i,t)),patchRegion:(r,a,n)=>RegionServiceApiFp(e).patchRegion(r,a,n).then(e=>e(i,t)),readRegion:(r,a)=>RegionServiceApiFp(e).readRegion(r,a).then(e=>e(i,t)),searchRegion:(r,a,n,s,o,u,c,l,d,p)=>RegionServiceApiFp(e).searchRegion(r,a,n,s,o,u,c,l,d,p).then(e=>e(i,t)),updateRegion:(r,a,n)=>RegionServiceApiFp(e).updateRegion(r,a,n).then(e=>e(i,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,i){return RegionServiceApiFp(this.configuration).patchRegion(e,t,i).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,i,r,a,n,s,o,u,c){return RegionServiceApiFp(this.configuration).searchRegion(e,t,i,r,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}updateRegion(e,t,i){return RegionServiceApiFp(this.configuration).updateRegion(e,t,i).then(e=>e(this.axios,this.basePath))}}const RoutingChatPlanServiceApiAxiosParamCreator=function(e){return{createChatPlan:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createChatPlan.");const r=parse("/routing/outbound/chat",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteChatPlan:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteChatPlan.");const r="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},patchChatPlan:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchChatPlan.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readChatPlan:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readChatPlan.");const r="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},searchChatPlan:async(t,i,r,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!==i&&(y.size=i),void 0!==r&&(y.q=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...c.headers},{url:format(l),options:p}},updateChatPlan:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateChatPlan.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},RoutingChatPlanServiceApiFp=function(e){return{async createChatPlan(t,i){const r=await RoutingChatPlanServiceApiAxiosParamCreator(e).createChatPlan(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteChatPlan(t,i){const r=await RoutingChatPlanServiceApiAxiosParamCreator(e).deleteChatPlan(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async patchChatPlan(t,i,r){const a=await RoutingChatPlanServiceApiAxiosParamCreator(e).patchChatPlan(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readChatPlan(t,i){const r=await RoutingChatPlanServiceApiAxiosParamCreator(e).readChatPlan(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async searchChatPlan(t,i,r,a,n,s,o,u,c){const l=await RoutingChatPlanServiceApiAxiosParamCreator(e).searchChatPlan(t,i,r,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const i={...l.options,url:t+l.url};return e.request(i)}},async updateChatPlan(t,i,r){const a=await RoutingChatPlanServiceApiAxiosParamCreator(e).updateChatPlan(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},RoutingChatPlanServiceApiFactory=function(e,t,i){return{createChatPlan:(r,a)=>RoutingChatPlanServiceApiFp(e).createChatPlan(r,a).then(e=>e(i,t)),deleteChatPlan:(r,a)=>RoutingChatPlanServiceApiFp(e).deleteChatPlan(r,a).then(e=>e(i,t)),patchChatPlan:(r,a,n)=>RoutingChatPlanServiceApiFp(e).patchChatPlan(r,a,n).then(e=>e(i,t)),readChatPlan:(r,a)=>RoutingChatPlanServiceApiFp(e).readChatPlan(r,a).then(e=>e(i,t)),searchChatPlan:(r,a,n,s,o,u,c,l,d)=>RoutingChatPlanServiceApiFp(e).searchChatPlan(r,a,n,s,o,u,c,l,d).then(e=>e(i,t)),updateChatPlan:(r,a,n)=>RoutingChatPlanServiceApiFp(e).updateChatPlan(r,a,n).then(e=>e(i,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,i){return RoutingChatPlanServiceApiFp(this.configuration).patchChatPlan(e,t,i).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,i,r,a,n,s,o,u){return RoutingChatPlanServiceApiFp(this.configuration).searchChatPlan(e,t,i,r,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateChatPlan(e,t,i){return RoutingChatPlanServiceApiFp(this.configuration).updateChatPlan(e,t,i).then(e=>e(this.axios,this.basePath))}}const RoutingOutboundCallServiceApiAxiosParamCreator=function(e){return{createRoutingOutboundCall:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRoutingOutboundCall.");const r=parse("/routing/outbound/calls",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteRoutingOutboundCall:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},movePositionRoutingOutboundCall:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("fromId","Required parameter fromId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==i)throw new RequiredError("toId","Required parameter toId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},patchRoutingOutboundCall:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchRoutingOutboundCall.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readRoutingOutboundCall:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchRoutingOutboundCall:async(t,i,r,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},A={},g={};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&&(g.page=t),void 0!==i&&(g.size=i),void 0!==r&&(g.q=r),void 0!==a&&(g.sort=a),n&&(g.fields=n),s&&(g.id=s),void 0!==o&&(g.name=o),u&&(g.schema_id=u),void 0!==c&&(g.pattern=c),void 0!==l&&(g.description=l),p.query={...p.query,...g,...d.query},delete p.search;let m=h&&h.headers?h.headers:{};return y.headers={...A,...m,...d.headers},{url:format(p),options:y}},updateRoutingOutboundCall:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRoutingOutboundCall.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},RoutingOutboundCallServiceApiFp=function(e){return{async createRoutingOutboundCall(t,i){const r=await RoutingOutboundCallServiceApiAxiosParamCreator(e).createRoutingOutboundCall(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteRoutingOutboundCall(t,i,r){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).deleteRoutingOutboundCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async movePositionRoutingOutboundCall(t,i,r,a){const n=await RoutingOutboundCallServiceApiAxiosParamCreator(e).movePositionRoutingOutboundCall(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async patchRoutingOutboundCall(t,i,r){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).patchRoutingOutboundCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readRoutingOutboundCall(t,i,r){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).readRoutingOutboundCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchRoutingOutboundCall(t,i,r,a,n,s,o,u,c,l,d){const p=await RoutingOutboundCallServiceApiAxiosParamCreator(e).searchRoutingOutboundCall(t,i,r,a,n,s,o,u,c,l,d);return(e=globalAxios,t=BASE_PATH)=>{const i={...p.options,url:t+p.url};return e.request(i)}},async updateRoutingOutboundCall(t,i,r){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).updateRoutingOutboundCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},RoutingOutboundCallServiceApiFactory=function(e,t,i){return{createRoutingOutboundCall:(r,a)=>RoutingOutboundCallServiceApiFp(e).createRoutingOutboundCall(r,a).then(e=>e(i,t)),deleteRoutingOutboundCall:(r,a,n)=>RoutingOutboundCallServiceApiFp(e).deleteRoutingOutboundCall(r,a,n).then(e=>e(i,t)),movePositionRoutingOutboundCall:(r,a,n,s)=>RoutingOutboundCallServiceApiFp(e).movePositionRoutingOutboundCall(r,a,n,s).then(e=>e(i,t)),patchRoutingOutboundCall:(r,a,n)=>RoutingOutboundCallServiceApiFp(e).patchRoutingOutboundCall(r,a,n).then(e=>e(i,t)),readRoutingOutboundCall:(r,a,n)=>RoutingOutboundCallServiceApiFp(e).readRoutingOutboundCall(r,a,n).then(e=>e(i,t)),searchRoutingOutboundCall:(r,a,n,s,o,u,c,l,d,p,h)=>RoutingOutboundCallServiceApiFp(e).searchRoutingOutboundCall(r,a,n,s,o,u,c,l,d,p,h).then(e=>e(i,t)),updateRoutingOutboundCall:(r,a,n)=>RoutingOutboundCallServiceApiFp(e).updateRoutingOutboundCall(r,a,n).then(e=>e(i,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,i){return RoutingOutboundCallServiceApiFp(this.configuration).deleteRoutingOutboundCall(e,t,i).then(e=>e(this.axios,this.basePath))}movePositionRoutingOutboundCall(e,t,i,r){return RoutingOutboundCallServiceApiFp(this.configuration).movePositionRoutingOutboundCall(e,t,i,r).then(e=>e(this.axios,this.basePath))}patchRoutingOutboundCall(e,t,i){return RoutingOutboundCallServiceApiFp(this.configuration).patchRoutingOutboundCall(e,t,i).then(e=>e(this.axios,this.basePath))}readRoutingOutboundCall(e,t,i){return RoutingOutboundCallServiceApiFp(this.configuration).readRoutingOutboundCall(e,t,i).then(e=>e(this.axios,this.basePath))}searchRoutingOutboundCall(e,t,i,r,a,n,s,o,u,c,l){return RoutingOutboundCallServiceApiFp(this.configuration).searchRoutingOutboundCall(e,t,i,r,a,n,s,o,u,c,l).then(e=>e(this.axios,this.basePath))}updateRoutingOutboundCall(e,t,i){return RoutingOutboundCallServiceApiFp(this.configuration).updateRoutingOutboundCall(e,t,i).then(e=>e(this.axios,this.basePath))}}const RoutingSchemaServiceApiAxiosParamCreator=function(e){return{createRoutingSchema:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRoutingSchema.");const r=parse("/routing/schema",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteRoutingSchema:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},patchRoutingSchema:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchRoutingSchema.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readRoutingSchema:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchRoutingSchema:async(t,i,r,a,n,s,o,u,c,l={})=>{const d=parse("/routing/schema",!0);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...l},y={},A={};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&&(A.page=t),void 0!==i&&(A.size=i),void 0!==r&&(A.q=r),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),d.query={...d.query,...A,...l.query},delete d.search;let g=p&&p.headers?p.headers:{};return h.headers={...y,...g,...l.headers},{url:format(d),options:h}},updateRoutingSchema:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRoutingSchema.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},RoutingSchemaServiceApiFp=function(e){return{async createRoutingSchema(t,i){const r=await RoutingSchemaServiceApiAxiosParamCreator(e).createRoutingSchema(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteRoutingSchema(t,i,r){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).deleteRoutingSchema(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async patchRoutingSchema(t,i,r){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).patchRoutingSchema(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readRoutingSchema(t,i,r){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).readRoutingSchema(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchRoutingSchema(t,i,r,a,n,s,o,u,c,l){const d=await RoutingSchemaServiceApiAxiosParamCreator(e).searchRoutingSchema(t,i,r,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const i={...d.options,url:t+d.url};return e.request(i)}},async updateRoutingSchema(t,i,r){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).updateRoutingSchema(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},RoutingSchemaServiceApiFactory=function(e,t,i){return{createRoutingSchema:(r,a)=>RoutingSchemaServiceApiFp(e).createRoutingSchema(r,a).then(e=>e(i,t)),deleteRoutingSchema:(r,a,n)=>RoutingSchemaServiceApiFp(e).deleteRoutingSchema(r,a,n).then(e=>e(i,t)),patchRoutingSchema:(r,a,n)=>RoutingSchemaServiceApiFp(e).patchRoutingSchema(r,a,n).then(e=>e(i,t)),readRoutingSchema:(r,a,n)=>RoutingSchemaServiceApiFp(e).readRoutingSchema(r,a,n).then(e=>e(i,t)),searchRoutingSchema:(r,a,n,s,o,u,c,l,d,p)=>RoutingSchemaServiceApiFp(e).searchRoutingSchema(r,a,n,s,o,u,c,l,d,p).then(e=>e(i,t)),updateRoutingSchema:(r,a,n)=>RoutingSchemaServiceApiFp(e).updateRoutingSchema(r,a,n).then(e=>e(i,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,i){return RoutingSchemaServiceApiFp(this.configuration).deleteRoutingSchema(e,t,i).then(e=>e(this.axios,this.basePath))}patchRoutingSchema(e,t,i){return RoutingSchemaServiceApiFp(this.configuration).patchRoutingSchema(e,t,i).then(e=>e(this.axios,this.basePath))}readRoutingSchema(e,t,i){return RoutingSchemaServiceApiFp(this.configuration).readRoutingSchema(e,t,i).then(e=>e(this.axios,this.basePath))}searchRoutingSchema(e,t,i,r,a,n,s,o,u,c){return RoutingSchemaServiceApiFp(this.configuration).searchRoutingSchema(e,t,i,r,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}updateRoutingSchema(e,t,i){return RoutingSchemaServiceApiFp(this.configuration).updateRoutingSchema(e,t,i).then(e=>e(this.axios,this.basePath))}}const RoutingVariableServiceApiAxiosParamCreator=function(e){return{createRoutingVariable:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRoutingVariable.");const r=parse("/routing/variables",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteRoutingVariable:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readRoutingVariable:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchRoutingVariable:async(t,i,r,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!==i&&(c.size=i),void 0!==r&&(c.domain_id=r),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,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRoutingVariable.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},RoutingVariableServiceApiFp=function(e){return{async createRoutingVariable(t,i){const r=await RoutingVariableServiceApiAxiosParamCreator(e).createRoutingVariable(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteRoutingVariable(t,i,r){const a=await RoutingVariableServiceApiAxiosParamCreator(e).deleteRoutingVariable(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readRoutingVariable(t,i,r){const a=await RoutingVariableServiceApiAxiosParamCreator(e).readRoutingVariable(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchRoutingVariable(t,i,r,a){const n=await RoutingVariableServiceApiAxiosParamCreator(e).searchRoutingVariable(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async updateRoutingVariable(t,i,r){const a=await RoutingVariableServiceApiAxiosParamCreator(e).updateRoutingVariable(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},RoutingVariableServiceApiFactory=function(e,t,i){return{createRoutingVariable:(r,a)=>RoutingVariableServiceApiFp(e).createRoutingVariable(r,a).then(e=>e(i,t)),deleteRoutingVariable:(r,a,n)=>RoutingVariableServiceApiFp(e).deleteRoutingVariable(r,a,n).then(e=>e(i,t)),readRoutingVariable:(r,a,n)=>RoutingVariableServiceApiFp(e).readRoutingVariable(r,a,n).then(e=>e(i,t)),searchRoutingVariable:(r,a,n,s)=>RoutingVariableServiceApiFp(e).searchRoutingVariable(r,a,n,s).then(e=>e(i,t)),updateRoutingVariable:(r,a,n)=>RoutingVariableServiceApiFp(e).updateRoutingVariable(r,a,n).then(e=>e(i,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,i){return RoutingVariableServiceApiFp(this.configuration).deleteRoutingVariable(e,t,i).then(e=>e(this.axios,this.basePath))}readRoutingVariable(e,t,i){return RoutingVariableServiceApiFp(this.configuration).readRoutingVariable(e,t,i).then(e=>e(this.axios,this.basePath))}searchRoutingVariable(e,t,i,r){return RoutingVariableServiceApiFp(this.configuration).searchRoutingVariable(e,t,i,r).then(e=>e(this.axios,this.basePath))}updateRoutingVariable(e,t,i){return RoutingVariableServiceApiFp(this.configuration).updateRoutingVariable(e,t,i).then(e=>e(this.axios,this.basePath))}}const SkillServiceApiAxiosParamCreator=function(e){return{createSkill:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createSkill.");const r=parse("/call_center/skills",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteSkill:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readSkill:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchSkill:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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}},updateSkill:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateSkill.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},SkillServiceApiFp=function(e){return{async createSkill(t,i){const r=await SkillServiceApiAxiosParamCreator(e).createSkill(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteSkill(t,i,r){const a=await SkillServiceApiAxiosParamCreator(e).deleteSkill(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readSkill(t,i,r){const a=await SkillServiceApiAxiosParamCreator(e).readSkill(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchSkill(t,i,r,a,n,s,o){const u=await SkillServiceApiAxiosParamCreator(e).searchSkill(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async updateSkill(t,i,r){const a=await SkillServiceApiAxiosParamCreator(e).updateSkill(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},SkillServiceApiFactory=function(e,t,i){return{createSkill:(r,a)=>SkillServiceApiFp(e).createSkill(r,a).then(e=>e(i,t)),deleteSkill:(r,a,n)=>SkillServiceApiFp(e).deleteSkill(r,a,n).then(e=>e(i,t)),readSkill:(r,a,n)=>SkillServiceApiFp(e).readSkill(r,a,n).then(e=>e(i,t)),searchSkill:(r,a,n,s,o,u,c)=>SkillServiceApiFp(e).searchSkill(r,a,n,s,o,u,c).then(e=>e(i,t)),updateSkill:(r,a,n)=>SkillServiceApiFp(e).updateSkill(r,a,n).then(e=>e(i,t))}};class SkillServiceApi extends BaseAPI{createSkill(e,t){return SkillServiceApiFp(this.configuration).createSkill(e,t).then(e=>e(this.axios,this.basePath))}deleteSkill(e,t,i){return SkillServiceApiFp(this.configuration).deleteSkill(e,t,i).then(e=>e(this.axios,this.basePath))}readSkill(e,t,i){return SkillServiceApiFp(this.configuration).readSkill(e,t,i).then(e=>e(this.axios,this.basePath))}searchSkill(e,t,i,r,a,n,s){return SkillServiceApiFp(this.configuration).searchSkill(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}updateSkill(e,t,i){return SkillServiceApiFp(this.configuration).updateSkill(e,t,i).then(e=>e(this.axios,this.basePath))}}const UserHelperServiceApiAxiosParamCreator=function(e){return{defaultDeviceConfig:async(t,i={})=>{if(null==t)throw new RequiredError("type","Required parameter type was null or undefined when calling defaultDeviceConfig.");const r="/user/device/config/{type}".replace("{type}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}}}},UserHelperServiceApiFp=function(e){return{async defaultDeviceConfig(t,i){const r=await UserHelperServiceApiAxiosParamCreator(e).defaultDeviceConfig(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}}}},UserHelperServiceApiFactory=function(e,t,i){return{defaultDeviceConfig:(r,a)=>UserHelperServiceApiFp(e).defaultDeviceConfig(r,a).then(e=>e(i,t))}};class UserHelperServiceApi extends BaseAPI{defaultDeviceConfig(e,t){return UserHelperServiceApiFp(this.configuration).defaultDeviceConfig(e,t).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 ProtobufNullValue,StorageImportSourceType,StorageProviderType,StorageServiceType,StorageUploadStatusCode;!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"}(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={}));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,i){i.length>0?console[e](t,...i):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,t?debug.enable("*"):debug.disable(),this.log=new Log,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 i=this.sessionCache.get(e),r=await this.callOption(t);return i.answer(r)}return!1}async call(e){const t={};let i=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 r=await this.callOption(t);e.params&&e.params.display&&(i={extraHeaders:[`X-Webitel-Display: ${e.params.display}`]}),await this.ua.call(e.destination,{...r,...i})}async register(e){const t=new WebSocketInterface(e.server),i={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},r=this.ua=new UA(i);r.on("newRTCSession",e=>{const t=e.session,i=t.id,r=new Session(e);this.storeSession(i,r),t.on("connecting",()=>{this.emit("localStreams",r,t.connection.getLocalStreams())}),t.connection&&t.connection.addEventListener("addstream",e=>{this.emit("peerStreams",r,new Array(e.stream))}),t.on("peerconnection",e=>{e.peerconnection.addEventListener("addstream",async e=>{this.emit("peerStreams",r,new Array(e.stream))})}),t.on("ended",()=>{this.removeSession(i,t.connection)}),t.on("failed",()=>{this.removeSession(i,t.connection)}),t.on("accepted",()=>{r.incoming||this.emit("peerStreams",r,t.connection.getRemoteStreams())}),t.on("confirmed",()=>{}),this.emit("newSession",r)}),r.on("disconnected",e=>{this.emit("unregistered")}),r.on("unregistered",e=>{this.emit("unregistered")}),r.on("registrationFailed",e=>{this.log.error("registrationFailed",e)}),r.on("registered",e=>{this.emit("registered")}),r.start()}async unregister(){this.ua&&(this.ua.terminateSessions(),this.ua.removeAllListeners(),await this.ua.stop(),delete this.ua)}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(),i=t.getRemoteStreams();e&&e.forEach(e=>{e.getTracks().forEach(e=>{e.stop()})}),i&&i.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 i=await this.getUserMedia(e.audio,e.video);t?i.getTracks().forEach(e=>{t.addTrack(e)}):t=i}if(!t)throw new Error("bad stream request");return t}async getUserMedia(e,t){return new Promise(async(i,r)=>{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(i).catch(r)})}}async function getMediaStream(e){return new Promise((t,i)=>{if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)navigator.mediaDevices.getUserMedia(e).then(e=>t(e)).catch(e=>i(e));else{(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)(e,e=>t(e),e=>i(e))}})}SipPhone.userAgent="Webitel-Phone/0.0.1";const getVersion=()=>'"0.1.133"';var JobState,ChannelName,AgentStatus,ChannelState,ChannelType,CallReportingStatus,CallActions,CallDirection,version='"0.1.133"';!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,i){this.client=e,this.distribute=i,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.communication=i.communication,this.history=[i]}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()}setOffering(e){this.offeringAt=e.timestamp}setBridged(e){this.bridgedAt=e.timestamp,this.lastStatusChange=Date.now(),e.form&&(this.form=e.form)}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}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 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");return this.client.request("cc_form_action",{attempt_id:this.id,app_id:this.distribute.app_id,action:e,fields:t})}}!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._channel=t.channels[0],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[this._channel]}get channel(){return this._channel}get stateDuration(){return Math.round((Date.now()-this.lastStatusChange)/1e3)}onChannelEvent(e){let t;switch(e.status){case ChannelState.Distribute:const i=e;if(!i)throw new Error("bad event");if(t=new Task(this.client,e,i.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 i=this.client.conversationById(t.agentChannelId);i&&!i.task&&(i.task=t)}break;case ChannelState.Offering:const r=e;(t=this.task.get(e.attempt_id))&&(t.setOffering(r),r.offering.auto_answer&&t.channel===ChannelType.Job&&t.accept().catch(e=>{this.client.emit("error",e)}));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 i=e;if(!i)throw new Error("bad event");return t.setMissed(),this.setChannelStateTimeout(e.channel,e,i.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 i=e;if(!i)throw new Error("bad event");if(t=this.task.get(e.attempt_id))return t.setProcessing(e.timestamp,i.processing),this.setChannelStateTimeout(e.channel,e,i.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.channel,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){return this.client.agentSetPause(this.agentId,e)}async offline(){return this.client.agentSetOffline(this.agentId)}setStatus(e){e.status===AgentStatus.Online&&(this.info.on_demand=e.on_demand||!1,this._channel=e.channels[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,i){return this.client.request("cc_fetch_offline_members",{agent_id:this.agentId,page:t,q:e,per_page:i})}hasTask(e){return this.task.has(e.id)}setChannelState(e,t){this._channel.channel=e||null,this._channel.state=t.status,this._channel.joined_at=t.timestamp,this._channel.timeout=void 0}setChannelStateTimeout(e,t,i){this._channel.channel=e||null,this._channel.state=t.status,this._channel.timeout=i,this._channel.joined_at=t.timestamp}}!function(e){e.Abandoned="abandoned",e.Cancel="cancel",e.Success="success"}(CallReportingStatus||(CallReportingStatus={})),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"}(CallActions||(CallActions={})),function(e){e.Inbound="inbound",e.Outbound="outbound"}(CallDirection||(CallDirection={}));class Call{constructor(e,t){this.client=e;const i=t.data;this._muted=!1,this.voice=!0,this.createdAt=+t.timestamp,this.task=null,this.data=null,this.answeredAt=0,this.hangupAt=0,this.bridgedAt=0,this.reportingAt=0,this.autoAnswered=!1,this.peerStreams=[],this.localStreams=[],e.phone&&(i.sip_id?this.setSip(e.phone.sipSessionBySipId(i.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(i),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}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)}setActive(e){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)}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.params&&!0===this.params.autoAnswer}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,t){this.autoAnswered||(this.autoAnswered=!0,setTimeout(async()=>{await this.answer(e)},t))}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 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){return 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){return this.client.request("call_bridge",{from_id:this.id,from_app_id:this.appId,to_id:e.id,to_app_id:e.appId})}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 i=Math.ceil(e.length/t),r=new Array(i);let a=0;for(let n=0;n<i;n++)r[n]=e.substr(a,t),a+=t;return r}const maxSizeMessage=4096;var ChatActions,ConversationState;!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"}(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,i,r,a,n){this.client=e,this.conversationId=t,this.title=i,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.members=(r||[]).map(e=>wrapChannelMember(e)),this._messages=a||[],this.state=ConversationState.Invite,this.variables={},this._hasReporting=!(!n||"true"!==n.cc_reporting),this._autoAnswer=!1;for(const e in n)!e.startsWith("cc_")&&n.hasOwnProperty(e)&&("wbt_auto_answer"===e?this._autoAnswer="true"===n.wbt_auto_answer:this.variables[e]=n[e]);n&&n.hasOwnProperty("cc_attempt_id")&&this.client.agent&&(this.task=this.client.agent.task.get(+n.cc_attempt_id)||null)}setInvite(e,t){this.inviteId=e,this.invitedAt=t,this._autoAnswer&&this.join().catch(e=>{this.client.emit("error",e)})}setAnswered(e,t,i){this.state=ConversationState.Active,this.answeredAt=t,this.channelId=e,this.member=wrapChannelMember(i),this.inviteId=null}setClosed(e){this.state=ConversationState.Closed,this.closedAt=e}get id(){return this.channelId||this.inviteId||this.conversationId}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.url=this.client.fileUrlDownload(e.file.id),e.file.streamUrl=this.client.fileUrlStream(e.file.id),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}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}async decline(){if(!this.inviteId)throw new Error("This conversation is joined");return this.client.request("decline_chat",{invite_id:this.inviteId})}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 this.client.request("leave_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:e})}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 i=(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:i.id,name:e.name,mime:i.mime,url:i.shared,size:i.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}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";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}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",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)}`}async connect(){await this.connectToSocket()}async disconnect(){this.socket.close()}async subscribeCall(e,t){const i=await this.request("subscribe_call",t);if(this.eventHandler.on(WEBSOCKET_EVENT_CALL,e),i.items&&i.items.length)for(const e of i.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}},i=new Call(this,t);i.createdAt=e.created_at,i.answeredAt=e.answered_at||0,i.bridgedAt=e.bridged_at||0,i.hangupAt=e.hangup_at||0,e.task&&(i.task=new Task(this,{attempt_id:e.task.attempt_id,channel:e.task.channel,status:e.task.status,timestamp:Date.now()},e.task),i.queue.reporting="true",i.task.form=e.task.form||null,e.leaving_at&&e.task.processing_sec&&(i.task.startProcessingAt=e.leaving_at,i.task.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}))),this.callStore.set(i.id,i)}return i}async subscribeChat(e,t){const i=await this.request("subscribe_chat",t);if(this.eventHandler.on(WEBSOCKET_EVENT_CHAT,e),i&&i.items)for(const e of i.items){const t=e.messages.reverse(),i=new Conversation(this,e.id,e.title,e.members,t,e.variables);if(i.createdAt=e.created_at,i.closedAt=e.closed_at,e.task&&(i.task=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&&(i.task.startProcessingAt=e.leaving_at,i.task.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})),i.task.form=e.task.form||null),e.invite_id)i.setInvite(e.invite_id,e.created_at);else{if(!e.channel_id){this.log.error(`conversation ${e.id} not valid`);continue}i.setAnswered(e.channel_id,e.joined_at,{id:e.channel_id,name:"TODO",type:"webitel"})}this.conversationStore.set(i.id,i)}return i}async subscribeUsersStatus(e,t){const i=await this.request("subscribe_users_status",t);return this.eventHandler.on(WEBSOCKET_EVENT_USER_STATE,e),i}async subscribeAgentsStatus(e,t){const i=await this.request("cc_agent_subscribe_status",t);return this.eventHandler.on(WEBSOCKET_EVENT_AGENT_STATUS,e),i}subscribeTask(e){this.eventHandler.on(TASK_EVENT,e)}subscribeJob(e){this.eventHandler.on(JOB_EVENT,e)}async unSubscribe(e,t,i){return this.request(`un_subscribe_${e}`,i)}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(){return this.request(WEBSOCKET_AUTHENTICATION_CHALLENGE,{token:this._config.token})}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}get instanceId(){return this.connectionInfo.sock_id}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,i){return this.request("cc_agent_online",{agent_id:e,channels:t,on_demand:i})}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 i=this.callById(e);if(i)return i.answer(t)}request(e,t){return new Promise((i,r)=>{this.queueRequest.set(++this.reqSeq,{resolve:i,reject:r}),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)}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.phone.on("peerStreams",(e,t)=>{const i=this.callBySession(e);i&&!i.peerStreams.length&&(i.setPeerStreams(t),this.eventHandler.emit(WEBSOCKET_EVENT_CALL,CallActions.PeerStream,i))}),this.phone.on("localStreams",(e,t)=>{const i=this.callBySession(e);i&&!i.localStreams.length&&(i.setLocalStreams(t),this.eventHandler.emit(WEBSOCKET_EVENT_CALL,CallActions.LocalStream,i))}),this.phone.on("newSession",this.onNewCallSession.bind(this));try{const e=await this.deviceConfig(this.phone.type);await this.phone.register(e)}catch(e){this.log.error(e)}}async deviceConfig(e){return this.request(WEBSOCKET_DEFAULT_DEVICE_CONFIG,{name:e})}async storeFile(e,t,i){if(!t||t.length<1)throw new Error("no files");const r=new FormData;for(const e of t)r.append(e.name,e);const a=(await globalAxios.post(`${this.basePath}/api/storage/file/${e}/upload`,r,{headers:{[API_HEADER_TOKEN]:this._config.token},onUploadProgress:i})).data;for(const e of a)e.shared=this.basePath+e.shared;return a}fileUrlDownload(e){return`${this.basePath}/api/storage/file/${e}/download?access_token=${this._config.token}`}fileUrlStream(e){return`${this.basePath}/api/storage/file/${e}/stream?access_token=${this._config.token}`}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)}}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);this.queueRequest.delete(e.seq_reply),e.status===Response.STATUS_OK?t.resolve(e.data):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;default:this.log.error(`event ${e.event} not handler`)}}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.socket.close(3005)},+this.connectionInfo.ping_interval/2);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===e)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},300)}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),this.eventHandler.off("*"),1e3!==e&&(this.emit("disconnected",e),t(new Error(`close socket code: ${e}`)))}),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.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 i=Date.now();switch(e.action){case ChatActions.UserInvite:const r=e.data;(t=new Conversation(this,r.conversation_id,r.title,r.members,r.messages,r.variables)).setInvite(r.invite_id,i),this.conversationStore.set(t.id,t);break;case ChatActions.Joined:const a=e.data;(t=this.conversationById(a.member.id))&&t.setAnswered(a.member.id,i,a.member);break;case ChatActions.Message:const n=e.data;n.timestamp=i;for(const e of this.allConversations())!e.closedAt&&e.membersId.indexOf(n.channel_id)>-1&&(t=e);t&&t.newMessage(n);break;case ChatActions.Close:const s=e.data;for(const e of this.allConversations())!e.closedAt&&e.membersId.indexOf(s.from_channel_id)>-1&&(t=e);t&&t.setClosed(i);break;case ChatActions.Leave:const o=e.data;(t=this.conversationById(o.leaved_channel_id))&&t.setClosed(i);break;case ChatActions.Decline:const u=e.data;(t=this.conversationById(u.invite_id))&&t.setClosed(i)}t&&(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)}destroyConversation(e){this.conversationStore.delete(e.id),this.eventHandler.emit(WEBSOCKET_EVENT_CHAT,ChatActions.Destroy,e)}}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 i=commonjsGlobal&&commonjsGlobal.__generator||function(e,t){var i,r,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(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,r&&(a=2&n[0]?r.return:n[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,n[1])).done)return a;switch(r=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++,r=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],r=0}finally{i=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 r=function(){function e(){this[t.$listeners]={}}return e.count=function(e,i){var r=0,a=e[t.$listeners][i];if(a)for(var n=a.first;++r&&n.next;)n=n.next;return r},e.has=function(e,i){if("*"==i){for(i in e[t.$listeners])return!0;return!1}return void 0!==e[t.$listeners][i]},e.keys=function(e){return Object.keys(e[t.$listeners])},e.unhandle=function(e,i,r,a){return e.on(i,function(){for(var a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];if(!e[t.$listeners][i].first.next)return r.apply(void 0,a)},a)},e.prototype.on=function(e,i,r){return"function"==typeof i?this[t.$addListener](e,i,r):this[t.$addListener](e,void 0,i)},e.prototype.one=function(e,i,r){return"function"==typeof i?this[t.$addListener](e,i,r,!0):this[t.$addListener](e,void 0,i,!0)},e.prototype.off=function(e,i){if("*"==e){var r=this[t.$listeners];if(this[t.$listeners]={},this._onEventUnhandled)for(var a in r)this._onEventUnhandled(a);return this}if("function"==typeof i){var n=this[t.$listeners][e];if(n&&function(e,t){var i=null,r=e.first;for(;;)if(t(r))if(i){if(i.next=r.next,!r.next)break;r=r.next}else{if(!r.next)return null;e.first=r=r.next}else{if(i=r,!r.next)break;r=r.next}return e.last=i,e}(n,function(e){return e.fn==i}))return this}return delete this[t.$listeners][e],this._onEventUnhandled&&this._onEventUnhandled(e),this},e.prototype.emit=function(e){for(var t,i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];for(var a=this.listeners(e);;){var n=a.next(),s=n.value;if(n.done)return t;var o=s.apply(void 0,i);void 0!==o&&(t=o)}},e.prototype.listeners=function(e){var r,a,n;return i(this,function(i){switch(i.label){case 0:if(!(r=this[t.$listeners][e]))return[2];a=null,n=r.first,i.label=1;case 1:return[4,n.fn];case 2:if(i.sent(),n.once){if(!a)return n.next?(r.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]):(r.last=n,[2]);case 3:return[2]}})},e.prototype[t.$addListener]=function(e,i,r,n){var s=this;if(void 0===n&&(n=!1),"object"==typeof e){var o,u=function(){if("function"==typeof e[o]){var i=e[o],u=a(c[t.$listeners],o,{fn:i,once:n,next:null});r&&r.push({dispose:function(){return s.off(o,i)}}),i==u.first.fn&&c._onEventHandled&&c._onEventHandled(o)}},c=this;for(o in e)u();return this}if("function"==typeof i){var l=e,d=a(this[t.$listeners],l,{fn:i,once:n,next:null});r&&r.push({dispose:function(){return s.off(l,i)}}),i==d.first.fn&&this._onEventHandled&&this._onEventHandled(e)}return i},e.ev=t.$listeners,e}();function a(e,t,i){var r=e[t];return r?(r.last.next=i,r.last=i):e[t]=r={first:i,last:i},r}t.EventEmitter=r});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")}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 i=`${this.schema}${e}`;t&&(i+=` ${t}`);const r=document.createElement("a");r.download="File name",r.href=i,r.click()}}export{AgentPauseCauseServiceApiAxiosParamCreator,AgentPauseCauseServiceApiFp,AgentPauseCauseServiceApiFactory,AgentPauseCauseServiceApi,AgentServiceApiAxiosParamCreator,AgentServiceApiFp,AgentServiceApiFactory,AgentServiceApi,AgentSkillServiceApiAxiosParamCreator,AgentSkillServiceApiFp,AgentSkillServiceApiFactory,AgentSkillServiceApi,AgentTeamServiceApiAxiosParamCreator,AgentTeamServiceApiFp,AgentTeamServiceApiFactory,AgentTeamServiceApi,BackendProfileServiceApiAxiosParamCreator,BackendProfileServiceApiFp,BackendProfileServiceApiFactory,BackendProfileServiceApi,BucketServiceApiAxiosParamCreator,BucketServiceApiFp,BucketServiceApiFactory,BucketServiceApi,CalendarServiceApiAxiosParamCreator,CalendarServiceApiFp,CalendarServiceApiFactory,CalendarServiceApi,CallServiceApiAxiosParamCreator,CallServiceApiFp,CallServiceApiFactory,CallServiceApi,CognitiveProfileServiceApiAxiosParamCreator,CognitiveProfileServiceApiFp,CognitiveProfileServiceApiFactory,CognitiveProfileServiceApi,CommunicationTypeServiceApiAxiosParamCreator,CommunicationTypeServiceApiFp,CommunicationTypeServiceApiFactory,CommunicationTypeServiceApi,EmailProfileServiceApiAxiosParamCreator,EmailProfileServiceApiFp,EmailProfileServiceApiFactory,EmailProfileServiceApi,FileServiceApiAxiosParamCreator,FileServiceApiFp,FileServiceApiFactory,FileServiceApi,FileTranscriptServiceApiAxiosParamCreator,FileTranscriptServiceApiFp,FileTranscriptServiceApiFactory,FileTranscriptServiceApi,ImportTemplateServiceApiAxiosParamCreator,ImportTemplateServiceApiFp,ImportTemplateServiceApiFactory,ImportTemplateServiceApi,ListServiceApiAxiosParamCreator,ListServiceApiFp,ListServiceApiFactory,ListServiceApi,MediaFileServiceApiAxiosParamCreator,MediaFileServiceApiFp,MediaFileServiceApiFactory,MediaFileServiceApi,MemberServiceApiAxiosParamCreator,MemberServiceApiFp,MemberServiceApiFactory,MemberServiceApi,OutboundResourceGroupServiceApiAxiosParamCreator,OutboundResourceGroupServiceApiFp,OutboundResourceGroupServiceApiFactory,OutboundResourceGroupServiceApi,OutboundResourceServiceApiAxiosParamCreator,OutboundResourceServiceApiFp,OutboundResourceServiceApiFactory,OutboundResourceServiceApi,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,UserHelperServiceApiAxiosParamCreator,UserHelperServiceApiFp,UserHelperServiceApiFactory,UserHelperServiceApi,Configuration,ProtobufNullValue,StorageImportSourceType,StorageProviderType,StorageServiceType,StorageUploadStatusCode,JobState,Response,Client,CallReportingStatus,CallActions,CallDirection,Call,AgentStatus,ChannelState,ChannelType,Agent,ChatActions,ConversationState,Conversation,DeviceNotFoundError,DeviceNotAllowPermissionError,SipClient,ExternalClient,SipPhone,Log};
1
+ import{parse,format}from"url";import globalAxios from"axios";import{EventEmitter}from"ee-ts";import{debug,WebSocketInterface,UA}from"jssip";const BASE_PATH="https://dev.webitel.com/api".replace(/\/+$/,"");class BaseAPI{constructor(e,t=BASE_PATH,i=globalAxios){this.basePath=t,this.axios=i,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,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgentPauseCause.");const r=parse("/call_center/pause_causes",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteAgentPauseCause:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteAgentPauseCause.");const r="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},patchAgentPauseCause:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchAgentPauseCause.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readAgentPauseCause:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readAgentPauseCause.");const r="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},searchAgentPauseCause:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentPauseCause.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},AgentPauseCauseServiceApiFp=function(e){return{async createAgentPauseCause(t,i){const r=await AgentPauseCauseServiceApiAxiosParamCreator(e).createAgentPauseCause(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteAgentPauseCause(t,i){const r=await AgentPauseCauseServiceApiAxiosParamCreator(e).deleteAgentPauseCause(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async patchAgentPauseCause(t,i,r){const a=await AgentPauseCauseServiceApiAxiosParamCreator(e).patchAgentPauseCause(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readAgentPauseCause(t,i){const r=await AgentPauseCauseServiceApiAxiosParamCreator(e).readAgentPauseCause(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async searchAgentPauseCause(t,i,r,a,n,s,o){const u=await AgentPauseCauseServiceApiAxiosParamCreator(e).searchAgentPauseCause(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async updateAgentPauseCause(t,i,r){const a=await AgentPauseCauseServiceApiAxiosParamCreator(e).updateAgentPauseCause(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},AgentPauseCauseServiceApiFactory=function(e,t,i){return{createAgentPauseCause:(r,a)=>AgentPauseCauseServiceApiFp(e).createAgentPauseCause(r,a).then(e=>e(i,t)),deleteAgentPauseCause:(r,a)=>AgentPauseCauseServiceApiFp(e).deleteAgentPauseCause(r,a).then(e=>e(i,t)),patchAgentPauseCause:(r,a,n)=>AgentPauseCauseServiceApiFp(e).patchAgentPauseCause(r,a,n).then(e=>e(i,t)),readAgentPauseCause:(r,a)=>AgentPauseCauseServiceApiFp(e).readAgentPauseCause(r,a).then(e=>e(i,t)),searchAgentPauseCause:(r,a,n,s,o,u,c)=>AgentPauseCauseServiceApiFp(e).searchAgentPauseCause(r,a,n,s,o,u,c).then(e=>e(i,t)),updateAgentPauseCause:(r,a,n)=>AgentPauseCauseServiceApiFp(e).updateAgentPauseCause(r,a,n).then(e=>e(i,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,i){return AgentPauseCauseServiceApiFp(this.configuration).patchAgentPauseCause(e,t,i).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,i,r,a,n,s){return AgentPauseCauseServiceApiFp(this.configuration).searchAgentPauseCause(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}updateAgentPauseCause(e,t,i){return AgentPauseCauseServiceApiFp(this.configuration).updateAgentPauseCause(e,t,i).then(e=>e(this.axios,this.basePath))}}const AgentServiceApiAxiosParamCreator=function(e){return{agentSetState:async(t,i,r={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentSetState.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},agentStateHistory:async(t,i,r,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!==i&&(y.page=i),void 0!==r&&(y.size=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...u.headers},{url:format(l),options:p}},agentTodayStatistics:async(t,i,r={})=>{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,...r},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}i&&(c.fields=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},createAgent:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgent.");const r=parse("/call_center/agents",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteAgent:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},patchAgent:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchAgent.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readAgent:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchAgent:async(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b={})=>{const S=parse("/call_center/agents",!0);let w;e&&(w=e.baseOptions);const v={method:"GET",...w,...b},q={},C={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;q["X-Webitel-Access"]=t}void 0!==t&&(C.page=t),void 0!==i&&(C.size=i),void 0!==r&&(C.q=r),void 0!==a&&(C.sort=a),n&&(C.fields=n),s&&(C.id=s),o&&(C.allow_channels=o),u&&(C.supervisor_id=u),c&&(C.team_id=c),l&&(C.region_id=l),d&&(C.auditor_id=d),void 0!==p&&(C.is_supervisor=p),h&&(C.skill_id=h),y&&(C.queue_id=y),void 0!==A&&(C.not_supervisor=A),g&&(C.user_id=g),m&&(C.extension=m),f&&(C.not_team_id=f),S.query={...S.query,...C,...b.query},delete S.search;let R=w&&w.headers?w.headers:{};return v.headers={...q,...R,...b.headers},{url:format(S),options:v}},searchAgentCallStatistics:async(t,i,r,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={},A={};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&&(A.page=t),void 0!==i&&(A.size=i),void 0!==r&&(A["time.from"]=r),void 0!==a&&(A["time.to"]=a),n&&(A.agent_id=n),void 0!==s&&(A.domain_id=s),void 0!==o&&(A.q=o),u&&(A.fields=u),void 0!==c&&(A.sort=c),d.query={...d.query,...A,...l.query},delete d.search;let g=p&&p.headers?p.headers:{};return h.headers={...y,...g,...l.headers},{url:format(d),options:h}},searchAgentInQueue:async(t,i,r,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!==i&&(h.page=i),void 0!==r&&(h.size=r),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,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchAgentInTeam:async(t,i,r,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!==i&&(p.page=i),void 0!==r&&(p.size=r),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,i,r,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!==i&&(y.size=i),void 0!==r&&(y["joined_at.from"]=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...c.headers},{url:format(l),options:p}},searchAgentStatusStatistic:async(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b={})=>{const S=parse("/call_center/agents/reports/status",!0);let w;e&&(w=e.baseOptions);const v={method:"GET",...w,...b},q={},C={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;q["X-Webitel-Access"]=t}void 0!==t&&(C.page=t),void 0!==i&&(C.size=i),void 0!==r&&(C.q=r),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),A&&(C.skill_id=A),g&&(C.region_id=g),m&&(C.supervisor_id=m),f&&(C.auditor_id=f),S.query={...S.query,...C,...b.query},delete S.search;let R=w&&w.headers?w.headers:{};return v.headers={...q,...R,...b.headers},{url:format(S),options:v}},searchAgentStatusStatisticItem:async(t,i,r,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!==i&&(l["time.from"]=i),void 0!==r&&(l["time.to"]=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}},searchLookupUsersAgentNotExists:async(t,i,r,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!==i&&(l.size=i),void 0!==r&&(l.q=r),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,i,r={})=>{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,...r},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!==i&&(c.allow_change=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},updateAgent:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgent.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},updateAgentStatus:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentStatus.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},AgentServiceApiFp=function(e){return{async agentSetState(t,i,r){const a=await AgentServiceApiAxiosParamCreator(e).agentSetState(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async agentStateHistory(t,i,r,a,n,s,o,u){const c=await AgentServiceApiAxiosParamCreator(e).agentStateHistory(t,i,r,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const i={...c.options,url:t+c.url};return e.request(i)}},async agentTodayStatistics(t,i,r){const a=await AgentServiceApiAxiosParamCreator(e).agentTodayStatistics(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async createAgent(t,i){const r=await AgentServiceApiAxiosParamCreator(e).createAgent(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteAgent(t,i,r){const a=await AgentServiceApiAxiosParamCreator(e).deleteAgent(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async patchAgent(t,i,r){const a=await AgentServiceApiAxiosParamCreator(e).patchAgent(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readAgent(t,i,r){const a=await AgentServiceApiAxiosParamCreator(e).readAgent(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchAgent(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b){const S=await AgentServiceApiAxiosParamCreator(e).searchAgent(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b);return(e=globalAxios,t=BASE_PATH)=>{const i={...S.options,url:t+S.url};return e.request(i)}},async searchAgentCallStatistics(t,i,r,a,n,s,o,u,c,l){const d=await AgentServiceApiAxiosParamCreator(e).searchAgentCallStatistics(t,i,r,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const i={...d.options,url:t+d.url};return e.request(i)}},async searchAgentInQueue(t,i,r,a,n,s,o){const u=await AgentServiceApiAxiosParamCreator(e).searchAgentInQueue(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async searchAgentInQueueStatistics(t,i,r){const a=await AgentServiceApiAxiosParamCreator(e).searchAgentInQueueStatistics(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchAgentInTeam(t,i,r,a,n,s){const o=await AgentServiceApiAxiosParamCreator(e).searchAgentInTeam(t,i,r,a,n,s);return(e=globalAxios,t=BASE_PATH)=>{const i={...o.options,url:t+o.url};return e.request(i)}},async searchAgentStateHistory(t,i,r,a,n,s,o,u,c){const l=await AgentServiceApiAxiosParamCreator(e).searchAgentStateHistory(t,i,r,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const i={...l.options,url:t+l.url};return e.request(i)}},async searchAgentStatusStatistic(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b){const S=await AgentServiceApiAxiosParamCreator(e).searchAgentStatusStatistic(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b);return(e=globalAxios,t=BASE_PATH)=>{const i={...S.options,url:t+S.url};return e.request(i)}},async searchAgentStatusStatisticItem(t,i,r,a){const n=await AgentServiceApiAxiosParamCreator(e).searchAgentStatusStatisticItem(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async searchLookupUsersAgentNotExists(t,i,r,a,n){const s=await AgentServiceApiAxiosParamCreator(e).searchLookupUsersAgentNotExists(t,i,r,a,n);return(e=globalAxios,t=BASE_PATH)=>{const i={...s.options,url:t+s.url};return e.request(i)}},async searchPauseCauseForAgent(t,i,r){const a=await AgentServiceApiAxiosParamCreator(e).searchPauseCauseForAgent(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async updateAgent(t,i,r){const a=await AgentServiceApiAxiosParamCreator(e).updateAgent(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async updateAgentStatus(t,i,r){const a=await AgentServiceApiAxiosParamCreator(e).updateAgentStatus(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},AgentServiceApiFactory=function(e,t,i){return{agentSetState:(r,a,n)=>AgentServiceApiFp(e).agentSetState(r,a,n).then(e=>e(i,t)),agentStateHistory:(r,a,n,s,o,u,c,l)=>AgentServiceApiFp(e).agentStateHistory(r,a,n,s,o,u,c,l).then(e=>e(i,t)),agentTodayStatistics:(r,a,n)=>AgentServiceApiFp(e).agentTodayStatistics(r,a,n).then(e=>e(i,t)),createAgent:(r,a)=>AgentServiceApiFp(e).createAgent(r,a).then(e=>e(i,t)),deleteAgent:(r,a,n)=>AgentServiceApiFp(e).deleteAgent(r,a,n).then(e=>e(i,t)),patchAgent:(r,a,n)=>AgentServiceApiFp(e).patchAgent(r,a,n).then(e=>e(i,t)),readAgent:(r,a,n)=>AgentServiceApiFp(e).readAgent(r,a,n).then(e=>e(i,t)),searchAgent:(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w)=>AgentServiceApiFp(e).searchAgent(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w).then(e=>e(i,t)),searchAgentCallStatistics:(r,a,n,s,o,u,c,l,d,p)=>AgentServiceApiFp(e).searchAgentCallStatistics(r,a,n,s,o,u,c,l,d,p).then(e=>e(i,t)),searchAgentInQueue:(r,a,n,s,o,u,c)=>AgentServiceApiFp(e).searchAgentInQueue(r,a,n,s,o,u,c).then(e=>e(i,t)),searchAgentInQueueStatistics:(r,a,n)=>AgentServiceApiFp(e).searchAgentInQueueStatistics(r,a,n).then(e=>e(i,t)),searchAgentInTeam:(r,a,n,s,o,u)=>AgentServiceApiFp(e).searchAgentInTeam(r,a,n,s,o,u).then(e=>e(i,t)),searchAgentStateHistory:(r,a,n,s,o,u,c,l,d)=>AgentServiceApiFp(e).searchAgentStateHistory(r,a,n,s,o,u,c,l,d).then(e=>e(i,t)),searchAgentStatusStatistic:(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w)=>AgentServiceApiFp(e).searchAgentStatusStatistic(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w).then(e=>e(i,t)),searchAgentStatusStatisticItem:(r,a,n,s)=>AgentServiceApiFp(e).searchAgentStatusStatisticItem(r,a,n,s).then(e=>e(i,t)),searchLookupUsersAgentNotExists:(r,a,n,s,o)=>AgentServiceApiFp(e).searchLookupUsersAgentNotExists(r,a,n,s,o).then(e=>e(i,t)),searchPauseCauseForAgent:(r,a,n)=>AgentServiceApiFp(e).searchPauseCauseForAgent(r,a,n).then(e=>e(i,t)),updateAgent:(r,a,n)=>AgentServiceApiFp(e).updateAgent(r,a,n).then(e=>e(i,t)),updateAgentStatus:(r,a,n)=>AgentServiceApiFp(e).updateAgentStatus(r,a,n).then(e=>e(i,t))}};class AgentServiceApi extends BaseAPI{agentSetState(e,t,i){return AgentServiceApiFp(this.configuration).agentSetState(e,t,i).then(e=>e(this.axios,this.basePath))}agentStateHistory(e,t,i,r,a,n,s,o){return AgentServiceApiFp(this.configuration).agentStateHistory(e,t,i,r,a,n,s,o).then(e=>e(this.axios,this.basePath))}agentTodayStatistics(e,t,i){return AgentServiceApiFp(this.configuration).agentTodayStatistics(e,t,i).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,i){return AgentServiceApiFp(this.configuration).deleteAgent(e,t,i).then(e=>e(this.axios,this.basePath))}patchAgent(e,t,i){return AgentServiceApiFp(this.configuration).patchAgent(e,t,i).then(e=>e(this.axios,this.basePath))}readAgent(e,t,i){return AgentServiceApiFp(this.configuration).readAgent(e,t,i).then(e=>e(this.axios,this.basePath))}searchAgent(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f){return AgentServiceApiFp(this.configuration).searchAgent(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f).then(e=>e(this.axios,this.basePath))}searchAgentCallStatistics(e,t,i,r,a,n,s,o,u,c){return AgentServiceApiFp(this.configuration).searchAgentCallStatistics(e,t,i,r,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}searchAgentInQueue(e,t,i,r,a,n,s){return AgentServiceApiFp(this.configuration).searchAgentInQueue(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}searchAgentInQueueStatistics(e,t,i){return AgentServiceApiFp(this.configuration).searchAgentInQueueStatistics(e,t,i).then(e=>e(this.axios,this.basePath))}searchAgentInTeam(e,t,i,r,a,n){return AgentServiceApiFp(this.configuration).searchAgentInTeam(e,t,i,r,a,n).then(e=>e(this.axios,this.basePath))}searchAgentStateHistory(e,t,i,r,a,n,s,o,u){return AgentServiceApiFp(this.configuration).searchAgentStateHistory(e,t,i,r,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}searchAgentStatusStatistic(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f){return AgentServiceApiFp(this.configuration).searchAgentStatusStatistic(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f).then(e=>e(this.axios,this.basePath))}searchAgentStatusStatisticItem(e,t,i,r){return AgentServiceApiFp(this.configuration).searchAgentStatusStatisticItem(e,t,i,r).then(e=>e(this.axios,this.basePath))}searchLookupUsersAgentNotExists(e,t,i,r,a){return AgentServiceApiFp(this.configuration).searchLookupUsersAgentNotExists(e,t,i,r,a).then(e=>e(this.axios,this.basePath))}searchPauseCauseForAgent(e,t,i){return AgentServiceApiFp(this.configuration).searchPauseCauseForAgent(e,t,i).then(e=>e(this.axios,this.basePath))}updateAgent(e,t,i){return AgentServiceApiFp(this.configuration).updateAgent(e,t,i).then(e=>e(this.axios,this.basePath))}updateAgentStatus(e,t,i){return AgentServiceApiFp(this.configuration).updateAgentStatus(e,t,i).then(e=>e(this.axios,this.basePath))}}const AgentSkillServiceApiAxiosParamCreator=function(e){return{createAgentSkill:async(t,i,r={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling createAgentSkill.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteAgentSkill:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling deleteAgentSkill.");if(null==i)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(i))),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!==r&&(l.domain_id=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}},patchAgentSkill:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling patchAgentSkill.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling patchAgentSkill.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},readAgentSkill:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling readAgentSkill.");if(null==i)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(i))),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.domain_id=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}},searchAgentSkill:async(t,i,r,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling searchAgentSkill.");const c="/call_center/agents/{agent_id}/skills".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!==i&&(y.page=i),void 0!==r&&(y.size=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...u.headers},{url:format(l),options:p}},searchLookupAgentNotExistsSkill:async(t,i,r,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!==i&&(p.page=i),void 0!==r&&(p.size=r),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,i,r,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling updateAgentSkill.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentSkill.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},AgentSkillServiceApiFp=function(e){return{async createAgentSkill(t,i,r){const a=await AgentSkillServiceApiAxiosParamCreator(e).createAgentSkill(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteAgentSkill(t,i,r,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).deleteAgentSkill(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async patchAgentSkill(t,i,r,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).patchAgentSkill(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async readAgentSkill(t,i,r,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).readAgentSkill(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async searchAgentSkill(t,i,r,a,n,s,o,u){const c=await AgentSkillServiceApiAxiosParamCreator(e).searchAgentSkill(t,i,r,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const i={...c.options,url:t+c.url};return e.request(i)}},async searchLookupAgentNotExistsSkill(t,i,r,a,n,s){const o=await AgentSkillServiceApiAxiosParamCreator(e).searchLookupAgentNotExistsSkill(t,i,r,a,n,s);return(e=globalAxios,t=BASE_PATH)=>{const i={...o.options,url:t+o.url};return e.request(i)}},async updateAgentSkill(t,i,r,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).updateAgentSkill(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},AgentSkillServiceApiFactory=function(e,t,i){return{createAgentSkill:(r,a,n)=>AgentSkillServiceApiFp(e).createAgentSkill(r,a,n).then(e=>e(i,t)),deleteAgentSkill:(r,a,n,s)=>AgentSkillServiceApiFp(e).deleteAgentSkill(r,a,n,s).then(e=>e(i,t)),patchAgentSkill:(r,a,n,s)=>AgentSkillServiceApiFp(e).patchAgentSkill(r,a,n,s).then(e=>e(i,t)),readAgentSkill:(r,a,n,s)=>AgentSkillServiceApiFp(e).readAgentSkill(r,a,n,s).then(e=>e(i,t)),searchAgentSkill:(r,a,n,s,o,u,c,l)=>AgentSkillServiceApiFp(e).searchAgentSkill(r,a,n,s,o,u,c,l).then(e=>e(i,t)),searchLookupAgentNotExistsSkill:(r,a,n,s,o,u)=>AgentSkillServiceApiFp(e).searchLookupAgentNotExistsSkill(r,a,n,s,o,u).then(e=>e(i,t)),updateAgentSkill:(r,a,n,s)=>AgentSkillServiceApiFp(e).updateAgentSkill(r,a,n,s).then(e=>e(i,t))}};class AgentSkillServiceApi extends BaseAPI{createAgentSkill(e,t,i){return AgentSkillServiceApiFp(this.configuration).createAgentSkill(e,t,i).then(e=>e(this.axios,this.basePath))}deleteAgentSkill(e,t,i,r){return AgentSkillServiceApiFp(this.configuration).deleteAgentSkill(e,t,i,r).then(e=>e(this.axios,this.basePath))}patchAgentSkill(e,t,i,r){return AgentSkillServiceApiFp(this.configuration).patchAgentSkill(e,t,i,r).then(e=>e(this.axios,this.basePath))}readAgentSkill(e,t,i,r){return AgentSkillServiceApiFp(this.configuration).readAgentSkill(e,t,i,r).then(e=>e(this.axios,this.basePath))}searchAgentSkill(e,t,i,r,a,n,s,o){return AgentSkillServiceApiFp(this.configuration).searchAgentSkill(e,t,i,r,a,n,s,o).then(e=>e(this.axios,this.basePath))}searchLookupAgentNotExistsSkill(e,t,i,r,a,n){return AgentSkillServiceApiFp(this.configuration).searchLookupAgentNotExistsSkill(e,t,i,r,a,n).then(e=>e(this.axios,this.basePath))}updateAgentSkill(e,t,i,r){return AgentSkillServiceApiFp(this.configuration).updateAgentSkill(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const AgentTeamServiceApiAxiosParamCreator=function(e){return{createAgentTeam:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgentTeam.");const r=parse("/call_center/teams",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteAgentTeam:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readAgentTeam:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchAgentTeam:async(t,i,r,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!==i&&(y.size=i),void 0!==r&&(y.q=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...c.headers},{url:format(l),options:p}},updateAgentTeam:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentTeam.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},AgentTeamServiceApiFp=function(e){return{async createAgentTeam(t,i){const r=await AgentTeamServiceApiAxiosParamCreator(e).createAgentTeam(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteAgentTeam(t,i,r){const a=await AgentTeamServiceApiAxiosParamCreator(e).deleteAgentTeam(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readAgentTeam(t,i,r){const a=await AgentTeamServiceApiAxiosParamCreator(e).readAgentTeam(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchAgentTeam(t,i,r,a,n,s,o,u,c){const l=await AgentTeamServiceApiAxiosParamCreator(e).searchAgentTeam(t,i,r,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const i={...l.options,url:t+l.url};return e.request(i)}},async updateAgentTeam(t,i,r){const a=await AgentTeamServiceApiAxiosParamCreator(e).updateAgentTeam(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},AgentTeamServiceApiFactory=function(e,t,i){return{createAgentTeam:(r,a)=>AgentTeamServiceApiFp(e).createAgentTeam(r,a).then(e=>e(i,t)),deleteAgentTeam:(r,a,n)=>AgentTeamServiceApiFp(e).deleteAgentTeam(r,a,n).then(e=>e(i,t)),readAgentTeam:(r,a,n)=>AgentTeamServiceApiFp(e).readAgentTeam(r,a,n).then(e=>e(i,t)),searchAgentTeam:(r,a,n,s,o,u,c,l,d)=>AgentTeamServiceApiFp(e).searchAgentTeam(r,a,n,s,o,u,c,l,d).then(e=>e(i,t)),updateAgentTeam:(r,a,n)=>AgentTeamServiceApiFp(e).updateAgentTeam(r,a,n).then(e=>e(i,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,i){return AgentTeamServiceApiFp(this.configuration).deleteAgentTeam(e,t,i).then(e=>e(this.axios,this.basePath))}readAgentTeam(e,t,i){return AgentTeamServiceApiFp(this.configuration).readAgentTeam(e,t,i).then(e=>e(this.axios,this.basePath))}searchAgentTeam(e,t,i,r,a,n,s,o,u){return AgentTeamServiceApiFp(this.configuration).searchAgentTeam(e,t,i,r,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateAgentTeam(e,t,i){return AgentTeamServiceApiFp(this.configuration).updateAgentTeam(e,t,i).then(e=>e(this.axios,this.basePath))}}const BackendProfileServiceApiAxiosParamCreator=function(e){return{createBackendProfile:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createBackendProfile.");const r=parse("/storage/backend_profiles",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteBackendProfile:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},patchBackendProfile:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchBackendProfile.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readBackendProfile:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchBackendProfile:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateBackendProfile.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},BackendProfileServiceApiFp=function(e){return{async createBackendProfile(t,i){const r=await BackendProfileServiceApiAxiosParamCreator(e).createBackendProfile(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteBackendProfile(t,i,r){const a=await BackendProfileServiceApiAxiosParamCreator(e).deleteBackendProfile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async patchBackendProfile(t,i,r){const a=await BackendProfileServiceApiAxiosParamCreator(e).patchBackendProfile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readBackendProfile(t,i,r){const a=await BackendProfileServiceApiAxiosParamCreator(e).readBackendProfile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchBackendProfile(t,i,r,a,n,s,o){const u=await BackendProfileServiceApiAxiosParamCreator(e).searchBackendProfile(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async updateBackendProfile(t,i,r){const a=await BackendProfileServiceApiAxiosParamCreator(e).updateBackendProfile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},BackendProfileServiceApiFactory=function(e,t,i){return{createBackendProfile:(r,a)=>BackendProfileServiceApiFp(e).createBackendProfile(r,a).then(e=>e(i,t)),deleteBackendProfile:(r,a,n)=>BackendProfileServiceApiFp(e).deleteBackendProfile(r,a,n).then(e=>e(i,t)),patchBackendProfile:(r,a,n)=>BackendProfileServiceApiFp(e).patchBackendProfile(r,a,n).then(e=>e(i,t)),readBackendProfile:(r,a,n)=>BackendProfileServiceApiFp(e).readBackendProfile(r,a,n).then(e=>e(i,t)),searchBackendProfile:(r,a,n,s,o,u,c)=>BackendProfileServiceApiFp(e).searchBackendProfile(r,a,n,s,o,u,c).then(e=>e(i,t)),updateBackendProfile:(r,a,n)=>BackendProfileServiceApiFp(e).updateBackendProfile(r,a,n).then(e=>e(i,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,i){return BackendProfileServiceApiFp(this.configuration).deleteBackendProfile(e,t,i).then(e=>e(this.axios,this.basePath))}patchBackendProfile(e,t,i){return BackendProfileServiceApiFp(this.configuration).patchBackendProfile(e,t,i).then(e=>e(this.axios,this.basePath))}readBackendProfile(e,t,i){return BackendProfileServiceApiFp(this.configuration).readBackendProfile(e,t,i).then(e=>e(this.axios,this.basePath))}searchBackendProfile(e,t,i,r,a,n,s){return BackendProfileServiceApiFp(this.configuration).searchBackendProfile(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}updateBackendProfile(e,t,i){return BackendProfileServiceApiFp(this.configuration).updateBackendProfile(e,t,i).then(e=>e(this.axios,this.basePath))}}const BucketServiceApiAxiosParamCreator=function(e){return{createBucket:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createBucket.");const r=parse("/call_center/buckets",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteBucket:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readBucket:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchBucket:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateBucket.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},BucketServiceApiFp=function(e){return{async createBucket(t,i){const r=await BucketServiceApiAxiosParamCreator(e).createBucket(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteBucket(t,i,r){const a=await BucketServiceApiAxiosParamCreator(e).deleteBucket(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readBucket(t,i,r){const a=await BucketServiceApiAxiosParamCreator(e).readBucket(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchBucket(t,i,r,a,n,s,o){const u=await BucketServiceApiAxiosParamCreator(e).searchBucket(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async updateBucket(t,i,r){const a=await BucketServiceApiAxiosParamCreator(e).updateBucket(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},BucketServiceApiFactory=function(e,t,i){return{createBucket:(r,a)=>BucketServiceApiFp(e).createBucket(r,a).then(e=>e(i,t)),deleteBucket:(r,a,n)=>BucketServiceApiFp(e).deleteBucket(r,a,n).then(e=>e(i,t)),readBucket:(r,a,n)=>BucketServiceApiFp(e).readBucket(r,a,n).then(e=>e(i,t)),searchBucket:(r,a,n,s,o,u,c)=>BucketServiceApiFp(e).searchBucket(r,a,n,s,o,u,c).then(e=>e(i,t)),updateBucket:(r,a,n)=>BucketServiceApiFp(e).updateBucket(r,a,n).then(e=>e(i,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,i){return BucketServiceApiFp(this.configuration).deleteBucket(e,t,i).then(e=>e(this.axios,this.basePath))}readBucket(e,t,i){return BucketServiceApiFp(this.configuration).readBucket(e,t,i).then(e=>e(this.axios,this.basePath))}searchBucket(e,t,i,r,a,n,s){return BucketServiceApiFp(this.configuration).searchBucket(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}updateBucket(e,t,i){return BucketServiceApiFp(this.configuration).updateBucket(e,t,i).then(e=>e(this.axios,this.basePath))}}const CalendarServiceApiAxiosParamCreator=function(e){return{createCalendar:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCalendar.");const r=parse("/calendars",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteCalendar:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readCalendar:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchCalendar:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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,i,r,a={})=>{const n=parse("/calendars/timezones",!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!==i&&(c.size=i),void 0!==r&&(c.q=r),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}},updateCalendar:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCalendar.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},CalendarServiceApiFp=function(e){return{async createCalendar(t,i){const r=await CalendarServiceApiAxiosParamCreator(e).createCalendar(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteCalendar(t,i,r){const a=await CalendarServiceApiAxiosParamCreator(e).deleteCalendar(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readCalendar(t,i,r){const a=await CalendarServiceApiAxiosParamCreator(e).readCalendar(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchCalendar(t,i,r,a,n,s,o){const u=await CalendarServiceApiAxiosParamCreator(e).searchCalendar(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async searchTimezones(t,i,r,a){const n=await CalendarServiceApiAxiosParamCreator(e).searchTimezones(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async updateCalendar(t,i,r){const a=await CalendarServiceApiAxiosParamCreator(e).updateCalendar(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},CalendarServiceApiFactory=function(e,t,i){return{createCalendar:(r,a)=>CalendarServiceApiFp(e).createCalendar(r,a).then(e=>e(i,t)),deleteCalendar:(r,a,n)=>CalendarServiceApiFp(e).deleteCalendar(r,a,n).then(e=>e(i,t)),readCalendar:(r,a,n)=>CalendarServiceApiFp(e).readCalendar(r,a,n).then(e=>e(i,t)),searchCalendar:(r,a,n,s,o,u,c)=>CalendarServiceApiFp(e).searchCalendar(r,a,n,s,o,u,c).then(e=>e(i,t)),searchTimezones:(r,a,n,s)=>CalendarServiceApiFp(e).searchTimezones(r,a,n,s).then(e=>e(i,t)),updateCalendar:(r,a,n)=>CalendarServiceApiFp(e).updateCalendar(r,a,n).then(e=>e(i,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,i){return CalendarServiceApiFp(this.configuration).deleteCalendar(e,t,i).then(e=>e(this.axios,this.basePath))}readCalendar(e,t,i){return CalendarServiceApiFp(this.configuration).readCalendar(e,t,i).then(e=>e(this.axios,this.basePath))}searchCalendar(e,t,i,r,a,n,s){return CalendarServiceApiFp(this.configuration).searchCalendar(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}searchTimezones(e,t,i,r){return CalendarServiceApiFp(this.configuration).searchTimezones(e,t,i,r).then(e=>e(this.axios,this.basePath))}updateCalendar(e,t,i){return CalendarServiceApiFp(this.configuration).updateCalendar(e,t,i).then(e=>e(this.axios,this.basePath))}}const CallServiceApiAxiosParamCreator=function(e){return{aggregateHistoryCall:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling aggregateHistoryCall.");const r=parse("/calls/history/aggregate",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},blindTransferCall:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling blindTransferCall.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},confirmPush:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling confirmPush.");const r="/calls/active/{id}/confirm_push".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"PATCH",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},createCall:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCall.");const r=parse("/calls",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},createCallAnnotation:async(t,i,r={})=>{if(null==t)throw new RequiredError("callId","Required parameter callId was null or undefined when calling createCallAnnotation.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteCallAnnotation:async(t,i,r={})=>{if(null==t)throw new RequiredError("callId","Required parameter callId was null or undefined when calling deleteCallAnnotation.");if(null==i)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(i))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...r.headers},{url:format(n),options:o}},dtmfCall:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling dtmfCall.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},eavesdropCall:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling eavesdropCall.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},hangupCall:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling hangupCall.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},holdCall:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling holdCall.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readCall:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchActiveCall:async(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K={})=>{const k=parse("/calls/active",!0);let x;e&&(x=e.baseOptions);const O={method:"GET",...x,...K},I={},F={};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&&(F.page=t),void 0!==i&&(F.size=i),void 0!==r&&(F.q=r),void 0!==a&&(F.sort=a),n&&(F.fields=n),void 0!==s&&(F["created_at.from"]=s),void 0!==o&&(F["created_at.to"]=o),u&&(F.user_id=u),c&&(F.agent_id=c),l&&(F.queue_id=l),d&&(F.team_id=d),p&&(F.member_id=p),h&&(F.gateway_id=h),void 0!==y&&(F["duration.from"]=y),void 0!==A&&(F["duration.to"]=A),void 0!==g&&(F.skip_parent=g),void 0!==m&&(F.parent_id=m),f&&(F.cause=f),void 0!==b&&(F.exists_file=b),void 0!==S&&(F.domain_id=S),void 0!==w&&(F.number=w),v&&(F.direction=v),void 0!==q&&(F["answered_at.from"]=q),void 0!==C&&(F["answered_at.to"]=C),void 0!==R&&(F.missed=R),void 0!==P&&(F["stored_at.from"]=P),void 0!==_&&(F["stored_at.to"]=_),T&&(F.supervisor_id=T),E&&(F.state=E),k.query={...k.query,...F,...K.query},delete k.search;let B=x&&x.headers?x.headers:{};return O.headers={...I,...B,...K.headers},{url:format(k),options:O}},searchHistoryCall:async(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K,k,x,O,I,F,B={})=>{const W=parse("/calls/history",!0);let H;e&&(H=e.baseOptions);const X={method:"GET",...H,...B},Q={},U={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;Q["X-Webitel-Access"]=t}void 0!==t&&(U.page=t),void 0!==i&&(U.size=i),void 0!==r&&(U.q=r),void 0!==a&&(U.sort=a),n&&(U.fields=n),void 0!==s&&(U["created_at.from"]=s),void 0!==o&&(U["created_at.to"]=o),u&&(U.user_id=u),c&&(U.agent_id=c),l&&(U.queue_id=l),d&&(U.team_id=d),p&&(U.member_id=p),h&&(U.gateway_id=h),void 0!==y&&(U["duration.from"]=y),void 0!==A&&(U["duration.to"]=A),void 0!==g&&(U.skip_parent=g),void 0!==m&&(U.parent_id=m),f&&(U.cause=f),void 0!==b&&(U.has_file=b),void 0!==S&&(U.domain_id=S),void 0!==w&&(U.number=w),void 0!==v&&(U.direction=v),void 0!==q&&(U["answered_at.from"]=q),void 0!==C&&(U["answered_at.to"]=C),void 0!==R&&(U.missed=R),void 0!==P&&(U["stored_at.from"]=P),void 0!==_&&(U["stored_at.to"]=_),T&&(U.id=T),E&&(U.transfer_from=E),K&&(U.transfer_to=K),k&&(U.dependency_id=k),x&&(U.tags=x),O&&(U.amd_result=O),void 0!==I&&(U.fts=I),F&&(U.directions=F),W.query={...W.query,...U,...B.query},delete W.search;let G=H&&H.headers?H.headers:{};return X.headers={...Q,...G,...B.headers},{url:format(W),options:X}},unHoldCall:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling unHoldCall.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},updateCallAnnotation:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("callId","Required parameter callId was null or undefined when calling updateCallAnnotation.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCallAnnotation.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},CallServiceApiFp=function(e){return{async aggregateHistoryCall(t,i){const r=await CallServiceApiAxiosParamCreator(e).aggregateHistoryCall(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async blindTransferCall(t,i,r){const a=await CallServiceApiAxiosParamCreator(e).blindTransferCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async confirmPush(t,i){const r=await CallServiceApiAxiosParamCreator(e).confirmPush(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async createCall(t,i){const r=await CallServiceApiAxiosParamCreator(e).createCall(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async createCallAnnotation(t,i,r){const a=await CallServiceApiAxiosParamCreator(e).createCallAnnotation(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteCallAnnotation(t,i,r){const a=await CallServiceApiAxiosParamCreator(e).deleteCallAnnotation(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async dtmfCall(t,i,r){const a=await CallServiceApiAxiosParamCreator(e).dtmfCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async eavesdropCall(t,i,r){const a=await CallServiceApiAxiosParamCreator(e).eavesdropCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async hangupCall(t,i,r){const a=await CallServiceApiAxiosParamCreator(e).hangupCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async holdCall(t,i,r){const a=await CallServiceApiAxiosParamCreator(e).holdCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readCall(t,i,r){const a=await CallServiceApiAxiosParamCreator(e).readCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchActiveCall(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K){const k=await CallServiceApiAxiosParamCreator(e).searchActiveCall(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K);return(e=globalAxios,t=BASE_PATH)=>{const i={...k.options,url:t+k.url};return e.request(i)}},async searchHistoryCall(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K,k,x,O,I,F,B){const W=await CallServiceApiAxiosParamCreator(e).searchHistoryCall(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K,k,x,O,I,F,B);return(e=globalAxios,t=BASE_PATH)=>{const i={...W.options,url:t+W.url};return e.request(i)}},async unHoldCall(t,i,r){const a=await CallServiceApiAxiosParamCreator(e).unHoldCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async updateCallAnnotation(t,i,r,a){const n=await CallServiceApiAxiosParamCreator(e).updateCallAnnotation(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},CallServiceApiFactory=function(e,t,i){return{aggregateHistoryCall:(r,a)=>CallServiceApiFp(e).aggregateHistoryCall(r,a).then(e=>e(i,t)),blindTransferCall:(r,a,n)=>CallServiceApiFp(e).blindTransferCall(r,a,n).then(e=>e(i,t)),confirmPush:(r,a)=>CallServiceApiFp(e).confirmPush(r,a).then(e=>e(i,t)),createCall:(r,a)=>CallServiceApiFp(e).createCall(r,a).then(e=>e(i,t)),createCallAnnotation:(r,a,n)=>CallServiceApiFp(e).createCallAnnotation(r,a,n).then(e=>e(i,t)),deleteCallAnnotation:(r,a,n)=>CallServiceApiFp(e).deleteCallAnnotation(r,a,n).then(e=>e(i,t)),dtmfCall:(r,a,n)=>CallServiceApiFp(e).dtmfCall(r,a,n).then(e=>e(i,t)),eavesdropCall:(r,a,n)=>CallServiceApiFp(e).eavesdropCall(r,a,n).then(e=>e(i,t)),hangupCall:(r,a,n)=>CallServiceApiFp(e).hangupCall(r,a,n).then(e=>e(i,t)),holdCall:(r,a,n)=>CallServiceApiFp(e).holdCall(r,a,n).then(e=>e(i,t)),readCall:(r,a,n)=>CallServiceApiFp(e).readCall(r,a,n).then(e=>e(i,t)),searchActiveCall:(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K,k,x)=>CallServiceApiFp(e).searchActiveCall(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K,k,x).then(e=>e(i,t)),searchHistoryCall:(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K,k,x,O,I,F,B,W,H)=>CallServiceApiFp(e).searchHistoryCall(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K,k,x,O,I,F,B,W,H).then(e=>e(i,t)),unHoldCall:(r,a,n)=>CallServiceApiFp(e).unHoldCall(r,a,n).then(e=>e(i,t)),updateCallAnnotation:(r,a,n,s)=>CallServiceApiFp(e).updateCallAnnotation(r,a,n,s).then(e=>e(i,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,i){return CallServiceApiFp(this.configuration).blindTransferCall(e,t,i).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,i){return CallServiceApiFp(this.configuration).createCallAnnotation(e,t,i).then(e=>e(this.axios,this.basePath))}deleteCallAnnotation(e,t,i){return CallServiceApiFp(this.configuration).deleteCallAnnotation(e,t,i).then(e=>e(this.axios,this.basePath))}dtmfCall(e,t,i){return CallServiceApiFp(this.configuration).dtmfCall(e,t,i).then(e=>e(this.axios,this.basePath))}eavesdropCall(e,t,i){return CallServiceApiFp(this.configuration).eavesdropCall(e,t,i).then(e=>e(this.axios,this.basePath))}hangupCall(e,t,i){return CallServiceApiFp(this.configuration).hangupCall(e,t,i).then(e=>e(this.axios,this.basePath))}holdCall(e,t,i){return CallServiceApiFp(this.configuration).holdCall(e,t,i).then(e=>e(this.axios,this.basePath))}readCall(e,t,i){return CallServiceApiFp(this.configuration).readCall(e,t,i).then(e=>e(this.axios,this.basePath))}searchActiveCall(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E){return CallServiceApiFp(this.configuration).searchActiveCall(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E).then(e=>e(this.axios,this.basePath))}searchHistoryCall(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K,k,x,O,I,F){return CallServiceApiFp(this.configuration).searchHistoryCall(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q,C,R,P,_,T,E,K,k,x,O,I,F).then(e=>e(this.axios,this.basePath))}unHoldCall(e,t,i){return CallServiceApiFp(this.configuration).unHoldCall(e,t,i).then(e=>e(this.axios,this.basePath))}updateCallAnnotation(e,t,i,r){return CallServiceApiFp(this.configuration).updateCallAnnotation(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const CognitiveProfileServiceApiAxiosParamCreator=function(e){return{createCognitiveProfile:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCognitiveProfile.");const r=parse("/storage/cognitive_profiles",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteCognitiveProfile:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteCognitiveProfile.");const r="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},patchCognitiveProfile:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchCognitiveProfile.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readCognitiveProfile:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readCognitiveProfile.");const r="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},searchCognitiveProfile:async(t,i,r,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!==i&&(y.size=i),void 0!==r&&(y.q=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...c.headers},{url:format(l),options:p}},updateCognitiveProfile:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCognitiveProfile.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},CognitiveProfileServiceApiFp=function(e){return{async createCognitiveProfile(t,i){const r=await CognitiveProfileServiceApiAxiosParamCreator(e).createCognitiveProfile(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteCognitiveProfile(t,i){const r=await CognitiveProfileServiceApiAxiosParamCreator(e).deleteCognitiveProfile(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async patchCognitiveProfile(t,i,r){const a=await CognitiveProfileServiceApiAxiosParamCreator(e).patchCognitiveProfile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readCognitiveProfile(t,i){const r=await CognitiveProfileServiceApiAxiosParamCreator(e).readCognitiveProfile(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async searchCognitiveProfile(t,i,r,a,n,s,o,u,c){const l=await CognitiveProfileServiceApiAxiosParamCreator(e).searchCognitiveProfile(t,i,r,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const i={...l.options,url:t+l.url};return e.request(i)}},async updateCognitiveProfile(t,i,r){const a=await CognitiveProfileServiceApiAxiosParamCreator(e).updateCognitiveProfile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},CognitiveProfileServiceApiFactory=function(e,t,i){return{createCognitiveProfile:(r,a)=>CognitiveProfileServiceApiFp(e).createCognitiveProfile(r,a).then(e=>e(i,t)),deleteCognitiveProfile:(r,a)=>CognitiveProfileServiceApiFp(e).deleteCognitiveProfile(r,a).then(e=>e(i,t)),patchCognitiveProfile:(r,a,n)=>CognitiveProfileServiceApiFp(e).patchCognitiveProfile(r,a,n).then(e=>e(i,t)),readCognitiveProfile:(r,a)=>CognitiveProfileServiceApiFp(e).readCognitiveProfile(r,a).then(e=>e(i,t)),searchCognitiveProfile:(r,a,n,s,o,u,c,l,d)=>CognitiveProfileServiceApiFp(e).searchCognitiveProfile(r,a,n,s,o,u,c,l,d).then(e=>e(i,t)),updateCognitiveProfile:(r,a,n)=>CognitiveProfileServiceApiFp(e).updateCognitiveProfile(r,a,n).then(e=>e(i,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,i){return CognitiveProfileServiceApiFp(this.configuration).patchCognitiveProfile(e,t,i).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,i,r,a,n,s,o,u){return CognitiveProfileServiceApiFp(this.configuration).searchCognitiveProfile(e,t,i,r,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateCognitiveProfile(e,t,i){return CognitiveProfileServiceApiFp(this.configuration).updateCognitiveProfile(e,t,i).then(e=>e(this.axios,this.basePath))}}const CommunicationTypeServiceApiAxiosParamCreator=function(e){return{createCommunicationType:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCommunicationType.");const r=parse("/call_center/communication_type",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteCommunicationType:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readCommunicationType:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchCommunicationType:async(t,i,r,a,n,s,o={})=>{const u=parse("/call_center/communication_type",!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!==i&&(p.size=i),void 0!==r&&(p.q=r),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}},updateCommunicationType:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCommunicationType.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},CommunicationTypeServiceApiFp=function(e){return{async createCommunicationType(t,i){const r=await CommunicationTypeServiceApiAxiosParamCreator(e).createCommunicationType(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteCommunicationType(t,i,r){const a=await CommunicationTypeServiceApiAxiosParamCreator(e).deleteCommunicationType(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readCommunicationType(t,i,r){const a=await CommunicationTypeServiceApiAxiosParamCreator(e).readCommunicationType(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchCommunicationType(t,i,r,a,n,s,o){const u=await CommunicationTypeServiceApiAxiosParamCreator(e).searchCommunicationType(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async updateCommunicationType(t,i,r){const a=await CommunicationTypeServiceApiAxiosParamCreator(e).updateCommunicationType(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},CommunicationTypeServiceApiFactory=function(e,t,i){return{createCommunicationType:(r,a)=>CommunicationTypeServiceApiFp(e).createCommunicationType(r,a).then(e=>e(i,t)),deleteCommunicationType:(r,a,n)=>CommunicationTypeServiceApiFp(e).deleteCommunicationType(r,a,n).then(e=>e(i,t)),readCommunicationType:(r,a,n)=>CommunicationTypeServiceApiFp(e).readCommunicationType(r,a,n).then(e=>e(i,t)),searchCommunicationType:(r,a,n,s,o,u,c)=>CommunicationTypeServiceApiFp(e).searchCommunicationType(r,a,n,s,o,u,c).then(e=>e(i,t)),updateCommunicationType:(r,a,n)=>CommunicationTypeServiceApiFp(e).updateCommunicationType(r,a,n).then(e=>e(i,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,i){return CommunicationTypeServiceApiFp(this.configuration).deleteCommunicationType(e,t,i).then(e=>e(this.axios,this.basePath))}readCommunicationType(e,t,i){return CommunicationTypeServiceApiFp(this.configuration).readCommunicationType(e,t,i).then(e=>e(this.axios,this.basePath))}searchCommunicationType(e,t,i,r,a,n,s){return CommunicationTypeServiceApiFp(this.configuration).searchCommunicationType(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}updateCommunicationType(e,t,i){return CommunicationTypeServiceApiFp(this.configuration).updateCommunicationType(e,t,i).then(e=>e(this.axios,this.basePath))}}const EmailProfileServiceApiAxiosParamCreator=function(e){return{createEmailProfile:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createEmailProfile.");const r=parse("/email/profile",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteEmailProfile:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteEmailProfile.");const r="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},patchEmailProfile:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchEmailProfile.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readEmailProfile:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readEmailProfile.");const r="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},searchEmailProfile:async(t,i,r,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!==i&&(d.size=i),void 0!==r&&(d.q=r),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}},updateEmailProfile:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateEmailProfile.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},EmailProfileServiceApiFp=function(e){return{async createEmailProfile(t,i){const r=await EmailProfileServiceApiAxiosParamCreator(e).createEmailProfile(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteEmailProfile(t,i){const r=await EmailProfileServiceApiAxiosParamCreator(e).deleteEmailProfile(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async patchEmailProfile(t,i,r){const a=await EmailProfileServiceApiAxiosParamCreator(e).patchEmailProfile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readEmailProfile(t,i){const r=await EmailProfileServiceApiAxiosParamCreator(e).readEmailProfile(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async searchEmailProfile(t,i,r,a,n,s){const o=await EmailProfileServiceApiAxiosParamCreator(e).searchEmailProfile(t,i,r,a,n,s);return(e=globalAxios,t=BASE_PATH)=>{const i={...o.options,url:t+o.url};return e.request(i)}},async updateEmailProfile(t,i,r){const a=await EmailProfileServiceApiAxiosParamCreator(e).updateEmailProfile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},EmailProfileServiceApiFactory=function(e,t,i){return{createEmailProfile:(r,a)=>EmailProfileServiceApiFp(e).createEmailProfile(r,a).then(e=>e(i,t)),deleteEmailProfile:(r,a)=>EmailProfileServiceApiFp(e).deleteEmailProfile(r,a).then(e=>e(i,t)),patchEmailProfile:(r,a,n)=>EmailProfileServiceApiFp(e).patchEmailProfile(r,a,n).then(e=>e(i,t)),readEmailProfile:(r,a)=>EmailProfileServiceApiFp(e).readEmailProfile(r,a).then(e=>e(i,t)),searchEmailProfile:(r,a,n,s,o,u)=>EmailProfileServiceApiFp(e).searchEmailProfile(r,a,n,s,o,u).then(e=>e(i,t)),updateEmailProfile:(r,a,n)=>EmailProfileServiceApiFp(e).updateEmailProfile(r,a,n).then(e=>e(i,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))}patchEmailProfile(e,t,i){return EmailProfileServiceApiFp(this.configuration).patchEmailProfile(e,t,i).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,i,r,a,n){return EmailProfileServiceApiFp(this.configuration).searchEmailProfile(e,t,i,r,a,n).then(e=>e(this.axios,this.basePath))}updateEmailProfile(e,t,i){return EmailProfileServiceApiFp(this.configuration).updateEmailProfile(e,t,i).then(e=>e(this.axios,this.basePath))}}const FileServiceApiAxiosParamCreator=function(e){return{deleteFiles:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling deleteFiles.");const r=parse("/storage/file",!0);let a;e&&(a=e.baseOptions);const n={method:"DELETE",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}}}},FileServiceApiFp=function(e){return{async deleteFiles(t,i){const r=await FileServiceApiAxiosParamCreator(e).deleteFiles(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}}}},FileServiceApiFactory=function(e,t,i){return{deleteFiles:(r,a)=>FileServiceApiFp(e).deleteFiles(r,a).then(e=>e(i,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,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createFileTranscript.");const r=parse("/storage/transcript_file",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},getFileTranscriptPhrases:async(t,i,r,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!==i&&(l.page=i),void 0!==r&&(l.size=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}}}},FileTranscriptServiceApiFp=function(e){return{async createFileTranscript(t,i){const r=await FileTranscriptServiceApiAxiosParamCreator(e).createFileTranscript(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async getFileTranscriptPhrases(t,i,r,a){const n=await FileTranscriptServiceApiAxiosParamCreator(e).getFileTranscriptPhrases(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},FileTranscriptServiceApiFactory=function(e,t,i){return{createFileTranscript:(r,a)=>FileTranscriptServiceApiFp(e).createFileTranscript(r,a).then(e=>e(i,t)),getFileTranscriptPhrases:(r,a,n,s)=>FileTranscriptServiceApiFp(e).getFileTranscriptPhrases(r,a,n,s).then(e=>e(i,t))}};class FileTranscriptServiceApi extends BaseAPI{createFileTranscript(e,t){return FileTranscriptServiceApiFp(this.configuration).createFileTranscript(e,t).then(e=>e(this.axios,this.basePath))}getFileTranscriptPhrases(e,t,i,r){return FileTranscriptServiceApiFp(this.configuration).getFileTranscriptPhrases(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const ImportTemplateServiceApiAxiosParamCreator=function(e){return{createImportTemplate:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createImportTemplate.");const r=parse("/storage/import_templates",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteImportTemplate:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteImportTemplate.");const r="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},patchImportTemplate:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchImportTemplate.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readImportTemplate:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readImportTemplate.");const r="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},searchImportTemplate:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateImportTemplate.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},ImportTemplateServiceApiFp=function(e){return{async createImportTemplate(t,i){const r=await ImportTemplateServiceApiAxiosParamCreator(e).createImportTemplate(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteImportTemplate(t,i){const r=await ImportTemplateServiceApiAxiosParamCreator(e).deleteImportTemplate(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async patchImportTemplate(t,i,r){const a=await ImportTemplateServiceApiAxiosParamCreator(e).patchImportTemplate(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readImportTemplate(t,i){const r=await ImportTemplateServiceApiAxiosParamCreator(e).readImportTemplate(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async searchImportTemplate(t,i,r,a,n,s,o){const u=await ImportTemplateServiceApiAxiosParamCreator(e).searchImportTemplate(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async updateImportTemplate(t,i,r){const a=await ImportTemplateServiceApiAxiosParamCreator(e).updateImportTemplate(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},ImportTemplateServiceApiFactory=function(e,t,i){return{createImportTemplate:(r,a)=>ImportTemplateServiceApiFp(e).createImportTemplate(r,a).then(e=>e(i,t)),deleteImportTemplate:(r,a)=>ImportTemplateServiceApiFp(e).deleteImportTemplate(r,a).then(e=>e(i,t)),patchImportTemplate:(r,a,n)=>ImportTemplateServiceApiFp(e).patchImportTemplate(r,a,n).then(e=>e(i,t)),readImportTemplate:(r,a)=>ImportTemplateServiceApiFp(e).readImportTemplate(r,a).then(e=>e(i,t)),searchImportTemplate:(r,a,n,s,o,u,c)=>ImportTemplateServiceApiFp(e).searchImportTemplate(r,a,n,s,o,u,c).then(e=>e(i,t)),updateImportTemplate:(r,a,n)=>ImportTemplateServiceApiFp(e).updateImportTemplate(r,a,n).then(e=>e(i,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,i){return ImportTemplateServiceApiFp(this.configuration).patchImportTemplate(e,t,i).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,i,r,a,n,s){return ImportTemplateServiceApiFp(this.configuration).searchImportTemplate(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}updateImportTemplate(e,t,i){return ImportTemplateServiceApiFp(this.configuration).updateImportTemplate(e,t,i).then(e=>e(this.axios,this.basePath))}}const ListServiceApiAxiosParamCreator=function(e){return{createList:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createList.");const r=parse("/call_center/list",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},createListCommunication:async(t,i,r={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling createListCommunication.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteList:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},deleteListCommunication:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling deleteListCommunication.");if(null==i)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(i))),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!==r&&(l.domain_id=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}},readList:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readListCommunication:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling readListCommunication.");if(null==i)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(i))),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.domain_id=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}},searchList:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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,i,r,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling searchListCommunication.");const c="/call_center/list/{list_id}/communication".replace("{list_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!==i&&(y.page=i),void 0!==r&&(y.size=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...u.headers},{url:format(l),options:p}},updateList:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateList.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},updateListCommunication:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling updateListCommunication.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateListCommunication.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},ListServiceApiFp=function(e){return{async createList(t,i){const r=await ListServiceApiAxiosParamCreator(e).createList(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async createListCommunication(t,i,r){const a=await ListServiceApiAxiosParamCreator(e).createListCommunication(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteList(t,i,r){const a=await ListServiceApiAxiosParamCreator(e).deleteList(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteListCommunication(t,i,r,a){const n=await ListServiceApiAxiosParamCreator(e).deleteListCommunication(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async readList(t,i,r){const a=await ListServiceApiAxiosParamCreator(e).readList(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readListCommunication(t,i,r,a){const n=await ListServiceApiAxiosParamCreator(e).readListCommunication(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async searchList(t,i,r,a,n,s,o){const u=await ListServiceApiAxiosParamCreator(e).searchList(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async searchListCommunication(t,i,r,a,n,s,o,u){const c=await ListServiceApiAxiosParamCreator(e).searchListCommunication(t,i,r,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const i={...c.options,url:t+c.url};return e.request(i)}},async updateList(t,i,r){const a=await ListServiceApiAxiosParamCreator(e).updateList(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async updateListCommunication(t,i,r,a){const n=await ListServiceApiAxiosParamCreator(e).updateListCommunication(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},ListServiceApiFactory=function(e,t,i){return{createList:(r,a)=>ListServiceApiFp(e).createList(r,a).then(e=>e(i,t)),createListCommunication:(r,a,n)=>ListServiceApiFp(e).createListCommunication(r,a,n).then(e=>e(i,t)),deleteList:(r,a,n)=>ListServiceApiFp(e).deleteList(r,a,n).then(e=>e(i,t)),deleteListCommunication:(r,a,n,s)=>ListServiceApiFp(e).deleteListCommunication(r,a,n,s).then(e=>e(i,t)),readList:(r,a,n)=>ListServiceApiFp(e).readList(r,a,n).then(e=>e(i,t)),readListCommunication:(r,a,n,s)=>ListServiceApiFp(e).readListCommunication(r,a,n,s).then(e=>e(i,t)),searchList:(r,a,n,s,o,u,c)=>ListServiceApiFp(e).searchList(r,a,n,s,o,u,c).then(e=>e(i,t)),searchListCommunication:(r,a,n,s,o,u,c,l)=>ListServiceApiFp(e).searchListCommunication(r,a,n,s,o,u,c,l).then(e=>e(i,t)),updateList:(r,a,n)=>ListServiceApiFp(e).updateList(r,a,n).then(e=>e(i,t)),updateListCommunication:(r,a,n,s)=>ListServiceApiFp(e).updateListCommunication(r,a,n,s).then(e=>e(i,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,i){return ListServiceApiFp(this.configuration).createListCommunication(e,t,i).then(e=>e(this.axios,this.basePath))}deleteList(e,t,i){return ListServiceApiFp(this.configuration).deleteList(e,t,i).then(e=>e(this.axios,this.basePath))}deleteListCommunication(e,t,i,r){return ListServiceApiFp(this.configuration).deleteListCommunication(e,t,i,r).then(e=>e(this.axios,this.basePath))}readList(e,t,i){return ListServiceApiFp(this.configuration).readList(e,t,i).then(e=>e(this.axios,this.basePath))}readListCommunication(e,t,i,r){return ListServiceApiFp(this.configuration).readListCommunication(e,t,i,r).then(e=>e(this.axios,this.basePath))}searchList(e,t,i,r,a,n,s){return ListServiceApiFp(this.configuration).searchList(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}searchListCommunication(e,t,i,r,a,n,s,o){return ListServiceApiFp(this.configuration).searchListCommunication(e,t,i,r,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateList(e,t,i){return ListServiceApiFp(this.configuration).updateList(e,t,i).then(e=>e(this.axios,this.basePath))}updateListCommunication(e,t,i,r){return ListServiceApiFp(this.configuration).updateListCommunication(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const MediaFileServiceApiAxiosParamCreator=function(e){return{deleteMediaFile:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readMediaFile:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchMediaFile:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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,i,r){const a=await MediaFileServiceApiAxiosParamCreator(e).deleteMediaFile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readMediaFile(t,i,r){const a=await MediaFileServiceApiAxiosParamCreator(e).readMediaFile(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchMediaFile(t,i,r,a,n,s,o){const u=await MediaFileServiceApiAxiosParamCreator(e).searchMediaFile(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}}}},MediaFileServiceApiFactory=function(e,t,i){return{deleteMediaFile:(r,a,n)=>MediaFileServiceApiFp(e).deleteMediaFile(r,a,n).then(e=>e(i,t)),readMediaFile:(r,a,n)=>MediaFileServiceApiFp(e).readMediaFile(r,a,n).then(e=>e(i,t)),searchMediaFile:(r,a,n,s,o,u,c)=>MediaFileServiceApiFp(e).searchMediaFile(r,a,n,s,o,u,c).then(e=>e(i,t))}};class MediaFileServiceApi extends BaseAPI{deleteMediaFile(e,t,i){return MediaFileServiceApiFp(this.configuration).deleteMediaFile(e,t,i).then(e=>e(this.axios,this.basePath))}readMediaFile(e,t,i){return MediaFileServiceApiFp(this.configuration).readMediaFile(e,t,i).then(e=>e(this.axios,this.basePath))}searchMediaFile(e,t,i,r,a,n,s){return MediaFileServiceApiFp(this.configuration).searchMediaFile(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}}const MemberServiceApiAxiosParamCreator=function(e){return{attemptCallback:async(t,i,r={})=>{if(null==t)throw new RequiredError("attemptId","Required parameter attemptId was null or undefined when calling attemptCallback.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},attemptResult:async(t,i,r,a,n={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling attemptResult.");if(null==i)throw new RequiredError("memberId","Required parameter memberId was null or undefined when calling attemptResult.");if(null==r)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(i))).replace("{attempt_id}",encodeURIComponent(String(r))),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,i,r={})=>{if(null==t)throw new RequiredError("attemptId","Required parameter attemptId was null or undefined when calling attemptsRenewalResult.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},createAttempt:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createAttempt.");if(null==i)throw new RequiredError("memberId","Required parameter memberId was null or undefined when calling createAttempt.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},createMember:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createMember.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},createMemberBulk:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createMemberBulk.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteMember:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteMember.");if(null==i)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(i))),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!==r&&(l.domain_id=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}},deleteMembers:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteMembers.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},patchMember:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchMember.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling patchMember.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},readMember:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readMember.");if(null==i)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(i))),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.domain_id=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}},resetMembers:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling resetMembers.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},searchAttempts:async(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S={})=>{const w=parse("/call_center/queues/attempts/active",!0);let v;e&&(v=e.baseOptions);const q={method:"GET",...v,...S},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!==i&&(R.size=i),void 0!==r&&(R.q=r),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!==A&&(R["leaving_at.to"]=A),void 0!==g&&(R["offering_at.from"]=g),void 0!==m&&(R["offering_at.to"]=m),void 0!==f&&(R["duration.from"]=f),void 0!==b&&(R["duration.to"]=b),w.query={...w.query,...R,...S.query},delete w.search;let P=v&&v.headers?v.headers:{};return q.headers={...C,...P,...S.headers},{url:format(w),options:q}},searchAttemptsHistory:async(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S={})=>{const w=parse("/call_center/queues/attempts/history",!0);let v;e&&(v=e.baseOptions);const q={method:"GET",...v,...S},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!==i&&(R.size=i),void 0!==r&&(R.q=r),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!==A&&(R["leaving_at.to"]=A),void 0!==g&&(R["offering_at.from"]=g),void 0!==m&&(R["offering_at.to"]=m),void 0!==f&&(R["duration.from"]=f),void 0!==b&&(R["duration.to"]=b),w.query={...w.query,...R,...S.query},delete w.search;let P=v&&v.headers?v.headers:{};return q.headers={...C,...P,...S.headers},{url:format(w),options:q}},searchMemberAttempts:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchMemberAttempts.");if(null==i)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(i))),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.domain_id=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}},searchMemberInQueue:async(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchMemberInQueue.");const v="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(t))),q=parse(v,!0);let C;e&&(C=e.baseOptions);const R={method:"GET",...C,...w},P={},_={};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!==i&&(_.page=i),void 0!==r&&(_.size=r),void 0!==a&&(_.q=a),void 0!==n&&(_.sort=n),s&&(_.fields=s),o&&(_.id=o),u&&(_.bucket_id=u),void 0!==c&&(_.destination=c),void 0!==l&&(_["created_at.from"]=l),void 0!==d&&(_["created_at.to"]=d),void 0!==p&&(_["offering_at.from"]=p),void 0!==h&&(_["offering_at.to"]=h),y&&(_.stop_cause=y),void 0!==A&&(_["priority.from"]=A),void 0!==g&&(_["priority.to"]=g),void 0!==m&&(_.name=m),void 0!==f&&(_["attempts.from"]=f),void 0!==b&&(_["attempts.to"]=b),S&&(_.agent_id=S),q.query={...q.query,..._,...w.query},delete q.search;let T=C&&C.headers?C.headers:{};return R.headers={...P,...T,...w.headers},{url:format(q),options:R}},searchMembers:async(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w={})=>{const v=parse("/call_center/members",!0);let q;e&&(q=e.baseOptions);const C={method:"GET",...q,...w},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!==i&&(P.size=i),void 0!==r&&(P.q=r),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!==A&&(P["priority.from"]=A),void 0!==g&&(P["priority.to"]=g),void 0!==m&&(P.name=m),void 0!==f&&(P["attempts.from"]=f),void 0!==b&&(P["attempts.to"]=b),S&&(P.agent_id=S),v.query={...v.query,...P,...w.query},delete v.search;let _=q&&q.headers?q.headers:{};return C.headers={...R,..._,...w.headers},{url:format(v),options:C}},updateMember:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateMember.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateMember.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},MemberServiceApiFp=function(e){return{async attemptCallback(t,i,r){const a=await MemberServiceApiAxiosParamCreator(e).attemptCallback(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async attemptResult(t,i,r,a,n){const s=await MemberServiceApiAxiosParamCreator(e).attemptResult(t,i,r,a,n);return(e=globalAxios,t=BASE_PATH)=>{const i={...s.options,url:t+s.url};return e.request(i)}},async attemptsRenewalResult(t,i,r){const a=await MemberServiceApiAxiosParamCreator(e).attemptsRenewalResult(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async createAttempt(t,i,r,a){const n=await MemberServiceApiAxiosParamCreator(e).createAttempt(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async createMember(t,i,r){const a=await MemberServiceApiAxiosParamCreator(e).createMember(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async createMemberBulk(t,i,r){const a=await MemberServiceApiAxiosParamCreator(e).createMemberBulk(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteMember(t,i,r,a){const n=await MemberServiceApiAxiosParamCreator(e).deleteMember(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async deleteMembers(t,i,r){const a=await MemberServiceApiAxiosParamCreator(e).deleteMembers(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async patchMember(t,i,r,a){const n=await MemberServiceApiAxiosParamCreator(e).patchMember(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async readMember(t,i,r,a){const n=await MemberServiceApiAxiosParamCreator(e).readMember(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async resetMembers(t,i,r){const a=await MemberServiceApiAxiosParamCreator(e).resetMembers(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchAttempts(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S){const w=await MemberServiceApiAxiosParamCreator(e).searchAttempts(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S);return(e=globalAxios,t=BASE_PATH)=>{const i={...w.options,url:t+w.url};return e.request(i)}},async searchAttemptsHistory(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S){const w=await MemberServiceApiAxiosParamCreator(e).searchAttemptsHistory(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S);return(e=globalAxios,t=BASE_PATH)=>{const i={...w.options,url:t+w.url};return e.request(i)}},async searchMemberAttempts(t,i,r,a){const n=await MemberServiceApiAxiosParamCreator(e).searchMemberAttempts(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async searchMemberInQueue(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w){const v=await MemberServiceApiAxiosParamCreator(e).searchMemberInQueue(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w);return(e=globalAxios,t=BASE_PATH)=>{const i={...v.options,url:t+v.url};return e.request(i)}},async searchMembers(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w){const v=await MemberServiceApiAxiosParamCreator(e).searchMembers(t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w);return(e=globalAxios,t=BASE_PATH)=>{const i={...v.options,url:t+v.url};return e.request(i)}},async updateMember(t,i,r,a){const n=await MemberServiceApiAxiosParamCreator(e).updateMember(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},MemberServiceApiFactory=function(e,t,i){return{attemptCallback:(r,a,n)=>MemberServiceApiFp(e).attemptCallback(r,a,n).then(e=>e(i,t)),attemptResult:(r,a,n,s,o)=>MemberServiceApiFp(e).attemptResult(r,a,n,s,o).then(e=>e(i,t)),attemptsRenewalResult:(r,a,n)=>MemberServiceApiFp(e).attemptsRenewalResult(r,a,n).then(e=>e(i,t)),createAttempt:(r,a,n,s)=>MemberServiceApiFp(e).createAttempt(r,a,n,s).then(e=>e(i,t)),createMember:(r,a,n)=>MemberServiceApiFp(e).createMember(r,a,n).then(e=>e(i,t)),createMemberBulk:(r,a,n)=>MemberServiceApiFp(e).createMemberBulk(r,a,n).then(e=>e(i,t)),deleteMember:(r,a,n,s)=>MemberServiceApiFp(e).deleteMember(r,a,n,s).then(e=>e(i,t)),deleteMembers:(r,a,n)=>MemberServiceApiFp(e).deleteMembers(r,a,n).then(e=>e(i,t)),patchMember:(r,a,n,s)=>MemberServiceApiFp(e).patchMember(r,a,n,s).then(e=>e(i,t)),readMember:(r,a,n,s)=>MemberServiceApiFp(e).readMember(r,a,n,s).then(e=>e(i,t)),resetMembers:(r,a,n)=>MemberServiceApiFp(e).resetMembers(r,a,n).then(e=>e(i,t)),searchAttempts:(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v)=>MemberServiceApiFp(e).searchAttempts(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v).then(e=>e(i,t)),searchAttemptsHistory:(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v)=>MemberServiceApiFp(e).searchAttemptsHistory(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v).then(e=>e(i,t)),searchMemberAttempts:(r,a,n,s)=>MemberServiceApiFp(e).searchMemberAttempts(r,a,n,s).then(e=>e(i,t)),searchMemberInQueue:(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q)=>MemberServiceApiFp(e).searchMemberInQueue(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q).then(e=>e(i,t)),searchMembers:(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q)=>MemberServiceApiFp(e).searchMembers(r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S,w,v,q).then(e=>e(i,t)),updateMember:(r,a,n,s)=>MemberServiceApiFp(e).updateMember(r,a,n,s).then(e=>e(i,t))}};class MemberServiceApi extends BaseAPI{attemptCallback(e,t,i){return MemberServiceApiFp(this.configuration).attemptCallback(e,t,i).then(e=>e(this.axios,this.basePath))}attemptResult(e,t,i,r,a){return MemberServiceApiFp(this.configuration).attemptResult(e,t,i,r,a).then(e=>e(this.axios,this.basePath))}attemptsRenewalResult(e,t,i){return MemberServiceApiFp(this.configuration).attemptsRenewalResult(e,t,i).then(e=>e(this.axios,this.basePath))}createAttempt(e,t,i,r){return MemberServiceApiFp(this.configuration).createAttempt(e,t,i,r).then(e=>e(this.axios,this.basePath))}createMember(e,t,i){return MemberServiceApiFp(this.configuration).createMember(e,t,i).then(e=>e(this.axios,this.basePath))}createMemberBulk(e,t,i){return MemberServiceApiFp(this.configuration).createMemberBulk(e,t,i).then(e=>e(this.axios,this.basePath))}deleteMember(e,t,i,r){return MemberServiceApiFp(this.configuration).deleteMember(e,t,i,r).then(e=>e(this.axios,this.basePath))}deleteMembers(e,t,i){return MemberServiceApiFp(this.configuration).deleteMembers(e,t,i).then(e=>e(this.axios,this.basePath))}patchMember(e,t,i,r){return MemberServiceApiFp(this.configuration).patchMember(e,t,i,r).then(e=>e(this.axios,this.basePath))}readMember(e,t,i,r){return MemberServiceApiFp(this.configuration).readMember(e,t,i,r).then(e=>e(this.axios,this.basePath))}resetMembers(e,t,i){return MemberServiceApiFp(this.configuration).resetMembers(e,t,i).then(e=>e(this.axios,this.basePath))}searchAttempts(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b){return MemberServiceApiFp(this.configuration).searchAttempts(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b).then(e=>e(this.axios,this.basePath))}searchAttemptsHistory(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b){return MemberServiceApiFp(this.configuration).searchAttemptsHistory(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b).then(e=>e(this.axios,this.basePath))}searchMemberAttempts(e,t,i,r){return MemberServiceApiFp(this.configuration).searchMemberAttempts(e,t,i,r).then(e=>e(this.axios,this.basePath))}searchMemberInQueue(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S){return MemberServiceApiFp(this.configuration).searchMemberInQueue(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S).then(e=>e(this.axios,this.basePath))}searchMembers(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S){return MemberServiceApiFp(this.configuration).searchMembers(e,t,i,r,a,n,s,o,u,c,l,d,p,h,y,A,g,m,f,b,S).then(e=>e(this.axios,this.basePath))}updateMember(e,t,i,r){return MemberServiceApiFp(this.configuration).updateMember(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const OutboundResourceGroupServiceApiAxiosParamCreator=function(e){return{createOutboundResourceGroup:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createOutboundResourceGroup.");const r=parse("/call_center/resource_group",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},createOutboundResourceInGroup:async(t,i,r={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling createOutboundResourceInGroup.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteOutboundResourceGroup:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},deleteOutboundResourceInGroup:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling deleteOutboundResourceInGroup.");if(null==i)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(i))),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!==r&&(l.domain_id=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}},readOutboundResourceGroup:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readOutboundResourceInGroup:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling readOutboundResourceInGroup.");if(null==i)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(i))),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.domain_id=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}},searchOutboundResourceGroup:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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,i,r,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!==i&&(y.page=i),void 0!==r&&(y.size=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...u.headers},{url:format(l),options:p}},updateOutboundResourceGroup:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResourceGroup.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},updateOutboundResourceInGroup:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling updateOutboundResourceInGroup.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResourceInGroup.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},OutboundResourceGroupServiceApiFp=function(e){return{async createOutboundResourceGroup(t,i){const r=await OutboundResourceGroupServiceApiAxiosParamCreator(e).createOutboundResourceGroup(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async createOutboundResourceInGroup(t,i,r){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).createOutboundResourceInGroup(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteOutboundResourceGroup(t,i,r){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).deleteOutboundResourceGroup(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteOutboundResourceInGroup(t,i,r,a){const n=await OutboundResourceGroupServiceApiAxiosParamCreator(e).deleteOutboundResourceInGroup(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async readOutboundResourceGroup(t,i,r){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).readOutboundResourceGroup(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readOutboundResourceInGroup(t,i,r,a){const n=await OutboundResourceGroupServiceApiAxiosParamCreator(e).readOutboundResourceInGroup(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async searchOutboundResourceGroup(t,i,r,a,n,s,o){const u=await OutboundResourceGroupServiceApiAxiosParamCreator(e).searchOutboundResourceGroup(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async searchOutboundResourceInGroup(t,i,r,a,n,s,o,u){const c=await OutboundResourceGroupServiceApiAxiosParamCreator(e).searchOutboundResourceInGroup(t,i,r,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const i={...c.options,url:t+c.url};return e.request(i)}},async updateOutboundResourceGroup(t,i,r){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).updateOutboundResourceGroup(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async updateOutboundResourceInGroup(t,i,r,a){const n=await OutboundResourceGroupServiceApiAxiosParamCreator(e).updateOutboundResourceInGroup(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},OutboundResourceGroupServiceApiFactory=function(e,t,i){return{createOutboundResourceGroup:(r,a)=>OutboundResourceGroupServiceApiFp(e).createOutboundResourceGroup(r,a).then(e=>e(i,t)),createOutboundResourceInGroup:(r,a,n)=>OutboundResourceGroupServiceApiFp(e).createOutboundResourceInGroup(r,a,n).then(e=>e(i,t)),deleteOutboundResourceGroup:(r,a,n)=>OutboundResourceGroupServiceApiFp(e).deleteOutboundResourceGroup(r,a,n).then(e=>e(i,t)),deleteOutboundResourceInGroup:(r,a,n,s)=>OutboundResourceGroupServiceApiFp(e).deleteOutboundResourceInGroup(r,a,n,s).then(e=>e(i,t)),readOutboundResourceGroup:(r,a,n)=>OutboundResourceGroupServiceApiFp(e).readOutboundResourceGroup(r,a,n).then(e=>e(i,t)),readOutboundResourceInGroup:(r,a,n,s)=>OutboundResourceGroupServiceApiFp(e).readOutboundResourceInGroup(r,a,n,s).then(e=>e(i,t)),searchOutboundResourceGroup:(r,a,n,s,o,u,c)=>OutboundResourceGroupServiceApiFp(e).searchOutboundResourceGroup(r,a,n,s,o,u,c).then(e=>e(i,t)),searchOutboundResourceInGroup:(r,a,n,s,o,u,c,l)=>OutboundResourceGroupServiceApiFp(e).searchOutboundResourceInGroup(r,a,n,s,o,u,c,l).then(e=>e(i,t)),updateOutboundResourceGroup:(r,a,n)=>OutboundResourceGroupServiceApiFp(e).updateOutboundResourceGroup(r,a,n).then(e=>e(i,t)),updateOutboundResourceInGroup:(r,a,n,s)=>OutboundResourceGroupServiceApiFp(e).updateOutboundResourceInGroup(r,a,n,s).then(e=>e(i,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,i){return OutboundResourceGroupServiceApiFp(this.configuration).createOutboundResourceInGroup(e,t,i).then(e=>e(this.axios,this.basePath))}deleteOutboundResourceGroup(e,t,i){return OutboundResourceGroupServiceApiFp(this.configuration).deleteOutboundResourceGroup(e,t,i).then(e=>e(this.axios,this.basePath))}deleteOutboundResourceInGroup(e,t,i,r){return OutboundResourceGroupServiceApiFp(this.configuration).deleteOutboundResourceInGroup(e,t,i,r).then(e=>e(this.axios,this.basePath))}readOutboundResourceGroup(e,t,i){return OutboundResourceGroupServiceApiFp(this.configuration).readOutboundResourceGroup(e,t,i).then(e=>e(this.axios,this.basePath))}readOutboundResourceInGroup(e,t,i,r){return OutboundResourceGroupServiceApiFp(this.configuration).readOutboundResourceInGroup(e,t,i,r).then(e=>e(this.axios,this.basePath))}searchOutboundResourceGroup(e,t,i,r,a,n,s){return OutboundResourceGroupServiceApiFp(this.configuration).searchOutboundResourceGroup(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}searchOutboundResourceInGroup(e,t,i,r,a,n,s,o){return OutboundResourceGroupServiceApiFp(this.configuration).searchOutboundResourceInGroup(e,t,i,r,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateOutboundResourceGroup(e,t,i){return OutboundResourceGroupServiceApiFp(this.configuration).updateOutboundResourceGroup(e,t,i).then(e=>e(this.axios,this.basePath))}updateOutboundResourceInGroup(e,t,i,r){return OutboundResourceGroupServiceApiFp(this.configuration).updateOutboundResourceInGroup(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const OutboundResourceServiceApiAxiosParamCreator=function(e){return{createOutboundResource:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createOutboundResource.");const r=parse("/call_center/resources",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},createOutboundResourceDisplay:async(t,i,r={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling createOutboundResourceDisplay.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteOutboundResource:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},deleteOutboundResourceDisplay:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling deleteOutboundResourceDisplay.");if(null==i)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(i))),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!==r&&(l.domain_id=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}},patchOutboundResource:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchOutboundResource.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readOutboundResource:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readOutboundResourceDisplay:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling readOutboundResourceDisplay.");if(null==i)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(i))),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.domain_id=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}},searchOutboundResource:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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,i,r,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!==i&&(y.page=i),void 0!==r&&(y.size=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...u.headers},{url:format(l),options:p}},updateOutboundResource:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResource.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},updateOutboundResourceDisplay:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling updateOutboundResourceDisplay.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResourceDisplay.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},OutboundResourceServiceApiFp=function(e){return{async createOutboundResource(t,i){const r=await OutboundResourceServiceApiAxiosParamCreator(e).createOutboundResource(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async createOutboundResourceDisplay(t,i,r){const a=await OutboundResourceServiceApiAxiosParamCreator(e).createOutboundResourceDisplay(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteOutboundResource(t,i,r){const a=await OutboundResourceServiceApiAxiosParamCreator(e).deleteOutboundResource(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteOutboundResourceDisplay(t,i,r,a){const n=await OutboundResourceServiceApiAxiosParamCreator(e).deleteOutboundResourceDisplay(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async patchOutboundResource(t,i,r){const a=await OutboundResourceServiceApiAxiosParamCreator(e).patchOutboundResource(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readOutboundResource(t,i,r){const a=await OutboundResourceServiceApiAxiosParamCreator(e).readOutboundResource(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readOutboundResourceDisplay(t,i,r,a){const n=await OutboundResourceServiceApiAxiosParamCreator(e).readOutboundResourceDisplay(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async searchOutboundResource(t,i,r,a,n,s,o){const u=await OutboundResourceServiceApiAxiosParamCreator(e).searchOutboundResource(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async searchOutboundResourceDisplay(t,i,r,a,n,s,o,u){const c=await OutboundResourceServiceApiAxiosParamCreator(e).searchOutboundResourceDisplay(t,i,r,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const i={...c.options,url:t+c.url};return e.request(i)}},async updateOutboundResource(t,i,r){const a=await OutboundResourceServiceApiAxiosParamCreator(e).updateOutboundResource(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async updateOutboundResourceDisplay(t,i,r,a){const n=await OutboundResourceServiceApiAxiosParamCreator(e).updateOutboundResourceDisplay(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},OutboundResourceServiceApiFactory=function(e,t,i){return{createOutboundResource:(r,a)=>OutboundResourceServiceApiFp(e).createOutboundResource(r,a).then(e=>e(i,t)),createOutboundResourceDisplay:(r,a,n)=>OutboundResourceServiceApiFp(e).createOutboundResourceDisplay(r,a,n).then(e=>e(i,t)),deleteOutboundResource:(r,a,n)=>OutboundResourceServiceApiFp(e).deleteOutboundResource(r,a,n).then(e=>e(i,t)),deleteOutboundResourceDisplay:(r,a,n,s)=>OutboundResourceServiceApiFp(e).deleteOutboundResourceDisplay(r,a,n,s).then(e=>e(i,t)),patchOutboundResource:(r,a,n)=>OutboundResourceServiceApiFp(e).patchOutboundResource(r,a,n).then(e=>e(i,t)),readOutboundResource:(r,a,n)=>OutboundResourceServiceApiFp(e).readOutboundResource(r,a,n).then(e=>e(i,t)),readOutboundResourceDisplay:(r,a,n,s)=>OutboundResourceServiceApiFp(e).readOutboundResourceDisplay(r,a,n,s).then(e=>e(i,t)),searchOutboundResource:(r,a,n,s,o,u,c)=>OutboundResourceServiceApiFp(e).searchOutboundResource(r,a,n,s,o,u,c).then(e=>e(i,t)),searchOutboundResourceDisplay:(r,a,n,s,o,u,c,l)=>OutboundResourceServiceApiFp(e).searchOutboundResourceDisplay(r,a,n,s,o,u,c,l).then(e=>e(i,t)),updateOutboundResource:(r,a,n)=>OutboundResourceServiceApiFp(e).updateOutboundResource(r,a,n).then(e=>e(i,t)),updateOutboundResourceDisplay:(r,a,n,s)=>OutboundResourceServiceApiFp(e).updateOutboundResourceDisplay(r,a,n,s).then(e=>e(i,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,i){return OutboundResourceServiceApiFp(this.configuration).createOutboundResourceDisplay(e,t,i).then(e=>e(this.axios,this.basePath))}deleteOutboundResource(e,t,i){return OutboundResourceServiceApiFp(this.configuration).deleteOutboundResource(e,t,i).then(e=>e(this.axios,this.basePath))}deleteOutboundResourceDisplay(e,t,i,r){return OutboundResourceServiceApiFp(this.configuration).deleteOutboundResourceDisplay(e,t,i,r).then(e=>e(this.axios,this.basePath))}patchOutboundResource(e,t,i){return OutboundResourceServiceApiFp(this.configuration).patchOutboundResource(e,t,i).then(e=>e(this.axios,this.basePath))}readOutboundResource(e,t,i){return OutboundResourceServiceApiFp(this.configuration).readOutboundResource(e,t,i).then(e=>e(this.axios,this.basePath))}readOutboundResourceDisplay(e,t,i,r){return OutboundResourceServiceApiFp(this.configuration).readOutboundResourceDisplay(e,t,i,r).then(e=>e(this.axios,this.basePath))}searchOutboundResource(e,t,i,r,a,n,s){return OutboundResourceServiceApiFp(this.configuration).searchOutboundResource(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}searchOutboundResourceDisplay(e,t,i,r,a,n,s,o){return OutboundResourceServiceApiFp(this.configuration).searchOutboundResourceDisplay(e,t,i,r,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateOutboundResource(e,t,i){return OutboundResourceServiceApiFp(this.configuration).updateOutboundResource(e,t,i).then(e=>e(this.axios,this.basePath))}updateOutboundResourceDisplay(e,t,i,r){return OutboundResourceServiceApiFp(this.configuration).updateOutboundResourceDisplay(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const QueueBucketServiceApiAxiosParamCreator=function(e){return{createQueueBucket:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueBucket.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteQueueBucket:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueBucket.");if(null==i)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(i))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...r.headers},{url:format(n),options:o}},patchQueueBucket:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchQueueBucket.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueueBucket.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},readQueueBucket:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueBucket.");if(null==i)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(i))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...r.headers},{url:format(n),options:o}},searchQueueBucket:async(t,i,r,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!==i&&(y.page=i),void 0!==r&&(y.size=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...u.headers},{url:format(l),options:p}},updateQueueBucket:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueBucket.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueBucket.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},QueueBucketServiceApiFp=function(e){return{async createQueueBucket(t,i,r){const a=await QueueBucketServiceApiAxiosParamCreator(e).createQueueBucket(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteQueueBucket(t,i,r){const a=await QueueBucketServiceApiAxiosParamCreator(e).deleteQueueBucket(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async patchQueueBucket(t,i,r,a){const n=await QueueBucketServiceApiAxiosParamCreator(e).patchQueueBucket(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async readQueueBucket(t,i,r){const a=await QueueBucketServiceApiAxiosParamCreator(e).readQueueBucket(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchQueueBucket(t,i,r,a,n,s,o,u){const c=await QueueBucketServiceApiAxiosParamCreator(e).searchQueueBucket(t,i,r,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const i={...c.options,url:t+c.url};return e.request(i)}},async updateQueueBucket(t,i,r,a){const n=await QueueBucketServiceApiAxiosParamCreator(e).updateQueueBucket(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},QueueBucketServiceApiFactory=function(e,t,i){return{createQueueBucket:(r,a,n)=>QueueBucketServiceApiFp(e).createQueueBucket(r,a,n).then(e=>e(i,t)),deleteQueueBucket:(r,a,n)=>QueueBucketServiceApiFp(e).deleteQueueBucket(r,a,n).then(e=>e(i,t)),patchQueueBucket:(r,a,n,s)=>QueueBucketServiceApiFp(e).patchQueueBucket(r,a,n,s).then(e=>e(i,t)),readQueueBucket:(r,a,n)=>QueueBucketServiceApiFp(e).readQueueBucket(r,a,n).then(e=>e(i,t)),searchQueueBucket:(r,a,n,s,o,u,c,l)=>QueueBucketServiceApiFp(e).searchQueueBucket(r,a,n,s,o,u,c,l).then(e=>e(i,t)),updateQueueBucket:(r,a,n,s)=>QueueBucketServiceApiFp(e).updateQueueBucket(r,a,n,s).then(e=>e(i,t))}};class QueueBucketServiceApi extends BaseAPI{createQueueBucket(e,t,i){return QueueBucketServiceApiFp(this.configuration).createQueueBucket(e,t,i).then(e=>e(this.axios,this.basePath))}deleteQueueBucket(e,t,i){return QueueBucketServiceApiFp(this.configuration).deleteQueueBucket(e,t,i).then(e=>e(this.axios,this.basePath))}patchQueueBucket(e,t,i,r){return QueueBucketServiceApiFp(this.configuration).patchQueueBucket(e,t,i,r).then(e=>e(this.axios,this.basePath))}readQueueBucket(e,t,i){return QueueBucketServiceApiFp(this.configuration).readQueueBucket(e,t,i).then(e=>e(this.axios,this.basePath))}searchQueueBucket(e,t,i,r,a,n,s,o){return QueueBucketServiceApiFp(this.configuration).searchQueueBucket(e,t,i,r,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateQueueBucket(e,t,i,r){return QueueBucketServiceApiFp(this.configuration).updateQueueBucket(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const QueueHookServiceApiAxiosParamCreator=function(e){return{createQueueHook:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueHook.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteQueueHook:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueHook.");if(null==i)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(i))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...r.headers},{url:format(n),options:o}},patchQueueHook:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchQueueHook.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueueHook.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},readQueueHook:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueHook.");if(null==i)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(i))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...r.headers},{url:format(n),options:o}},searchQueueHook:async(t,i,r,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},A={},g={};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!==i&&(g.page=i),void 0!==r&&(g.size=r),void 0!==a&&(g.q=a),void 0!==n&&(g.sort=n),s&&(g.fields=s),o&&(g.id=o),u&&(g.schema_id=u),c&&(g.event=c),p.query={...p.query,...g,...l.query},delete p.search;let m=h&&h.headers?h.headers:{};return y.headers={...A,...m,...l.headers},{url:format(p),options:y}},updateQueueHook:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueHook.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueHook.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},QueueHookServiceApiFp=function(e){return{async createQueueHook(t,i,r){const a=await QueueHookServiceApiAxiosParamCreator(e).createQueueHook(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteQueueHook(t,i,r){const a=await QueueHookServiceApiAxiosParamCreator(e).deleteQueueHook(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async patchQueueHook(t,i,r,a){const n=await QueueHookServiceApiAxiosParamCreator(e).patchQueueHook(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async readQueueHook(t,i,r){const a=await QueueHookServiceApiAxiosParamCreator(e).readQueueHook(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchQueueHook(t,i,r,a,n,s,o,u,c,l){const d=await QueueHookServiceApiAxiosParamCreator(e).searchQueueHook(t,i,r,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const i={...d.options,url:t+d.url};return e.request(i)}},async updateQueueHook(t,i,r,a){const n=await QueueHookServiceApiAxiosParamCreator(e).updateQueueHook(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},QueueHookServiceApiFactory=function(e,t,i){return{createQueueHook:(r,a,n)=>QueueHookServiceApiFp(e).createQueueHook(r,a,n).then(e=>e(i,t)),deleteQueueHook:(r,a,n)=>QueueHookServiceApiFp(e).deleteQueueHook(r,a,n).then(e=>e(i,t)),patchQueueHook:(r,a,n,s)=>QueueHookServiceApiFp(e).patchQueueHook(r,a,n,s).then(e=>e(i,t)),readQueueHook:(r,a,n)=>QueueHookServiceApiFp(e).readQueueHook(r,a,n).then(e=>e(i,t)),searchQueueHook:(r,a,n,s,o,u,c,l,d,p)=>QueueHookServiceApiFp(e).searchQueueHook(r,a,n,s,o,u,c,l,d,p).then(e=>e(i,t)),updateQueueHook:(r,a,n,s)=>QueueHookServiceApiFp(e).updateQueueHook(r,a,n,s).then(e=>e(i,t))}};class QueueHookServiceApi extends BaseAPI{createQueueHook(e,t,i){return QueueHookServiceApiFp(this.configuration).createQueueHook(e,t,i).then(e=>e(this.axios,this.basePath))}deleteQueueHook(e,t,i){return QueueHookServiceApiFp(this.configuration).deleteQueueHook(e,t,i).then(e=>e(this.axios,this.basePath))}patchQueueHook(e,t,i,r){return QueueHookServiceApiFp(this.configuration).patchQueueHook(e,t,i,r).then(e=>e(this.axios,this.basePath))}readQueueHook(e,t,i){return QueueHookServiceApiFp(this.configuration).readQueueHook(e,t,i).then(e=>e(this.axios,this.basePath))}searchQueueHook(e,t,i,r,a,n,s,o,u,c){return QueueHookServiceApiFp(this.configuration).searchQueueHook(e,t,i,r,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}updateQueueHook(e,t,i,r){return QueueHookServiceApiFp(this.configuration).updateQueueHook(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const QueueResourcesServiceApiAxiosParamCreator=function(e){return{createQueueResourceGroup:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueResourceGroup.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteQueueResourceGroup:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueResourceGroup.");if(null==i)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(i))),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!==r&&(l.domain_id=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}},readQueueResourceGroup:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueResourceGroup.");if(null==i)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(i))),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.domain_id=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}},searchQueueResourceGroup:async(t,i,r,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!==i&&(y.page=i),void 0!==r&&(y.size=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...u.headers},{url:format(l),options:p}},updateQueueResourceGroup:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueResourceGroup.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueResourceGroup.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},QueueResourcesServiceApiFp=function(e){return{async createQueueResourceGroup(t,i,r){const a=await QueueResourcesServiceApiAxiosParamCreator(e).createQueueResourceGroup(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteQueueResourceGroup(t,i,r,a){const n=await QueueResourcesServiceApiAxiosParamCreator(e).deleteQueueResourceGroup(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async readQueueResourceGroup(t,i,r,a){const n=await QueueResourcesServiceApiAxiosParamCreator(e).readQueueResourceGroup(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async searchQueueResourceGroup(t,i,r,a,n,s,o,u){const c=await QueueResourcesServiceApiAxiosParamCreator(e).searchQueueResourceGroup(t,i,r,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const i={...c.options,url:t+c.url};return e.request(i)}},async updateQueueResourceGroup(t,i,r,a){const n=await QueueResourcesServiceApiAxiosParamCreator(e).updateQueueResourceGroup(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},QueueResourcesServiceApiFactory=function(e,t,i){return{createQueueResourceGroup:(r,a,n)=>QueueResourcesServiceApiFp(e).createQueueResourceGroup(r,a,n).then(e=>e(i,t)),deleteQueueResourceGroup:(r,a,n,s)=>QueueResourcesServiceApiFp(e).deleteQueueResourceGroup(r,a,n,s).then(e=>e(i,t)),readQueueResourceGroup:(r,a,n,s)=>QueueResourcesServiceApiFp(e).readQueueResourceGroup(r,a,n,s).then(e=>e(i,t)),searchQueueResourceGroup:(r,a,n,s,o,u,c,l)=>QueueResourcesServiceApiFp(e).searchQueueResourceGroup(r,a,n,s,o,u,c,l).then(e=>e(i,t)),updateQueueResourceGroup:(r,a,n,s)=>QueueResourcesServiceApiFp(e).updateQueueResourceGroup(r,a,n,s).then(e=>e(i,t))}};class QueueResourcesServiceApi extends BaseAPI{createQueueResourceGroup(e,t,i){return QueueResourcesServiceApiFp(this.configuration).createQueueResourceGroup(e,t,i).then(e=>e(this.axios,this.basePath))}deleteQueueResourceGroup(e,t,i,r){return QueueResourcesServiceApiFp(this.configuration).deleteQueueResourceGroup(e,t,i,r).then(e=>e(this.axios,this.basePath))}readQueueResourceGroup(e,t,i,r){return QueueResourcesServiceApiFp(this.configuration).readQueueResourceGroup(e,t,i,r).then(e=>e(this.axios,this.basePath))}searchQueueResourceGroup(e,t,i,r,a,n,s,o){return QueueResourcesServiceApiFp(this.configuration).searchQueueResourceGroup(e,t,i,r,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateQueueResourceGroup(e,t,i,r){return QueueResourcesServiceApiFp(this.configuration).updateQueueResourceGroup(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const QueueServiceApiAxiosParamCreator=function(e){return{createQueue:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createQueue.");const r=parse("/call_center/queues",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteQueue:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},patchQueue:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueue.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readQueue:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchQueue:async(t,i,r,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!==i&&(h.size=i),void 0!==r&&(h.q=r),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,i,r,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 A={method:"GET",...y,...p},g={},m={};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&&(m.page=t),void 0!==i&&(m.size=i),void 0!==r&&(m["joined_at.from"]=r),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 A.headers={...g,...f,...p.headers},{url:format(h),options:A}},updateQueue:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueue.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},QueueServiceApiFp=function(e){return{async createQueue(t,i){const r=await QueueServiceApiAxiosParamCreator(e).createQueue(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteQueue(t,i,r){const a=await QueueServiceApiAxiosParamCreator(e).deleteQueue(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async patchQueue(t,i,r){const a=await QueueServiceApiAxiosParamCreator(e).patchQueue(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readQueue(t,i,r){const a=await QueueServiceApiAxiosParamCreator(e).readQueue(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchQueue(t,i,r,a,n,s,o,u){const c=await QueueServiceApiAxiosParamCreator(e).searchQueue(t,i,r,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const i={...c.options,url:t+c.url};return e.request(i)}},async searchQueueReportGeneral(t,i,r,a,n,s,o,u,c,l,d,p){const h=await QueueServiceApiAxiosParamCreator(e).searchQueueReportGeneral(t,i,r,a,n,s,o,u,c,l,d,p);return(e=globalAxios,t=BASE_PATH)=>{const i={...h.options,url:t+h.url};return e.request(i)}},async updateQueue(t,i,r){const a=await QueueServiceApiAxiosParamCreator(e).updateQueue(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},QueueServiceApiFactory=function(e,t,i){return{createQueue:(r,a)=>QueueServiceApiFp(e).createQueue(r,a).then(e=>e(i,t)),deleteQueue:(r,a,n)=>QueueServiceApiFp(e).deleteQueue(r,a,n).then(e=>e(i,t)),patchQueue:(r,a,n)=>QueueServiceApiFp(e).patchQueue(r,a,n).then(e=>e(i,t)),readQueue:(r,a,n)=>QueueServiceApiFp(e).readQueue(r,a,n).then(e=>e(i,t)),searchQueue:(r,a,n,s,o,u,c,l)=>QueueServiceApiFp(e).searchQueue(r,a,n,s,o,u,c,l).then(e=>e(i,t)),searchQueueReportGeneral:(r,a,n,s,o,u,c,l,d,p,h,y)=>QueueServiceApiFp(e).searchQueueReportGeneral(r,a,n,s,o,u,c,l,d,p,h,y).then(e=>e(i,t)),updateQueue:(r,a,n)=>QueueServiceApiFp(e).updateQueue(r,a,n).then(e=>e(i,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,i){return QueueServiceApiFp(this.configuration).deleteQueue(e,t,i).then(e=>e(this.axios,this.basePath))}patchQueue(e,t,i){return QueueServiceApiFp(this.configuration).patchQueue(e,t,i).then(e=>e(this.axios,this.basePath))}readQueue(e,t,i){return QueueServiceApiFp(this.configuration).readQueue(e,t,i).then(e=>e(this.axios,this.basePath))}searchQueue(e,t,i,r,a,n,s,o){return QueueServiceApiFp(this.configuration).searchQueue(e,t,i,r,a,n,s,o).then(e=>e(this.axios,this.basePath))}searchQueueReportGeneral(e,t,i,r,a,n,s,o,u,c,l,d){return QueueServiceApiFp(this.configuration).searchQueueReportGeneral(e,t,i,r,a,n,s,o,u,c,l,d).then(e=>e(this.axios,this.basePath))}updateQueue(e,t,i){return QueueServiceApiFp(this.configuration).updateQueue(e,t,i).then(e=>e(this.axios,this.basePath))}}const QueueSkillServiceApiAxiosParamCreator=function(e){return{createQueueSkill:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueSkill.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},deleteQueueSkill:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueSkill.");if(null==i)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(i))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...r.headers},{url:format(n),options:o}},patchQueueSkill:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchQueueSkill.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueueSkill.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},readQueueSkill:async(t,i,r={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueSkill.");if(null==i)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(i))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...r.headers},{url:format(n),options:o}},searchQueueSkill:async(t,i,r,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 A="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(t))),g=parse(A,!0);let m;e&&(m=e.baseOptions);const f={method:"GET",...m,...y},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!==i&&(S.page=i),void 0!==r&&(S.size=r),void 0!==a&&(S.q=a),void 0!==n&&(S.sort=n),s&&(S.fields=s),o&&(S.id=o),u&&(S.skill_id=u),c&&(S.bucket_id=c),l&&(S.lvl=l),d&&(S.min_capacity=d),p&&(S.max_capacity=p),void 0!==h&&(S.enabled=h),g.query={...g.query,...S,...y.query},delete g.search;let w=m&&m.headers?m.headers:{};return f.headers={...b,...w,...y.headers},{url:format(g),options:f}},updateQueueSkill:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueSkill.");if(null==i)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueSkill.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}}}},QueueSkillServiceApiFp=function(e){return{async createQueueSkill(t,i,r){const a=await QueueSkillServiceApiAxiosParamCreator(e).createQueueSkill(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async deleteQueueSkill(t,i,r){const a=await QueueSkillServiceApiAxiosParamCreator(e).deleteQueueSkill(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async patchQueueSkill(t,i,r,a){const n=await QueueSkillServiceApiAxiosParamCreator(e).patchQueueSkill(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async readQueueSkill(t,i,r){const a=await QueueSkillServiceApiAxiosParamCreator(e).readQueueSkill(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchQueueSkill(t,i,r,a,n,s,o,u,c,l,d,p,h,y){const A=await QueueSkillServiceApiAxiosParamCreator(e).searchQueueSkill(t,i,r,a,n,s,o,u,c,l,d,p,h,y);return(e=globalAxios,t=BASE_PATH)=>{const i={...A.options,url:t+A.url};return e.request(i)}},async updateQueueSkill(t,i,r,a){const n=await QueueSkillServiceApiAxiosParamCreator(e).updateQueueSkill(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}}}},QueueSkillServiceApiFactory=function(e,t,i){return{createQueueSkill:(r,a,n)=>QueueSkillServiceApiFp(e).createQueueSkill(r,a,n).then(e=>e(i,t)),deleteQueueSkill:(r,a,n)=>QueueSkillServiceApiFp(e).deleteQueueSkill(r,a,n).then(e=>e(i,t)),patchQueueSkill:(r,a,n,s)=>QueueSkillServiceApiFp(e).patchQueueSkill(r,a,n,s).then(e=>e(i,t)),readQueueSkill:(r,a,n)=>QueueSkillServiceApiFp(e).readQueueSkill(r,a,n).then(e=>e(i,t)),searchQueueSkill:(r,a,n,s,o,u,c,l,d,p,h,y,A,g)=>QueueSkillServiceApiFp(e).searchQueueSkill(r,a,n,s,o,u,c,l,d,p,h,y,A,g).then(e=>e(i,t)),updateQueueSkill:(r,a,n,s)=>QueueSkillServiceApiFp(e).updateQueueSkill(r,a,n,s).then(e=>e(i,t))}};class QueueSkillServiceApi extends BaseAPI{createQueueSkill(e,t,i){return QueueSkillServiceApiFp(this.configuration).createQueueSkill(e,t,i).then(e=>e(this.axios,this.basePath))}deleteQueueSkill(e,t,i){return QueueSkillServiceApiFp(this.configuration).deleteQueueSkill(e,t,i).then(e=>e(this.axios,this.basePath))}patchQueueSkill(e,t,i,r){return QueueSkillServiceApiFp(this.configuration).patchQueueSkill(e,t,i,r).then(e=>e(this.axios,this.basePath))}readQueueSkill(e,t,i){return QueueSkillServiceApiFp(this.configuration).readQueueSkill(e,t,i).then(e=>e(this.axios,this.basePath))}searchQueueSkill(e,t,i,r,a,n,s,o,u,c,l,d,p,h){return QueueSkillServiceApiFp(this.configuration).searchQueueSkill(e,t,i,r,a,n,s,o,u,c,l,d,p,h).then(e=>e(this.axios,this.basePath))}updateQueueSkill(e,t,i,r){return QueueSkillServiceApiFp(this.configuration).updateQueueSkill(e,t,i,r).then(e=>e(this.axios,this.basePath))}}const RegionServiceApiAxiosParamCreator=function(e){return{createRegion:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRegion.");const r=parse("/regions",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteRegion:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteRegion.");const r="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},patchRegion:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchRegion.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readRegion:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readRegion.");const r="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},searchRegion:async(t,i,r,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={},A={};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&&(A.page=t),void 0!==i&&(A.size=i),void 0!==r&&(A.q=r),void 0!==a&&(A.sort=a),n&&(A.fields=n),s&&(A.id=s),void 0!==o&&(A.name=o),void 0!==u&&(A.description=u),c&&(A.timezone_id=c),d.query={...d.query,...A,...l.query},delete d.search;let g=p&&p.headers?p.headers:{};return h.headers={...y,...g,...l.headers},{url:format(d),options:h}},updateRegion:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRegion.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},RegionServiceApiFp=function(e){return{async createRegion(t,i){const r=await RegionServiceApiAxiosParamCreator(e).createRegion(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteRegion(t,i){const r=await RegionServiceApiAxiosParamCreator(e).deleteRegion(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async patchRegion(t,i,r){const a=await RegionServiceApiAxiosParamCreator(e).patchRegion(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readRegion(t,i){const r=await RegionServiceApiAxiosParamCreator(e).readRegion(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async searchRegion(t,i,r,a,n,s,o,u,c,l){const d=await RegionServiceApiAxiosParamCreator(e).searchRegion(t,i,r,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const i={...d.options,url:t+d.url};return e.request(i)}},async updateRegion(t,i,r){const a=await RegionServiceApiAxiosParamCreator(e).updateRegion(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},RegionServiceApiFactory=function(e,t,i){return{createRegion:(r,a)=>RegionServiceApiFp(e).createRegion(r,a).then(e=>e(i,t)),deleteRegion:(r,a)=>RegionServiceApiFp(e).deleteRegion(r,a).then(e=>e(i,t)),patchRegion:(r,a,n)=>RegionServiceApiFp(e).patchRegion(r,a,n).then(e=>e(i,t)),readRegion:(r,a)=>RegionServiceApiFp(e).readRegion(r,a).then(e=>e(i,t)),searchRegion:(r,a,n,s,o,u,c,l,d,p)=>RegionServiceApiFp(e).searchRegion(r,a,n,s,o,u,c,l,d,p).then(e=>e(i,t)),updateRegion:(r,a,n)=>RegionServiceApiFp(e).updateRegion(r,a,n).then(e=>e(i,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,i){return RegionServiceApiFp(this.configuration).patchRegion(e,t,i).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,i,r,a,n,s,o,u,c){return RegionServiceApiFp(this.configuration).searchRegion(e,t,i,r,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}updateRegion(e,t,i){return RegionServiceApiFp(this.configuration).updateRegion(e,t,i).then(e=>e(this.axios,this.basePath))}}const RoutingChatPlanServiceApiAxiosParamCreator=function(e){return{createChatPlan:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createChatPlan.");const r=parse("/routing/outbound/chat",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteChatPlan:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteChatPlan.");const r="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},patchChatPlan:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchChatPlan.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readChatPlan:async(t,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readChatPlan.");const r="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}},searchChatPlan:async(t,i,r,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!==i&&(y.size=i),void 0!==r&&(y.q=r),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 A=d&&d.headers?d.headers:{};return p.headers={...h,...A,...c.headers},{url:format(l),options:p}},updateChatPlan:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateChatPlan.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},RoutingChatPlanServiceApiFp=function(e){return{async createChatPlan(t,i){const r=await RoutingChatPlanServiceApiAxiosParamCreator(e).createChatPlan(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteChatPlan(t,i){const r=await RoutingChatPlanServiceApiAxiosParamCreator(e).deleteChatPlan(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async patchChatPlan(t,i,r){const a=await RoutingChatPlanServiceApiAxiosParamCreator(e).patchChatPlan(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readChatPlan(t,i){const r=await RoutingChatPlanServiceApiAxiosParamCreator(e).readChatPlan(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async searchChatPlan(t,i,r,a,n,s,o,u,c){const l=await RoutingChatPlanServiceApiAxiosParamCreator(e).searchChatPlan(t,i,r,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const i={...l.options,url:t+l.url};return e.request(i)}},async updateChatPlan(t,i,r){const a=await RoutingChatPlanServiceApiAxiosParamCreator(e).updateChatPlan(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},RoutingChatPlanServiceApiFactory=function(e,t,i){return{createChatPlan:(r,a)=>RoutingChatPlanServiceApiFp(e).createChatPlan(r,a).then(e=>e(i,t)),deleteChatPlan:(r,a)=>RoutingChatPlanServiceApiFp(e).deleteChatPlan(r,a).then(e=>e(i,t)),patchChatPlan:(r,a,n)=>RoutingChatPlanServiceApiFp(e).patchChatPlan(r,a,n).then(e=>e(i,t)),readChatPlan:(r,a)=>RoutingChatPlanServiceApiFp(e).readChatPlan(r,a).then(e=>e(i,t)),searchChatPlan:(r,a,n,s,o,u,c,l,d)=>RoutingChatPlanServiceApiFp(e).searchChatPlan(r,a,n,s,o,u,c,l,d).then(e=>e(i,t)),updateChatPlan:(r,a,n)=>RoutingChatPlanServiceApiFp(e).updateChatPlan(r,a,n).then(e=>e(i,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,i){return RoutingChatPlanServiceApiFp(this.configuration).patchChatPlan(e,t,i).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,i,r,a,n,s,o,u){return RoutingChatPlanServiceApiFp(this.configuration).searchChatPlan(e,t,i,r,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateChatPlan(e,t,i){return RoutingChatPlanServiceApiFp(this.configuration).updateChatPlan(e,t,i).then(e=>e(this.axios,this.basePath))}}const RoutingOutboundCallServiceApiAxiosParamCreator=function(e){return{createRoutingOutboundCall:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRoutingOutboundCall.");const r=parse("/routing/outbound/calls",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteRoutingOutboundCall:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},movePositionRoutingOutboundCall:async(t,i,r,a={})=>{if(null==t)throw new RequiredError("fromId","Required parameter fromId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==i)throw new RequiredError("toId","Required parameter toId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==r)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(i))),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 r||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(s),options:u}},patchRoutingOutboundCall:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchRoutingOutboundCall.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readRoutingOutboundCall:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchRoutingOutboundCall:async(t,i,r,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},A={},g={};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&&(g.page=t),void 0!==i&&(g.size=i),void 0!==r&&(g.q=r),void 0!==a&&(g.sort=a),n&&(g.fields=n),s&&(g.id=s),void 0!==o&&(g.name=o),u&&(g.schema_id=u),void 0!==c&&(g.pattern=c),void 0!==l&&(g.description=l),p.query={...p.query,...g,...d.query},delete p.search;let m=h&&h.headers?h.headers:{};return y.headers={...A,...m,...d.headers},{url:format(p),options:y}},updateRoutingOutboundCall:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRoutingOutboundCall.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},RoutingOutboundCallServiceApiFp=function(e){return{async createRoutingOutboundCall(t,i){const r=await RoutingOutboundCallServiceApiAxiosParamCreator(e).createRoutingOutboundCall(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteRoutingOutboundCall(t,i,r){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).deleteRoutingOutboundCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async movePositionRoutingOutboundCall(t,i,r,a){const n=await RoutingOutboundCallServiceApiAxiosParamCreator(e).movePositionRoutingOutboundCall(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async patchRoutingOutboundCall(t,i,r){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).patchRoutingOutboundCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readRoutingOutboundCall(t,i,r){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).readRoutingOutboundCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchRoutingOutboundCall(t,i,r,a,n,s,o,u,c,l,d){const p=await RoutingOutboundCallServiceApiAxiosParamCreator(e).searchRoutingOutboundCall(t,i,r,a,n,s,o,u,c,l,d);return(e=globalAxios,t=BASE_PATH)=>{const i={...p.options,url:t+p.url};return e.request(i)}},async updateRoutingOutboundCall(t,i,r){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).updateRoutingOutboundCall(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},RoutingOutboundCallServiceApiFactory=function(e,t,i){return{createRoutingOutboundCall:(r,a)=>RoutingOutboundCallServiceApiFp(e).createRoutingOutboundCall(r,a).then(e=>e(i,t)),deleteRoutingOutboundCall:(r,a,n)=>RoutingOutboundCallServiceApiFp(e).deleteRoutingOutboundCall(r,a,n).then(e=>e(i,t)),movePositionRoutingOutboundCall:(r,a,n,s)=>RoutingOutboundCallServiceApiFp(e).movePositionRoutingOutboundCall(r,a,n,s).then(e=>e(i,t)),patchRoutingOutboundCall:(r,a,n)=>RoutingOutboundCallServiceApiFp(e).patchRoutingOutboundCall(r,a,n).then(e=>e(i,t)),readRoutingOutboundCall:(r,a,n)=>RoutingOutboundCallServiceApiFp(e).readRoutingOutboundCall(r,a,n).then(e=>e(i,t)),searchRoutingOutboundCall:(r,a,n,s,o,u,c,l,d,p,h)=>RoutingOutboundCallServiceApiFp(e).searchRoutingOutboundCall(r,a,n,s,o,u,c,l,d,p,h).then(e=>e(i,t)),updateRoutingOutboundCall:(r,a,n)=>RoutingOutboundCallServiceApiFp(e).updateRoutingOutboundCall(r,a,n).then(e=>e(i,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,i){return RoutingOutboundCallServiceApiFp(this.configuration).deleteRoutingOutboundCall(e,t,i).then(e=>e(this.axios,this.basePath))}movePositionRoutingOutboundCall(e,t,i,r){return RoutingOutboundCallServiceApiFp(this.configuration).movePositionRoutingOutboundCall(e,t,i,r).then(e=>e(this.axios,this.basePath))}patchRoutingOutboundCall(e,t,i){return RoutingOutboundCallServiceApiFp(this.configuration).patchRoutingOutboundCall(e,t,i).then(e=>e(this.axios,this.basePath))}readRoutingOutboundCall(e,t,i){return RoutingOutboundCallServiceApiFp(this.configuration).readRoutingOutboundCall(e,t,i).then(e=>e(this.axios,this.basePath))}searchRoutingOutboundCall(e,t,i,r,a,n,s,o,u,c,l){return RoutingOutboundCallServiceApiFp(this.configuration).searchRoutingOutboundCall(e,t,i,r,a,n,s,o,u,c,l).then(e=>e(this.axios,this.basePath))}updateRoutingOutboundCall(e,t,i){return RoutingOutboundCallServiceApiFp(this.configuration).updateRoutingOutboundCall(e,t,i).then(e=>e(this.axios,this.basePath))}}const RoutingSchemaServiceApiAxiosParamCreator=function(e){return{createRoutingSchema:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRoutingSchema.");const r=parse("/routing/schema",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteRoutingSchema:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},patchRoutingSchema:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchRoutingSchema.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}},readRoutingSchema:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchRoutingSchema:async(t,i,r,a,n,s,o,u,c,l={})=>{const d=parse("/routing/schema",!0);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...l},y={},A={};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&&(A.page=t),void 0!==i&&(A.size=i),void 0!==r&&(A.q=r),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),d.query={...d.query,...A,...l.query},delete d.search;let g=p&&p.headers?p.headers:{};return h.headers={...y,...g,...l.headers},{url:format(d),options:h}},updateRoutingSchema:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRoutingSchema.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},RoutingSchemaServiceApiFp=function(e){return{async createRoutingSchema(t,i){const r=await RoutingSchemaServiceApiAxiosParamCreator(e).createRoutingSchema(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteRoutingSchema(t,i,r){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).deleteRoutingSchema(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async patchRoutingSchema(t,i,r){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).patchRoutingSchema(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readRoutingSchema(t,i,r){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).readRoutingSchema(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchRoutingSchema(t,i,r,a,n,s,o,u,c,l){const d=await RoutingSchemaServiceApiAxiosParamCreator(e).searchRoutingSchema(t,i,r,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const i={...d.options,url:t+d.url};return e.request(i)}},async updateRoutingSchema(t,i,r){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).updateRoutingSchema(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},RoutingSchemaServiceApiFactory=function(e,t,i){return{createRoutingSchema:(r,a)=>RoutingSchemaServiceApiFp(e).createRoutingSchema(r,a).then(e=>e(i,t)),deleteRoutingSchema:(r,a,n)=>RoutingSchemaServiceApiFp(e).deleteRoutingSchema(r,a,n).then(e=>e(i,t)),patchRoutingSchema:(r,a,n)=>RoutingSchemaServiceApiFp(e).patchRoutingSchema(r,a,n).then(e=>e(i,t)),readRoutingSchema:(r,a,n)=>RoutingSchemaServiceApiFp(e).readRoutingSchema(r,a,n).then(e=>e(i,t)),searchRoutingSchema:(r,a,n,s,o,u,c,l,d,p)=>RoutingSchemaServiceApiFp(e).searchRoutingSchema(r,a,n,s,o,u,c,l,d,p).then(e=>e(i,t)),updateRoutingSchema:(r,a,n)=>RoutingSchemaServiceApiFp(e).updateRoutingSchema(r,a,n).then(e=>e(i,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,i){return RoutingSchemaServiceApiFp(this.configuration).deleteRoutingSchema(e,t,i).then(e=>e(this.axios,this.basePath))}patchRoutingSchema(e,t,i){return RoutingSchemaServiceApiFp(this.configuration).patchRoutingSchema(e,t,i).then(e=>e(this.axios,this.basePath))}readRoutingSchema(e,t,i){return RoutingSchemaServiceApiFp(this.configuration).readRoutingSchema(e,t,i).then(e=>e(this.axios,this.basePath))}searchRoutingSchema(e,t,i,r,a,n,s,o,u,c){return RoutingSchemaServiceApiFp(this.configuration).searchRoutingSchema(e,t,i,r,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}updateRoutingSchema(e,t,i){return RoutingSchemaServiceApiFp(this.configuration).updateRoutingSchema(e,t,i).then(e=>e(this.axios,this.basePath))}}const RoutingVariableServiceApiAxiosParamCreator=function(e){return{createRoutingVariable:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRoutingVariable.");const r=parse("/routing/variables",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteRoutingVariable:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readRoutingVariable:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchRoutingVariable:async(t,i,r,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!==i&&(c.size=i),void 0!==r&&(c.domain_id=r),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,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRoutingVariable.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},RoutingVariableServiceApiFp=function(e){return{async createRoutingVariable(t,i){const r=await RoutingVariableServiceApiAxiosParamCreator(e).createRoutingVariable(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteRoutingVariable(t,i,r){const a=await RoutingVariableServiceApiAxiosParamCreator(e).deleteRoutingVariable(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readRoutingVariable(t,i,r){const a=await RoutingVariableServiceApiAxiosParamCreator(e).readRoutingVariable(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchRoutingVariable(t,i,r,a){const n=await RoutingVariableServiceApiAxiosParamCreator(e).searchRoutingVariable(t,i,r,a);return(e=globalAxios,t=BASE_PATH)=>{const i={...n.options,url:t+n.url};return e.request(i)}},async updateRoutingVariable(t,i,r){const a=await RoutingVariableServiceApiAxiosParamCreator(e).updateRoutingVariable(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},RoutingVariableServiceApiFactory=function(e,t,i){return{createRoutingVariable:(r,a)=>RoutingVariableServiceApiFp(e).createRoutingVariable(r,a).then(e=>e(i,t)),deleteRoutingVariable:(r,a,n)=>RoutingVariableServiceApiFp(e).deleteRoutingVariable(r,a,n).then(e=>e(i,t)),readRoutingVariable:(r,a,n)=>RoutingVariableServiceApiFp(e).readRoutingVariable(r,a,n).then(e=>e(i,t)),searchRoutingVariable:(r,a,n,s)=>RoutingVariableServiceApiFp(e).searchRoutingVariable(r,a,n,s).then(e=>e(i,t)),updateRoutingVariable:(r,a,n)=>RoutingVariableServiceApiFp(e).updateRoutingVariable(r,a,n).then(e=>e(i,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,i){return RoutingVariableServiceApiFp(this.configuration).deleteRoutingVariable(e,t,i).then(e=>e(this.axios,this.basePath))}readRoutingVariable(e,t,i){return RoutingVariableServiceApiFp(this.configuration).readRoutingVariable(e,t,i).then(e=>e(this.axios,this.basePath))}searchRoutingVariable(e,t,i,r){return RoutingVariableServiceApiFp(this.configuration).searchRoutingVariable(e,t,i,r).then(e=>e(this.axios,this.basePath))}updateRoutingVariable(e,t,i){return RoutingVariableServiceApiFp(this.configuration).updateRoutingVariable(e,t,i).then(e=>e(this.axios,this.basePath))}}const SkillServiceApiAxiosParamCreator=function(e){return{createSkill:async(t,i={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createSkill.");const r=parse("/call_center/skills",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...i},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",r.query={...r.query,...i.query},delete r.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...i.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(r),options:n}},deleteSkill:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},readSkill:async(t,i,r={})=>{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,...r},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!==i&&(c.domain_id=i),n.query={...n.query,...c,...r.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...r.headers},{url:format(n),options:o}},searchSkill:async(t,i,r,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!==i&&(p.size=i),void 0!==r&&(p.q=r),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}},updateSkill:async(t,i,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateSkill.");if(null==i)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,...r},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,...r.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...r.headers};const l="string"!=typeof i||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(n),options:o}}}},SkillServiceApiFp=function(e){return{async createSkill(t,i){const r=await SkillServiceApiAxiosParamCreator(e).createSkill(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}},async deleteSkill(t,i,r){const a=await SkillServiceApiAxiosParamCreator(e).deleteSkill(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async readSkill(t,i,r){const a=await SkillServiceApiAxiosParamCreator(e).readSkill(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}},async searchSkill(t,i,r,a,n,s,o){const u=await SkillServiceApiAxiosParamCreator(e).searchSkill(t,i,r,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const i={...u.options,url:t+u.url};return e.request(i)}},async updateSkill(t,i,r){const a=await SkillServiceApiAxiosParamCreator(e).updateSkill(t,i,r);return(e=globalAxios,t=BASE_PATH)=>{const i={...a.options,url:t+a.url};return e.request(i)}}}},SkillServiceApiFactory=function(e,t,i){return{createSkill:(r,a)=>SkillServiceApiFp(e).createSkill(r,a).then(e=>e(i,t)),deleteSkill:(r,a,n)=>SkillServiceApiFp(e).deleteSkill(r,a,n).then(e=>e(i,t)),readSkill:(r,a,n)=>SkillServiceApiFp(e).readSkill(r,a,n).then(e=>e(i,t)),searchSkill:(r,a,n,s,o,u,c)=>SkillServiceApiFp(e).searchSkill(r,a,n,s,o,u,c).then(e=>e(i,t)),updateSkill:(r,a,n)=>SkillServiceApiFp(e).updateSkill(r,a,n).then(e=>e(i,t))}};class SkillServiceApi extends BaseAPI{createSkill(e,t){return SkillServiceApiFp(this.configuration).createSkill(e,t).then(e=>e(this.axios,this.basePath))}deleteSkill(e,t,i){return SkillServiceApiFp(this.configuration).deleteSkill(e,t,i).then(e=>e(this.axios,this.basePath))}readSkill(e,t,i){return SkillServiceApiFp(this.configuration).readSkill(e,t,i).then(e=>e(this.axios,this.basePath))}searchSkill(e,t,i,r,a,n,s){return SkillServiceApiFp(this.configuration).searchSkill(e,t,i,r,a,n,s).then(e=>e(this.axios,this.basePath))}updateSkill(e,t,i){return SkillServiceApiFp(this.configuration).updateSkill(e,t,i).then(e=>e(this.axios,this.basePath))}}const UserHelperServiceApiAxiosParamCreator=function(e){return{defaultDeviceConfig:async(t,i={})=>{if(null==t)throw new RequiredError("type","Required parameter type was null or undefined when calling defaultDeviceConfig.");const r="/user/device/config/{type}".replace("{type}",encodeURIComponent(String(t))),a=parse(r,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...i},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,...i.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...i.headers},{url:format(a),options:s}}}},UserHelperServiceApiFp=function(e){return{async defaultDeviceConfig(t,i){const r=await UserHelperServiceApiAxiosParamCreator(e).defaultDeviceConfig(t,i);return(e=globalAxios,t=BASE_PATH)=>{const i={...r.options,url:t+r.url};return e.request(i)}}}},UserHelperServiceApiFactory=function(e,t,i){return{defaultDeviceConfig:(r,a)=>UserHelperServiceApiFp(e).defaultDeviceConfig(r,a).then(e=>e(i,t))}};class UserHelperServiceApi extends BaseAPI{defaultDeviceConfig(e,t){return UserHelperServiceApiFp(this.configuration).defaultDeviceConfig(e,t).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 ProtobufNullValue,StorageImportSourceType,StorageProviderType,StorageServiceType,StorageUploadStatusCode;!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"}(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={}));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,i){i.length>0?console[e](t,...i):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,t?debug.enable("*"):debug.disable(),this.log=new Log,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 i=this.sessionCache.get(e),r=await this.callOption(t);return i.answer(r)}return!1}async call(e){const t={};let i=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 r=await this.callOption(t);e.params&&e.params.display&&(i={extraHeaders:[`X-Webitel-Display: ${e.params.display}`]}),await this.ua.call(e.destination,{...r,...i})}async register(e){const t=new WebSocketInterface(e.server),i={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},r=this.ua=new UA(i);r.on("newRTCSession",e=>{const t=e.session,i=t.id,r=new Session(e);this.storeSession(i,r),t.on("connecting",()=>{this.emit("localStreams",r,t.connection.getLocalStreams())}),t.connection&&t.connection.addEventListener("addstream",e=>{this.emit("peerStreams",r,new Array(e.stream))}),t.on("peerconnection",e=>{e.peerconnection.addEventListener("addstream",async e=>{this.emit("peerStreams",r,new Array(e.stream))})}),t.on("ended",()=>{this.removeSession(i,t.connection)}),t.on("failed",()=>{this.removeSession(i,t.connection)}),t.on("accepted",()=>{r.incoming||this.emit("peerStreams",r,t.connection.getRemoteStreams())}),t.on("confirmed",()=>{}),this.emit("newSession",r)}),r.on("disconnected",e=>{this.emit("unregistered")}),r.on("unregistered",e=>{this.emit("unregistered")}),r.on("registrationFailed",e=>{this.log.error("registrationFailed",e)}),r.on("registered",e=>{this.emit("registered")}),r.start()}async unregister(){this.ua&&(this.ua.terminateSessions(),this.ua.removeAllListeners(),await this.ua.stop(),delete this.ua)}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(),i=t.getRemoteStreams();e&&e.forEach(e=>{e.getTracks().forEach(e=>{e.stop()})}),i&&i.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 i=await this.getUserMedia(e.audio,e.video);t?i.getTracks().forEach(e=>{t.addTrack(e)}):t=i}if(!t)throw new Error("bad stream request");return t}async getUserMedia(e,t){return new Promise(async(i,r)=>{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(i).catch(r)})}}async function getMediaStream(e){return new Promise((t,i)=>{if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)navigator.mediaDevices.getUserMedia(e).then(e=>t(e)).catch(e=>i(e));else{(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)(e,e=>t(e),e=>i(e))}})}SipPhone.userAgent="Webitel-Phone/0.0.1";const getVersion=()=>'"0.1.136"';var JobState,ChannelName,AgentStatus,ChannelState,ChannelType,CallReportingStatus,CallActions,CallDirection,version='"0.1.136"';!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,i){this.client=e,this.distribute=i,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.communication=i.communication,this.history=[i]}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()}setOffering(e){this.offeringAt=e.timestamp}setBridged(e){this.bridgedAt=e.timestamp,this.lastStatusChange=Date.now(),e.form&&(this.form=e.form)}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}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 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");return this.client.request("cc_form_action",{attempt_id:this.id,app_id:this.distribute.app_id,action:e,fields:t})}}!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._channel=t.channels[0],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[this._channel]}get channel(){return this._channel}get stateDuration(){return Math.round((Date.now()-this.lastStatusChange)/1e3)}onChannelEvent(e){let t;switch(e.status){case ChannelState.Distribute:const i=e;if(!i)throw new Error("bad event");if(t=new Task(this.client,e,i.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 i=this.client.conversationById(t.agentChannelId);i&&!i.task&&(i.task=t)}break;case ChannelState.Offering:const r=e;(t=this.task.get(e.attempt_id))&&(t.setOffering(r),r.offering.auto_answer&&t.channel===ChannelType.Job&&t.accept().catch(e=>{this.client.emit("error",e)}));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 i=e;if(!i)throw new Error("bad event");return t.setMissed(),this.setChannelStateTimeout(e.channel,e,i.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 i=e;if(!i)throw new Error("bad event");if(t=this.task.get(e.attempt_id))return t.setProcessing(e.timestamp,i.processing),this.setChannelStateTimeout(e.channel,e,i.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.channel,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){return this.client.agentSetPause(this.agentId,e)}async offline(){return this.client.agentSetOffline(this.agentId)}setStatus(e){e.status===AgentStatus.Online&&(this.info.on_demand=e.on_demand||!1,this._channel=e.channels[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,i){return this.client.request("cc_fetch_offline_members",{agent_id:this.agentId,page:t,q:e,per_page:i})}hasTask(e){return this.task.has(e.id)}setChannelState(e,t){this._channel.channel=e||null,this._channel.state=t.status,this._channel.joined_at=t.timestamp,this._channel.timeout=void 0}setChannelStateTimeout(e,t,i){this._channel.channel=e||null,this._channel.state=t.status,this._channel.timeout=i,this._channel.joined_at=t.timestamp}}!function(e){e.Abandoned="abandoned",e.Cancel="cancel",e.Success="success"}(CallReportingStatus||(CallReportingStatus={})),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"}(CallActions||(CallActions={})),function(e){e.Inbound="inbound",e.Outbound="outbound"}(CallDirection||(CallDirection={}));class Call{constructor(e,t){this.client=e;const i=t.data;this._muted=!1,this.voice=!0,this.createdAt=+t.timestamp,this.task=null,this.data=null,this.answeredAt=0,this.hangupAt=0,this.bridgedAt=0,this.reportingAt=0,this.autoAnswered=!1,this.peerStreams=[],this.localStreams=[],e.phone&&(i.sip_id?this.setSip(e.phone.sipSessionBySipId(i.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(i),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}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)}setActive(e){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)}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.params&&!0===this.params.autoAnswer}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,t){this.autoAnswered||(this.autoAnswered=!0,setTimeout(async()=>{await this.answer(e)},t))}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 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){return 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){return this.client.request("call_bridge",{from_id:this.id,from_app_id:this.appId,to_id:e.id,to_app_id:e.appId})}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 i=Math.ceil(e.length/t),r=new Array(i);let a=0;for(let n=0;n<i;n++)r[n]=e.substr(a,t),a+=t;return r}const maxSizeMessage=4096;var ChatActions,ConversationState;!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"}(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,i,r,a,n){this.client=e,this.conversationId=t,this.title=i,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.members=(r||[]).map(e=>wrapChannelMember(e)),this._messages=a||[],this.state=ConversationState.Invite,this.variables={},this._hasReporting=!(!n||"true"!==n.cc_reporting),this._autoAnswer=!1;for(const e in n)!e.startsWith("cc_")&&n.hasOwnProperty(e)&&("wbt_auto_answer"===e?this._autoAnswer="true"===n.wbt_auto_answer:this.variables[e]=n[e]);n&&n.hasOwnProperty("cc_attempt_id")&&this.client.agent&&(this.task=this.client.agent.task.get(+n.cc_attempt_id)||null)}setInvite(e,t){this.inviteId=e,this.invitedAt=t,this._autoAnswer&&this.join().catch(e=>{this.client.emit("error",e)})}setAnswered(e,t,i){this.state=ConversationState.Active,this.answeredAt=t,this.channelId=e,this.member=wrapChannelMember(i),this.inviteId=null}setClosed(e){this.state=ConversationState.Closed,this.closedAt=e}get id(){return this.channelId||this.inviteId||this.conversationId}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.url=this.client.fileUrlDownload(e.file.id),e.file.streamUrl=this.client.fileUrlStream(e.file.id),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}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}async decline(){if(!this.inviteId)throw new Error("This conversation is joined");return this.client.request("decline_chat",{invite_id:this.inviteId})}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 this.client.request("leave_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:e})}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 i=(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:i.id,name:e.name,mime:i.mime,url:i.shared,size:i.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}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";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}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",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)}`}async connect(){await this.connectToSocket()}async disconnect(){this.socket.close()}async subscribeCall(e,t){const i=await this.request("subscribe_call",t);if(this.eventHandler.on(WEBSOCKET_EVENT_CALL,e),i.items&&i.items.length)for(const e of i.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}},i=new Call(this,t);i.createdAt=e.created_at,i.answeredAt=e.answered_at||0,i.bridgedAt=e.bridged_at||0,i.hangupAt=e.hangup_at||0,e.task&&(i.task=new Task(this,{attempt_id:e.task.attempt_id,channel:e.task.channel,status:e.task.status,timestamp:Date.now()},e.task),i.queue.reporting="true",i.task.form=e.task.form||null,e.leaving_at&&e.task.processing_sec&&(i.task.startProcessingAt=e.leaving_at,i.task.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}))),this.callStore.set(i.id,i)}return i}async subscribeChat(e,t){const i=await this.request("subscribe_chat",t);if(this.eventHandler.on(WEBSOCKET_EVENT_CHAT,e),i&&i.items)for(const e of i.items){const t=e.messages.reverse(),i=new Conversation(this,e.id,e.title,e.members,t,e.variables);if(i.createdAt=e.created_at,i.closedAt=e.closed_at,e.task&&(i.task=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&&(i.task.startProcessingAt=e.leaving_at,i.task.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})),i.task.form=e.task.form||null),e.invite_id)i.setInvite(e.invite_id,e.created_at);else{if(!e.channel_id){this.log.error(`conversation ${e.id} not valid`);continue}i.setAnswered(e.channel_id,e.joined_at,{id:e.channel_id,name:"TODO",type:"webitel"})}this.conversationStore.set(i.id,i)}return i}async subscribeUsersStatus(e,t){const i=await this.request("subscribe_users_status",t);return this.eventHandler.on(WEBSOCKET_EVENT_USER_STATE,e),i}async subscribeAgentsStatus(e,t){const i=await this.request("cc_agent_subscribe_status",t);return this.eventHandler.on(WEBSOCKET_EVENT_AGENT_STATUS,e),i}subscribeTask(e){this.eventHandler.on(TASK_EVENT,e)}subscribeJob(e){this.eventHandler.on(JOB_EVENT,e)}async unSubscribe(e,t,i){return this.request(`un_subscribe_${e}`,i)}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(){return this.request(WEBSOCKET_AUTHENTICATION_CHALLENGE,{token:this._config.token})}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}get instanceId(){return this.connectionInfo.sock_id}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,i){return this.request("cc_agent_online",{agent_id:e,channels:t,on_demand:i})}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 i=this.callById(e);if(i)return i.answer(t)}request(e,t){return new Promise((i,r)=>{this.queueRequest.set(++this.reqSeq,{resolve:i,reject:r}),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)}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.phone.on("peerStreams",(e,t)=>{const i=this.callBySession(e);i&&!i.peerStreams.length&&(i.setPeerStreams(t),this.eventHandler.emit(WEBSOCKET_EVENT_CALL,CallActions.PeerStream,i))}),this.phone.on("localStreams",(e,t)=>{const i=this.callBySession(e);i&&!i.localStreams.length&&(i.setLocalStreams(t),this.eventHandler.emit(WEBSOCKET_EVENT_CALL,CallActions.LocalStream,i))}),this.phone.on("newSession",this.onNewCallSession.bind(this));try{const e=await this.deviceConfig(this.phone.type);await this.phone.register(e)}catch(e){this.log.error(e)}}async deviceConfig(e){return this.request(WEBSOCKET_DEFAULT_DEVICE_CONFIG,{name:e})}async storeFile(e,t,i){if(!t||t.length<1)throw new Error("no files");const r=new FormData;for(const e of t)r.append(e.name,e);const a=(await globalAxios.post(`${this.basePath}/api/storage/file/${e}/upload`,r,{headers:{[API_HEADER_TOKEN]:this._config.token},onUploadProgress:i})).data;for(const e of a)e.shared=this.basePath+e.shared;return a}fileUrlDownload(e){return`${this.basePath}/api/storage/file/${e}/download?access_token=${this._config.token}`}fileUrlStream(e){return`${this.basePath}/api/storage/file/${e}/stream?access_token=${this._config.token}`}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)}}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);this.queueRequest.delete(e.seq_reply),e.status===Response.STATUS_OK?t.resolve(e.data):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;default:this.log.error(`event ${e.event} not handler`)}}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.socket.close(3005)},+this.connectionInfo.ping_interval/2);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===e)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},300)}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),this.eventHandler.off("*"),1e3!==e&&(this.emit("disconnected",e),t(new Error(`close socket code: ${e}`)))}),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.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 i=Date.now();switch(e.action){case ChatActions.UserInvite:const r=e.data;(t=new Conversation(this,r.conversation_id,r.title,r.members,r.messages,r.variables)).setInvite(r.invite_id,i),this.conversationStore.set(t.id,t);break;case ChatActions.Joined:const a=e.data;(t=this.conversationById(a.member.id))&&t.setAnswered(a.member.id,i,a.member);break;case ChatActions.Message:const n=e.data;n.timestamp=i;for(const e of this.allConversations())!e.closedAt&&e.membersId.indexOf(n.channel_id)>-1&&(t=e);t&&t.newMessage(n);break;case ChatActions.Close:const s=e.data;for(const e of this.allConversations())!e.closedAt&&e.membersId.indexOf(s.from_channel_id)>-1&&(t=e);t&&t.setClosed(i);break;case ChatActions.Leave:const o=e.data;(t=this.conversationById(o.leaved_channel_id))&&t.setClosed(i);break;case ChatActions.Decline:const u=e.data;(t=this.conversationById(u.invite_id))&&t.setClosed(i)}t&&(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)}destroyConversation(e){this.conversationStore.delete(e.id),this.eventHandler.emit(WEBSOCKET_EVENT_CHAT,ChatActions.Destroy,e)}}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 i=commonjsGlobal&&commonjsGlobal.__generator||function(e,t){var i,r,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(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,r&&(a=2&n[0]?r.return:n[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,n[1])).done)return a;switch(r=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++,r=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],r=0}finally{i=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 r=function(){function e(){this[t.$listeners]={}}return e.count=function(e,i){var r=0,a=e[t.$listeners][i];if(a)for(var n=a.first;++r&&n.next;)n=n.next;return r},e.has=function(e,i){if("*"==i){for(i in e[t.$listeners])return!0;return!1}return void 0!==e[t.$listeners][i]},e.keys=function(e){return Object.keys(e[t.$listeners])},e.unhandle=function(e,i,r,a){return e.on(i,function(){for(var a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];if(!e[t.$listeners][i].first.next)return r.apply(void 0,a)},a)},e.prototype.on=function(e,i,r){return"function"==typeof i?this[t.$addListener](e,i,r):this[t.$addListener](e,void 0,i)},e.prototype.one=function(e,i,r){return"function"==typeof i?this[t.$addListener](e,i,r,!0):this[t.$addListener](e,void 0,i,!0)},e.prototype.off=function(e,i){if("*"==e){var r=this[t.$listeners];if(this[t.$listeners]={},this._onEventUnhandled)for(var a in r)this._onEventUnhandled(a);return this}if("function"==typeof i){var n=this[t.$listeners][e];if(n&&function(e,t){var i=null,r=e.first;for(;;)if(t(r))if(i){if(i.next=r.next,!r.next)break;r=r.next}else{if(!r.next)return null;e.first=r=r.next}else{if(i=r,!r.next)break;r=r.next}return e.last=i,e}(n,function(e){return e.fn==i}))return this}return delete this[t.$listeners][e],this._onEventUnhandled&&this._onEventUnhandled(e),this},e.prototype.emit=function(e){for(var t,i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];for(var a=this.listeners(e);;){var n=a.next(),s=n.value;if(n.done)return t;var o=s.apply(void 0,i);void 0!==o&&(t=o)}},e.prototype.listeners=function(e){var r,a,n;return i(this,function(i){switch(i.label){case 0:if(!(r=this[t.$listeners][e]))return[2];a=null,n=r.first,i.label=1;case 1:return[4,n.fn];case 2:if(i.sent(),n.once){if(!a)return n.next?(r.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]):(r.last=n,[2]);case 3:return[2]}})},e.prototype[t.$addListener]=function(e,i,r,n){var s=this;if(void 0===n&&(n=!1),"object"==typeof e){var o,u=function(){if("function"==typeof e[o]){var i=e[o],u=a(c[t.$listeners],o,{fn:i,once:n,next:null});r&&r.push({dispose:function(){return s.off(o,i)}}),i==u.first.fn&&c._onEventHandled&&c._onEventHandled(o)}},c=this;for(o in e)u();return this}if("function"==typeof i){var l=e,d=a(this[t.$listeners],l,{fn:i,once:n,next:null});r&&r.push({dispose:function(){return s.off(l,i)}}),i==d.first.fn&&this._onEventHandled&&this._onEventHandled(e)}return i},e.ev=t.$listeners,e}();function a(e,t,i){var r=e[t];return r?(r.last.next=i,r.last=i):e[t]=r={first:i,last:i},r}t.EventEmitter=r});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")}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 i=`${this.schema}${e}`;t&&(i+=` ${t}`);const r=document.createElement("a");r.download="File name",r.href=i,r.click()}}export{AgentPauseCauseServiceApiAxiosParamCreator,AgentPauseCauseServiceApiFp,AgentPauseCauseServiceApiFactory,AgentPauseCauseServiceApi,AgentServiceApiAxiosParamCreator,AgentServiceApiFp,AgentServiceApiFactory,AgentServiceApi,AgentSkillServiceApiAxiosParamCreator,AgentSkillServiceApiFp,AgentSkillServiceApiFactory,AgentSkillServiceApi,AgentTeamServiceApiAxiosParamCreator,AgentTeamServiceApiFp,AgentTeamServiceApiFactory,AgentTeamServiceApi,BackendProfileServiceApiAxiosParamCreator,BackendProfileServiceApiFp,BackendProfileServiceApiFactory,BackendProfileServiceApi,BucketServiceApiAxiosParamCreator,BucketServiceApiFp,BucketServiceApiFactory,BucketServiceApi,CalendarServiceApiAxiosParamCreator,CalendarServiceApiFp,CalendarServiceApiFactory,CalendarServiceApi,CallServiceApiAxiosParamCreator,CallServiceApiFp,CallServiceApiFactory,CallServiceApi,CognitiveProfileServiceApiAxiosParamCreator,CognitiveProfileServiceApiFp,CognitiveProfileServiceApiFactory,CognitiveProfileServiceApi,CommunicationTypeServiceApiAxiosParamCreator,CommunicationTypeServiceApiFp,CommunicationTypeServiceApiFactory,CommunicationTypeServiceApi,EmailProfileServiceApiAxiosParamCreator,EmailProfileServiceApiFp,EmailProfileServiceApiFactory,EmailProfileServiceApi,FileServiceApiAxiosParamCreator,FileServiceApiFp,FileServiceApiFactory,FileServiceApi,FileTranscriptServiceApiAxiosParamCreator,FileTranscriptServiceApiFp,FileTranscriptServiceApiFactory,FileTranscriptServiceApi,ImportTemplateServiceApiAxiosParamCreator,ImportTemplateServiceApiFp,ImportTemplateServiceApiFactory,ImportTemplateServiceApi,ListServiceApiAxiosParamCreator,ListServiceApiFp,ListServiceApiFactory,ListServiceApi,MediaFileServiceApiAxiosParamCreator,MediaFileServiceApiFp,MediaFileServiceApiFactory,MediaFileServiceApi,MemberServiceApiAxiosParamCreator,MemberServiceApiFp,MemberServiceApiFactory,MemberServiceApi,OutboundResourceGroupServiceApiAxiosParamCreator,OutboundResourceGroupServiceApiFp,OutboundResourceGroupServiceApiFactory,OutboundResourceGroupServiceApi,OutboundResourceServiceApiAxiosParamCreator,OutboundResourceServiceApiFp,OutboundResourceServiceApiFactory,OutboundResourceServiceApi,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,UserHelperServiceApiAxiosParamCreator,UserHelperServiceApiFp,UserHelperServiceApiFactory,UserHelperServiceApi,Configuration,ProtobufNullValue,StorageImportSourceType,StorageProviderType,StorageServiceType,StorageUploadStatusCode,JobState,Response,Client,CallReportingStatus,CallActions,CallDirection,Call,AgentStatus,ChannelState,ChannelType,Agent,ChatActions,ConversationState,Conversation,DeviceNotFoundError,DeviceNotAllowPermissionError,SipClient,ExternalClient,SipPhone,Log};
2
2
  //# sourceMappingURL=index.esm.min.js.map