webitel-sdk 0.1.164 → 0.1.166

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 (182) hide show
  1. package/bundles/index.esm.js +1664 -1664
  2. package/bundles/index.esm.js.map +1 -1
  3. package/bundles/index.esm.min.js +1 -1
  4. package/bundles/index.esm.min.js.map +1 -1
  5. package/bundles/index.umd.js +1664 -1664
  6. package/bundles/index.umd.js.map +1 -1
  7. package/bundles/index.umd.min.js +1 -1
  8. package/bundles/index.umd.min.js.map +1 -1
  9. package/esm2015/api/agent-pause-cause-service-api.js +49 -49
  10. package/esm2015/api/agent-pause-cause-service-api.js.map +1 -1
  11. package/esm2015/api/agent-service-api.js +151 -151
  12. package/esm2015/api/agent-service-api.js.map +1 -1
  13. package/esm2015/api/agent-skill-service-api.js +63 -63
  14. package/esm2015/api/agent-skill-service-api.js.map +1 -1
  15. package/esm2015/api/agent-team-service-api.js +40 -40
  16. package/esm2015/api/agent-team-service-api.js.map +1 -1
  17. package/esm2015/api/bucket-service-api.js +40 -40
  18. package/esm2015/api/bucket-service-api.js.map +1 -1
  19. package/esm2015/api/calendar-service-api.js +47 -47
  20. package/esm2015/api/calendar-service-api.js.map +1 -1
  21. package/esm2015/api/call-service-api.js +128 -128
  22. package/esm2015/api/call-service-api.js.map +1 -1
  23. package/esm2015/api/communication-type-service-api.js +40 -40
  24. package/esm2015/api/communication-type-service-api.js.map +1 -1
  25. package/esm2015/api/email-profile-service-api.js +57 -57
  26. package/esm2015/api/email-profile-service-api.js.map +1 -1
  27. package/esm2015/api/list-service-api.js +85 -85
  28. package/esm2015/api/list-service-api.js.map +1 -1
  29. package/esm2015/api/member-service-api.js +151 -151
  30. package/esm2015/api/member-service-api.js.map +1 -1
  31. package/esm2015/api/outbound-resource-group-service-api.js +85 -85
  32. package/esm2015/api/outbound-resource-group-service-api.js.map +1 -1
  33. package/esm2015/api/outbound-resource-service-api.js +94 -94
  34. package/esm2015/api/outbound-resource-service-api.js.map +1 -1
  35. package/esm2015/api/queue-bucket-service-api.js +55 -55
  36. package/esm2015/api/queue-bucket-service-api.js.map +1 -1
  37. package/esm2015/api/queue-hook-service-api.js +55 -55
  38. package/esm2015/api/queue-hook-service-api.js.map +1 -1
  39. package/esm2015/api/queue-resources-service-api.js +45 -45
  40. package/esm2015/api/queue-resources-service-api.js.map +1 -1
  41. package/esm2015/api/queue-service-api.js +56 -56
  42. package/esm2015/api/queue-service-api.js.map +1 -1
  43. package/esm2015/api/queue-skill-service-api.js +55 -55
  44. package/esm2015/api/queue-skill-service-api.js.map +1 -1
  45. package/esm2015/api/region-service-api.js +49 -49
  46. package/esm2015/api/region-service-api.js.map +1 -1
  47. package/esm2015/api/routing-chat-plan-service-api.js +49 -49
  48. package/esm2015/api/routing-chat-plan-service-api.js.map +1 -1
  49. package/esm2015/api/routing-outbound-call-service-api.js +59 -59
  50. package/esm2015/api/routing-outbound-call-service-api.js.map +1 -1
  51. package/esm2015/api/routing-schema-service-api.js +56 -56
  52. package/esm2015/api/routing-schema-service-api.js.map +1 -1
  53. package/esm2015/api/routing-variable-service-api.js +40 -40
  54. package/esm2015/api/routing-variable-service-api.js.map +1 -1
  55. package/esm2015/api/skill-service-api.js +40 -40
  56. package/esm2015/api/skill-service-api.js.map +1 -1
  57. package/esm2015/api/trigger-service-api.js +66 -66
  58. package/esm2015/api/trigger-service-api.js.map +1 -1
  59. package/esm2015/api/user-helper-service-api.js +8 -8
  60. package/esm2015/api/user-helper-service-api.js.map +1 -1
  61. package/esm2015/enums/cloud-providers/microsoft/microsoft-language.enum.js +77 -54
  62. package/esm2015/enums/cloud-providers/microsoft/microsoft-language.enum.js.map +1 -1
  63. package/esm5/api/agent-pause-cause-service-api.js +49 -49
  64. package/esm5/api/agent-pause-cause-service-api.js.map +1 -1
  65. package/esm5/api/agent-service-api.js +151 -151
  66. package/esm5/api/agent-service-api.js.map +1 -1
  67. package/esm5/api/agent-skill-service-api.js +63 -63
  68. package/esm5/api/agent-skill-service-api.js.map +1 -1
  69. package/esm5/api/agent-team-service-api.js +40 -40
  70. package/esm5/api/agent-team-service-api.js.map +1 -1
  71. package/esm5/api/bucket-service-api.js +40 -40
  72. package/esm5/api/bucket-service-api.js.map +1 -1
  73. package/esm5/api/calendar-service-api.js +47 -47
  74. package/esm5/api/calendar-service-api.js.map +1 -1
  75. package/esm5/api/call-service-api.js +128 -128
  76. package/esm5/api/call-service-api.js.map +1 -1
  77. package/esm5/api/communication-type-service-api.js +40 -40
  78. package/esm5/api/communication-type-service-api.js.map +1 -1
  79. package/esm5/api/email-profile-service-api.js +57 -57
  80. package/esm5/api/email-profile-service-api.js.map +1 -1
  81. package/esm5/api/list-service-api.js +85 -85
  82. package/esm5/api/list-service-api.js.map +1 -1
  83. package/esm5/api/member-service-api.js +151 -151
  84. package/esm5/api/member-service-api.js.map +1 -1
  85. package/esm5/api/outbound-resource-group-service-api.js +85 -85
  86. package/esm5/api/outbound-resource-group-service-api.js.map +1 -1
  87. package/esm5/api/outbound-resource-service-api.js +94 -94
  88. package/esm5/api/outbound-resource-service-api.js.map +1 -1
  89. package/esm5/api/queue-bucket-service-api.js +55 -55
  90. package/esm5/api/queue-bucket-service-api.js.map +1 -1
  91. package/esm5/api/queue-hook-service-api.js +55 -55
  92. package/esm5/api/queue-hook-service-api.js.map +1 -1
  93. package/esm5/api/queue-resources-service-api.js +45 -45
  94. package/esm5/api/queue-resources-service-api.js.map +1 -1
  95. package/esm5/api/queue-service-api.js +56 -56
  96. package/esm5/api/queue-service-api.js.map +1 -1
  97. package/esm5/api/queue-skill-service-api.js +55 -55
  98. package/esm5/api/queue-skill-service-api.js.map +1 -1
  99. package/esm5/api/region-service-api.js +49 -49
  100. package/esm5/api/region-service-api.js.map +1 -1
  101. package/esm5/api/routing-chat-plan-service-api.js +49 -49
  102. package/esm5/api/routing-chat-plan-service-api.js.map +1 -1
  103. package/esm5/api/routing-outbound-call-service-api.js +59 -59
  104. package/esm5/api/routing-outbound-call-service-api.js.map +1 -1
  105. package/esm5/api/routing-schema-service-api.js +56 -56
  106. package/esm5/api/routing-schema-service-api.js.map +1 -1
  107. package/esm5/api/routing-variable-service-api.js +40 -40
  108. package/esm5/api/routing-variable-service-api.js.map +1 -1
  109. package/esm5/api/skill-service-api.js +40 -40
  110. package/esm5/api/skill-service-api.js.map +1 -1
  111. package/esm5/api/trigger-service-api.js +66 -66
  112. package/esm5/api/trigger-service-api.js.map +1 -1
  113. package/esm5/api/user-helper-service-api.js +8 -8
  114. package/esm5/api/user-helper-service-api.js.map +1 -1
  115. package/esm5/enums/cloud-providers/microsoft/microsoft-language.enum.js +77 -54
  116. package/esm5/enums/cloud-providers/microsoft/microsoft-language.enum.js.map +1 -1
  117. package/package.json +4 -4
  118. package/types/api/agent-pause-cause-service-api.d.ts +24 -24
  119. package/types/api/agent-pause-cause-service-api.d.ts.map +1 -1
  120. package/types/api/agent-service-api.d.ts +76 -76
  121. package/types/api/agent-service-api.d.ts.map +1 -1
  122. package/types/api/agent-skill-service-api.d.ts +28 -28
  123. package/types/api/agent-skill-service-api.d.ts.map +1 -1
  124. package/types/api/agent-team-service-api.d.ts +20 -20
  125. package/types/api/agent-team-service-api.d.ts.map +1 -1
  126. package/types/api/bucket-service-api.d.ts +20 -20
  127. package/types/api/bucket-service-api.d.ts.map +1 -1
  128. package/types/api/calendar-service-api.d.ts +24 -24
  129. package/types/api/calendar-service-api.d.ts.map +1 -1
  130. package/types/api/call-service-api.d.ts +60 -60
  131. package/types/api/call-service-api.d.ts.map +1 -1
  132. package/types/api/communication-type-service-api.d.ts +20 -20
  133. package/types/api/communication-type-service-api.d.ts.map +1 -1
  134. package/types/api/email-profile-service-api.d.ts +28 -28
  135. package/types/api/email-profile-service-api.d.ts.map +1 -1
  136. package/types/api/list-service-api.d.ts +40 -40
  137. package/types/api/list-service-api.d.ts.map +1 -1
  138. package/types/api/member-service-api.d.ts +68 -68
  139. package/types/api/member-service-api.d.ts.map +1 -1
  140. package/types/api/outbound-resource-group-service-api.d.ts +40 -40
  141. package/types/api/outbound-resource-group-service-api.d.ts.map +1 -1
  142. package/types/api/outbound-resource-service-api.d.ts +44 -44
  143. package/types/api/outbound-resource-service-api.d.ts.map +1 -1
  144. package/types/api/queue-bucket-service-api.d.ts +24 -24
  145. package/types/api/queue-bucket-service-api.d.ts.map +1 -1
  146. package/types/api/queue-hook-service-api.d.ts +24 -24
  147. package/types/api/queue-hook-service-api.d.ts.map +1 -1
  148. package/types/api/queue-resources-service-api.d.ts +20 -20
  149. package/types/api/queue-resources-service-api.d.ts.map +1 -1
  150. package/types/api/queue-service-api.d.ts +28 -28
  151. package/types/api/queue-service-api.d.ts.map +1 -1
  152. package/types/api/queue-skill-service-api.d.ts +24 -24
  153. package/types/api/queue-skill-service-api.d.ts.map +1 -1
  154. package/types/api/region-service-api.d.ts +24 -24
  155. package/types/api/region-service-api.d.ts.map +1 -1
  156. package/types/api/routing-chat-plan-service-api.d.ts +24 -24
  157. package/types/api/routing-chat-plan-service-api.d.ts.map +1 -1
  158. package/types/api/routing-outbound-call-service-api.d.ts +28 -28
  159. package/types/api/routing-outbound-call-service-api.d.ts.map +1 -1
  160. package/types/api/routing-schema-service-api.d.ts +28 -28
  161. package/types/api/routing-schema-service-api.d.ts.map +1 -1
  162. package/types/api/routing-variable-service-api.d.ts +20 -20
  163. package/types/api/routing-variable-service-api.d.ts.map +1 -1
  164. package/types/api/skill-service-api.d.ts +20 -20
  165. package/types/api/skill-service-api.d.ts.map +1 -1
  166. package/types/api/trigger-service-api.d.ts +32 -32
  167. package/types/api/trigger-service-api.d.ts.map +1 -1
  168. package/types/api/user-helper-service-api.d.ts +4 -4
  169. package/types/api/user-helper-service-api.d.ts.map +1 -1
  170. package/types/enums/cloud-providers/microsoft/microsoft-language.enum.d.ts.map +1 -1
  171. package/esm2015/api/create-call-request-endpoint-request.js +0 -13
  172. package/esm2015/api/create-call-request-endpoint-request.js.map +0 -1
  173. package/esm2015/api/upload-file-request-metadata.js +0 -13
  174. package/esm2015/api/upload-file-request-metadata.js.map +0 -1
  175. package/esm5/api/create-call-request-endpoint-request.js +0 -13
  176. package/esm5/api/create-call-request-endpoint-request.js.map +0 -1
  177. package/esm5/api/upload-file-request-metadata.js +0 -13
  178. package/esm5/api/upload-file-request-metadata.js.map +0 -1
  179. package/types/api/create-call-request-endpoint-request.d.ts +0 -43
  180. package/types/api/create-call-request-endpoint-request.d.ts.map +0 -1
  181. package/types/api/upload-file-request-metadata.d.ts +0 -43
  182. package/types/api/upload-file-request-metadata.d.ts.map +0 -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,r=globalAxios){this.basePath=t,this.axios=r,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}}class RequiredError extends Error{constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}const AgentPauseCauseServiceApiAxiosParamCreator=function(e){return{agentPauseCauseServiceCreateAgentPauseCause:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling agentPauseCauseServiceCreateAgentPauseCause.");const i=parse("/call_center/pause_causes",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},agentPauseCauseServiceDeleteAgentPauseCause:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling agentPauseCauseServiceDeleteAgentPauseCause.");const i="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const o={method:"DELETE",...n,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let c=n&&n.headers?n.headers:{};return o.headers={...s,...c,...r.headers},{url:format(a),options:o}},agentPauseCauseServicePatchAgentPauseCause:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling agentPauseCauseServicePatchAgentPauseCause.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling agentPauseCauseServicePatchAgentPauseCause.");const a="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},agentPauseCauseServiceReadAgentPauseCause:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling agentPauseCauseServiceReadAgentPauseCause.");const i="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const o={method:"GET",...n,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let c=n&&n.headers?n.headers:{};return o.headers={...s,...c,...r.headers},{url:format(a),options:o}},agentPauseCauseServiceSearchAgentPauseCause:async(t,r,i,a,n,o,s={})=>{const c=parse("/call_center/pause_causes",!0);let u;e&&(u=e.baseOptions);const l={method:"GET",...u,...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!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),o&&(p.id=o),c.query={...c.query,...p,...s.query},delete c.search;let h=u&&u.headers?u.headers:{};return l.headers={...d,...h,...s.headers},{url:format(c),options:l}},agentPauseCauseServiceUpdateAgentPauseCause:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling agentPauseCauseServiceUpdateAgentPauseCause.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling agentPauseCauseServiceUpdateAgentPauseCause.");const a="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}}}},AgentPauseCauseServiceApiFp=function(e){return{async agentPauseCauseServiceCreateAgentPauseCause(t,r){const i=await AgentPauseCauseServiceApiAxiosParamCreator(e).agentPauseCauseServiceCreateAgentPauseCause(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async agentPauseCauseServiceDeleteAgentPauseCause(t,r){const i=await AgentPauseCauseServiceApiAxiosParamCreator(e).agentPauseCauseServiceDeleteAgentPauseCause(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async agentPauseCauseServicePatchAgentPauseCause(t,r,i){const a=await AgentPauseCauseServiceApiAxiosParamCreator(e).agentPauseCauseServicePatchAgentPauseCause(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async agentPauseCauseServiceReadAgentPauseCause(t,r){const i=await AgentPauseCauseServiceApiAxiosParamCreator(e).agentPauseCauseServiceReadAgentPauseCause(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async agentPauseCauseServiceSearchAgentPauseCause(t,r,i,a,n,o,s){const c=await AgentPauseCauseServiceApiAxiosParamCreator(e).agentPauseCauseServiceSearchAgentPauseCause(t,r,i,a,n,o,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async agentPauseCauseServiceUpdateAgentPauseCause(t,r,i){const a=await AgentPauseCauseServiceApiAxiosParamCreator(e).agentPauseCauseServiceUpdateAgentPauseCause(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},AgentPauseCauseServiceApiFactory=function(e,t,r){return{agentPauseCauseServiceCreateAgentPauseCause:(i,a)=>AgentPauseCauseServiceApiFp(e).agentPauseCauseServiceCreateAgentPauseCause(i,a).then(e=>e(r,t)),agentPauseCauseServiceDeleteAgentPauseCause:(i,a)=>AgentPauseCauseServiceApiFp(e).agentPauseCauseServiceDeleteAgentPauseCause(i,a).then(e=>e(r,t)),agentPauseCauseServicePatchAgentPauseCause:(i,a,n)=>AgentPauseCauseServiceApiFp(e).agentPauseCauseServicePatchAgentPauseCause(i,a,n).then(e=>e(r,t)),agentPauseCauseServiceReadAgentPauseCause:(i,a)=>AgentPauseCauseServiceApiFp(e).agentPauseCauseServiceReadAgentPauseCause(i,a).then(e=>e(r,t)),agentPauseCauseServiceSearchAgentPauseCause:(i,a,n,o,s,c,u)=>AgentPauseCauseServiceApiFp(e).agentPauseCauseServiceSearchAgentPauseCause(i,a,n,o,s,c,u).then(e=>e(r,t)),agentPauseCauseServiceUpdateAgentPauseCause:(i,a,n)=>AgentPauseCauseServiceApiFp(e).agentPauseCauseServiceUpdateAgentPauseCause(i,a,n).then(e=>e(r,t))}};class AgentPauseCauseServiceApi extends BaseAPI{agentPauseCauseServiceCreateAgentPauseCause(e,t){return AgentPauseCauseServiceApiFp(this.configuration).agentPauseCauseServiceCreateAgentPauseCause(e,t).then(e=>e(this.axios,this.basePath))}agentPauseCauseServiceDeleteAgentPauseCause(e,t){return AgentPauseCauseServiceApiFp(this.configuration).agentPauseCauseServiceDeleteAgentPauseCause(e,t).then(e=>e(this.axios,this.basePath))}agentPauseCauseServicePatchAgentPauseCause(e,t,r){return AgentPauseCauseServiceApiFp(this.configuration).agentPauseCauseServicePatchAgentPauseCause(e,t,r).then(e=>e(this.axios,this.basePath))}agentPauseCauseServiceReadAgentPauseCause(e,t){return AgentPauseCauseServiceApiFp(this.configuration).agentPauseCauseServiceReadAgentPauseCause(e,t).then(e=>e(this.axios,this.basePath))}agentPauseCauseServiceSearchAgentPauseCause(e,t,r,i,a,n,o){return AgentPauseCauseServiceApiFp(this.configuration).agentPauseCauseServiceSearchAgentPauseCause(e,t,r,i,a,n,o).then(e=>e(this.axios,this.basePath))}agentPauseCauseServiceUpdateAgentPauseCause(e,t,r){return AgentPauseCauseServiceApiFp(this.configuration).agentPauseCauseServiceUpdateAgentPauseCause(e,t,r).then(e=>e(this.axios,this.basePath))}}const AgentServiceApiAxiosParamCreator=function(e){return{agentServiceAgentSetState:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentServiceAgentSetState.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling agentServiceAgentSetState.");const a="/call_center/agents/{agent_id}/states/waiting".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},agentServiceAgentStateHistory:async(t,r,i,a,n,o,s,c={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentServiceAgentStateHistory.");const u="/call_center/agents/{agent_id}/states/history".replace("{agent_id}",encodeURIComponent(String(t))),l=parse(u,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},S={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(S.page=r),void 0!==i&&(S.size=i),void 0!==a&&(S.time_from=a),void 0!==n&&(S.time_to=n),void 0!==o&&(S.q=o),void 0!==s&&(S.domain_id=s),l.query={...l.query,...S,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},agentServiceAgentTodayStatistics:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentServiceAgentTodayStatistics.");const a="/call_center/agents/{agent_id}/statistics/today".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},c={},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}r&&(u.fields=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},agentServiceCreateAgent:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling agentServiceCreateAgent.");const i=parse("/call_center/agents",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},agentServiceDeleteAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling agentServiceDeleteAgent.");const a="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},agentServicePatchAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling agentServicePatchAgent.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling agentServicePatchAgent.");const a="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},agentServiceReadAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling agentServiceReadAgent.");const a="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},agentServiceSearchAgent:async(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A={})=>{const f=parse("/call_center/agents",!0);let b;e&&(b=e.baseOptions);const w={method:"GET",...b,...A},C={},q={};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&&(q.page=t),void 0!==r&&(q.size=r),void 0!==i&&(q.q=i),void 0!==a&&(q.sort=a),n&&(q.fields=n),o&&(q.id=o),s&&(q.allow_channels=s),c&&(q.supervisor_id=c),u&&(q.team_id=u),l&&(q.region_id=l),d&&(q.auditor_id=d),void 0!==p&&(q.is_supervisor=p),h&&(q.skill_id=h),S&&(q.queue_id=S),void 0!==g&&(q.not_supervisor=g),v&&(q.user_id=v),m&&(q.extension=m),y&&(q.not_team_id=y),f.query={...f.query,...q,...A.query},delete f.search;let R=b&&b.headers?b.headers:{};return w.headers={...C,...R,...A.headers},{url:format(f),options:w}},agentServiceSearchAgentCallStatistics:async(t,r,i,a,n,o,s,c,u,l={})=>{const d=parse("/call_center/agents/reports/call",!0);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...l},S={},g={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;S["X-Webitel-Access"]=t}void 0!==t&&(g.page=t),void 0!==r&&(g.size=r),void 0!==i&&(g["time.from"]=i),void 0!==a&&(g["time.to"]=a),n&&(g.agent_id=n),void 0!==o&&(g.domain_id=o),void 0!==s&&(g.q=s),c&&(g.fields=c),void 0!==u&&(g.sort=u),d.query={...d.query,...g,...l.query},delete d.search;let v=p&&p.headers?p.headers:{};return h.headers={...S,...v,...l.headers},{url:format(d),options:h}},agentServiceSearchAgentInQueue:async(t,r,i,a,n,o,s={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling agentServiceSearchAgentInQueue.");const c="/call_center/agents/{id}/queues".replace("{id}",encodeURIComponent(String(t))),u=parse(c,!0);let l;e&&(l=e.baseOptions);const d={method:"GET",...l,...s},p={},h={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;p["X-Webitel-Access"]=t}void 0!==r&&(h.page=r),void 0!==i&&(h.size=i),void 0!==a&&(h.q=a),void 0!==n&&(h.sort=n),o&&(h.fields=o),u.query={...u.query,...h,...s.query},delete u.search;let S=l&&l.headers?l.headers:{};return d.headers={...p,...S,...s.headers},{url:format(u),options:d}},agentServiceSearchAgentInQueueStatistics:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentServiceSearchAgentInQueueStatistics.");const a="/call_center/agents/{agent_id}/statistics/queues".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},agentServiceSearchAgentInTeam:async(t,r,i,a,n,o={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling agentServiceSearchAgentInTeam.");const s="/call_center/agents/{id}/teams".replace("{id}",encodeURIComponent(String(t))),c=parse(s,!0);let u;e&&(u=e.baseOptions);const l={method:"GET",...u,...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!==r&&(p.page=r),void 0!==i&&(p.size=i),void 0!==a&&(p.q=a),void 0!==n&&(p.domain_id=n),c.query={...c.query,...p,...o.query},delete c.search;let h=u&&u.headers?u.headers:{};return l.headers={...d,...h,...o.headers},{url:format(c),options:l}},agentServiceSearchAgentStateHistory:async(t,r,i,a,n,o,s,c,u={})=>{const l=parse("/call_center/agents/states/history",!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},S={};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&&(S.page=t),void 0!==r&&(S.size=r),void 0!==i&&(S["joined_at.from"]=i),void 0!==a&&(S["joined_at.to"]=a),n&&(S.agent_id=n),void 0!==o&&(S.sort=o),void 0!==s&&(S.domain_id=s),void 0!==c&&(S.from_id=c),l.query={...l.query,...S,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},agentServiceSearchAgentStatusStatistic:async(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A={})=>{const f=parse("/call_center/agents/reports/status",!0);let b;e&&(b=e.baseOptions);const w={method:"GET",...b,...A},C={},q={};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&&(q.page=t),void 0!==r&&(q.size=r),void 0!==i&&(q.q=i),void 0!==a&&(q.sort=a),n&&(q.fields=n),o&&(q.agent_id=o),void 0!==s&&(q["time.from"]=s),void 0!==c&&(q["time.to"]=c),u&&(q.status=u),l&&(q.queue_id=l),d&&(q.team_id=d),void 0!==p&&(q["utilization.from"]=p),void 0!==h&&(q["utilization.to"]=h),void 0!==S&&(q.has_call=S),g&&(q.skill_id=g),v&&(q.region_id=v),m&&(q.supervisor_id=m),y&&(q.auditor_id=y),f.query={...f.query,...q,...A.query},delete f.search;let R=b&&b.headers?b.headers:{};return w.headers={...C,...R,...A.headers},{url:format(f),options:w}},agentServiceSearchAgentStatusStatisticItem:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentServiceSearchAgentStatusStatisticItem.");const n="/call_center/agents/reports/status/{agent_id}".replace("{agent_id}",encodeURIComponent(String(t))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...a},u={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(l["time.from"]=r),void 0!==i&&(l["time.to"]=i),o.query={...o.query,...l,...a.query},delete o.search;let d=s&&s.headers?s.headers:{};return c.headers={...u,...d,...a.headers},{url:format(o),options:c}},agentServiceSearchLookupUsersAgentNotExists:async(t,r,i,a,n={})=>{const o=parse("/call_center/lookups/agents/users",!0);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...n},u={},l={};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&&(l.page=t),void 0!==r&&(l.size=r),void 0!==i&&(l.q=i),void 0!==a&&(l.domain_id=a),o.query={...o.query,...l,...n.query},delete o.search;let d=s&&s.headers?s.headers:{};return c.headers={...u,...d,...n.headers},{url:format(o),options:c}},agentServiceSearchPauseCauseForAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentServiceSearchPauseCauseForAgent.");const a="/call_center/agents/{agent_id}/pause_causes".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},c={},u={};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&&(u.allow_change=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},agentServiceUpdateAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling agentServiceUpdateAgent.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling agentServiceUpdateAgent.");const a="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},agentServiceUpdateAgentStatus:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling agentServiceUpdateAgentStatus.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling agentServiceUpdateAgentStatus.");const a="/call_center/agents/{id}/status".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}}}},AgentServiceApiFp=function(e){return{async agentServiceAgentSetState(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).agentServiceAgentSetState(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async agentServiceAgentStateHistory(t,r,i,a,n,o,s,c){const u=await AgentServiceApiAxiosParamCreator(e).agentServiceAgentStateHistory(t,r,i,a,n,o,s,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async agentServiceAgentTodayStatistics(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).agentServiceAgentTodayStatistics(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async agentServiceCreateAgent(t,r){const i=await AgentServiceApiAxiosParamCreator(e).agentServiceCreateAgent(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async agentServiceDeleteAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).agentServiceDeleteAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async agentServicePatchAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).agentServicePatchAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async agentServiceReadAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).agentServiceReadAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async agentServiceSearchAgent(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A){const f=await AgentServiceApiAxiosParamCreator(e).agentServiceSearchAgent(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A);return(e=globalAxios,t=BASE_PATH)=>{const r={...f.options,url:t+f.url};return e.request(r)}},async agentServiceSearchAgentCallStatistics(t,r,i,a,n,o,s,c,u,l){const d=await AgentServiceApiAxiosParamCreator(e).agentServiceSearchAgentCallStatistics(t,r,i,a,n,o,s,c,u,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async agentServiceSearchAgentInQueue(t,r,i,a,n,o,s){const c=await AgentServiceApiAxiosParamCreator(e).agentServiceSearchAgentInQueue(t,r,i,a,n,o,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async agentServiceSearchAgentInQueueStatistics(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).agentServiceSearchAgentInQueueStatistics(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async agentServiceSearchAgentInTeam(t,r,i,a,n,o){const s=await AgentServiceApiAxiosParamCreator(e).agentServiceSearchAgentInTeam(t,r,i,a,n,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async agentServiceSearchAgentStateHistory(t,r,i,a,n,o,s,c,u){const l=await AgentServiceApiAxiosParamCreator(e).agentServiceSearchAgentStateHistory(t,r,i,a,n,o,s,c,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async agentServiceSearchAgentStatusStatistic(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A){const f=await AgentServiceApiAxiosParamCreator(e).agentServiceSearchAgentStatusStatistic(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A);return(e=globalAxios,t=BASE_PATH)=>{const r={...f.options,url:t+f.url};return e.request(r)}},async agentServiceSearchAgentStatusStatisticItem(t,r,i,a){const n=await AgentServiceApiAxiosParamCreator(e).agentServiceSearchAgentStatusStatisticItem(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async agentServiceSearchLookupUsersAgentNotExists(t,r,i,a,n){const o=await AgentServiceApiAxiosParamCreator(e).agentServiceSearchLookupUsersAgentNotExists(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...o.options,url:t+o.url};return e.request(r)}},async agentServiceSearchPauseCauseForAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).agentServiceSearchPauseCauseForAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async agentServiceUpdateAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).agentServiceUpdateAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async agentServiceUpdateAgentStatus(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).agentServiceUpdateAgentStatus(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},AgentServiceApiFactory=function(e,t,r){return{agentServiceAgentSetState:(i,a,n)=>AgentServiceApiFp(e).agentServiceAgentSetState(i,a,n).then(e=>e(r,t)),agentServiceAgentStateHistory:(i,a,n,o,s,c,u,l)=>AgentServiceApiFp(e).agentServiceAgentStateHistory(i,a,n,o,s,c,u,l).then(e=>e(r,t)),agentServiceAgentTodayStatistics:(i,a,n)=>AgentServiceApiFp(e).agentServiceAgentTodayStatistics(i,a,n).then(e=>e(r,t)),agentServiceCreateAgent:(i,a)=>AgentServiceApiFp(e).agentServiceCreateAgent(i,a).then(e=>e(r,t)),agentServiceDeleteAgent:(i,a,n)=>AgentServiceApiFp(e).agentServiceDeleteAgent(i,a,n).then(e=>e(r,t)),agentServicePatchAgent:(i,a,n)=>AgentServiceApiFp(e).agentServicePatchAgent(i,a,n).then(e=>e(r,t)),agentServiceReadAgent:(i,a,n)=>AgentServiceApiFp(e).agentServiceReadAgent(i,a,n).then(e=>e(r,t)),agentServiceSearchAgent:(i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b)=>AgentServiceApiFp(e).agentServiceSearchAgent(i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b).then(e=>e(r,t)),agentServiceSearchAgentCallStatistics:(i,a,n,o,s,c,u,l,d,p)=>AgentServiceApiFp(e).agentServiceSearchAgentCallStatistics(i,a,n,o,s,c,u,l,d,p).then(e=>e(r,t)),agentServiceSearchAgentInQueue:(i,a,n,o,s,c,u)=>AgentServiceApiFp(e).agentServiceSearchAgentInQueue(i,a,n,o,s,c,u).then(e=>e(r,t)),agentServiceSearchAgentInQueueStatistics:(i,a,n)=>AgentServiceApiFp(e).agentServiceSearchAgentInQueueStatistics(i,a,n).then(e=>e(r,t)),agentServiceSearchAgentInTeam:(i,a,n,o,s,c)=>AgentServiceApiFp(e).agentServiceSearchAgentInTeam(i,a,n,o,s,c).then(e=>e(r,t)),agentServiceSearchAgentStateHistory:(i,a,n,o,s,c,u,l,d)=>AgentServiceApiFp(e).agentServiceSearchAgentStateHistory(i,a,n,o,s,c,u,l,d).then(e=>e(r,t)),agentServiceSearchAgentStatusStatistic:(i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b)=>AgentServiceApiFp(e).agentServiceSearchAgentStatusStatistic(i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b).then(e=>e(r,t)),agentServiceSearchAgentStatusStatisticItem:(i,a,n,o)=>AgentServiceApiFp(e).agentServiceSearchAgentStatusStatisticItem(i,a,n,o).then(e=>e(r,t)),agentServiceSearchLookupUsersAgentNotExists:(i,a,n,o,s)=>AgentServiceApiFp(e).agentServiceSearchLookupUsersAgentNotExists(i,a,n,o,s).then(e=>e(r,t)),agentServiceSearchPauseCauseForAgent:(i,a,n)=>AgentServiceApiFp(e).agentServiceSearchPauseCauseForAgent(i,a,n).then(e=>e(r,t)),agentServiceUpdateAgent:(i,a,n)=>AgentServiceApiFp(e).agentServiceUpdateAgent(i,a,n).then(e=>e(r,t)),agentServiceUpdateAgentStatus:(i,a,n)=>AgentServiceApiFp(e).agentServiceUpdateAgentStatus(i,a,n).then(e=>e(r,t))}};class AgentServiceApi extends BaseAPI{agentServiceAgentSetState(e,t,r){return AgentServiceApiFp(this.configuration).agentServiceAgentSetState(e,t,r).then(e=>e(this.axios,this.basePath))}agentServiceAgentStateHistory(e,t,r,i,a,n,o,s){return AgentServiceApiFp(this.configuration).agentServiceAgentStateHistory(e,t,r,i,a,n,o,s).then(e=>e(this.axios,this.basePath))}agentServiceAgentTodayStatistics(e,t,r){return AgentServiceApiFp(this.configuration).agentServiceAgentTodayStatistics(e,t,r).then(e=>e(this.axios,this.basePath))}agentServiceCreateAgent(e,t){return AgentServiceApiFp(this.configuration).agentServiceCreateAgent(e,t).then(e=>e(this.axios,this.basePath))}agentServiceDeleteAgent(e,t,r){return AgentServiceApiFp(this.configuration).agentServiceDeleteAgent(e,t,r).then(e=>e(this.axios,this.basePath))}agentServicePatchAgent(e,t,r){return AgentServiceApiFp(this.configuration).agentServicePatchAgent(e,t,r).then(e=>e(this.axios,this.basePath))}agentServiceReadAgent(e,t,r){return AgentServiceApiFp(this.configuration).agentServiceReadAgent(e,t,r).then(e=>e(this.axios,this.basePath))}agentServiceSearchAgent(e,t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y){return AgentServiceApiFp(this.configuration).agentServiceSearchAgent(e,t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y).then(e=>e(this.axios,this.basePath))}agentServiceSearchAgentCallStatistics(e,t,r,i,a,n,o,s,c,u){return AgentServiceApiFp(this.configuration).agentServiceSearchAgentCallStatistics(e,t,r,i,a,n,o,s,c,u).then(e=>e(this.axios,this.basePath))}agentServiceSearchAgentInQueue(e,t,r,i,a,n,o){return AgentServiceApiFp(this.configuration).agentServiceSearchAgentInQueue(e,t,r,i,a,n,o).then(e=>e(this.axios,this.basePath))}agentServiceSearchAgentInQueueStatistics(e,t,r){return AgentServiceApiFp(this.configuration).agentServiceSearchAgentInQueueStatistics(e,t,r).then(e=>e(this.axios,this.basePath))}agentServiceSearchAgentInTeam(e,t,r,i,a,n){return AgentServiceApiFp(this.configuration).agentServiceSearchAgentInTeam(e,t,r,i,a,n).then(e=>e(this.axios,this.basePath))}agentServiceSearchAgentStateHistory(e,t,r,i,a,n,o,s,c){return AgentServiceApiFp(this.configuration).agentServiceSearchAgentStateHistory(e,t,r,i,a,n,o,s,c).then(e=>e(this.axios,this.basePath))}agentServiceSearchAgentStatusStatistic(e,t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y){return AgentServiceApiFp(this.configuration).agentServiceSearchAgentStatusStatistic(e,t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y).then(e=>e(this.axios,this.basePath))}agentServiceSearchAgentStatusStatisticItem(e,t,r,i){return AgentServiceApiFp(this.configuration).agentServiceSearchAgentStatusStatisticItem(e,t,r,i).then(e=>e(this.axios,this.basePath))}agentServiceSearchLookupUsersAgentNotExists(e,t,r,i,a){return AgentServiceApiFp(this.configuration).agentServiceSearchLookupUsersAgentNotExists(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}agentServiceSearchPauseCauseForAgent(e,t,r){return AgentServiceApiFp(this.configuration).agentServiceSearchPauseCauseForAgent(e,t,r).then(e=>e(this.axios,this.basePath))}agentServiceUpdateAgent(e,t,r){return AgentServiceApiFp(this.configuration).agentServiceUpdateAgent(e,t,r).then(e=>e(this.axios,this.basePath))}agentServiceUpdateAgentStatus(e,t,r){return AgentServiceApiFp(this.configuration).agentServiceUpdateAgentStatus(e,t,r).then(e=>e(this.axios,this.basePath))}}const AgentSkillServiceApiAxiosParamCreator=function(e){return{agentSkillServiceCreateAgentSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentSkillServiceCreateAgentSkill.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling agentSkillServiceCreateAgentSkill.");const a="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},agentSkillServiceDeleteAgentSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentSkillServiceDeleteAgentSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling agentSkillServiceDeleteAgentSkill.");const n="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"DELETE",...s,...a},u={},l={};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&&(l.domain_id=i),o.query={...o.query,...l,...a.query},delete o.search;let d=s&&s.headers?s.headers:{};return c.headers={...u,...d,...a.headers},{url:format(o),options:c}},agentSkillServicePatchAgentSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentSkillServicePatchAgentSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling agentSkillServicePatchAgentSkill.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling agentSkillServicePatchAgentSkill.");const n="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"PATCH",...s,...a},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",o.query={...o.query,...a.query},delete o.search;let l=s&&s.headers?s.headers:{};c.headers={...u,...l,...a.headers};const d="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}},agentSkillServiceReadAgentSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentSkillServiceReadAgentSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling agentSkillServiceReadAgentSkill.");const n="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...a},u={},l={};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&&(l.domain_id=i),o.query={...o.query,...l,...a.query},delete o.search;let d=s&&s.headers?s.headers:{};return c.headers={...u,...d,...a.headers},{url:format(o),options:c}},agentSkillServiceSearchAgentSkill:async(t,r,i,a,n,o,s,c={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentSkillServiceSearchAgentSkill.");const u="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(t))),l=parse(u,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},S={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(S.page=r),void 0!==i&&(S.size=i),void 0!==a&&(S.q=a),void 0!==n&&(S.sort=n),o&&(S.fields=o),s&&(S.id=s),l.query={...l.query,...S,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},agentSkillServiceSearchLookupAgentNotExistsSkill:async(t,r,i,a,n,o={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentSkillServiceSearchLookupAgentNotExistsSkill.");const s="/call_center/lookups/agents/skills/{agent_id}".replace("{agent_id}",encodeURIComponent(String(t))),c=parse(s,!0);let u;e&&(u=e.baseOptions);const l={method:"GET",...u,...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!==r&&(p.page=r),void 0!==i&&(p.size=i),void 0!==a&&(p.q=a),void 0!==n&&(p.domain_id=n),c.query={...c.query,...p,...o.query},delete c.search;let h=u&&u.headers?u.headers:{};return l.headers={...d,...h,...o.headers},{url:format(c),options:l}},agentSkillServiceUpdateAgentSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentSkillServiceUpdateAgentSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling agentSkillServiceUpdateAgentSkill.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling agentSkillServiceUpdateAgentSkill.");const n="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"PUT",...s,...a},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",o.query={...o.query,...a.query},delete o.search;let l=s&&s.headers?s.headers:{};c.headers={...u,...l,...a.headers};const d="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},AgentSkillServiceApiFp=function(e){return{async agentSkillServiceCreateAgentSkill(t,r,i){const a=await AgentSkillServiceApiAxiosParamCreator(e).agentSkillServiceCreateAgentSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async agentSkillServiceDeleteAgentSkill(t,r,i,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).agentSkillServiceDeleteAgentSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async agentSkillServicePatchAgentSkill(t,r,i,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).agentSkillServicePatchAgentSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async agentSkillServiceReadAgentSkill(t,r,i,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).agentSkillServiceReadAgentSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async agentSkillServiceSearchAgentSkill(t,r,i,a,n,o,s,c){const u=await AgentSkillServiceApiAxiosParamCreator(e).agentSkillServiceSearchAgentSkill(t,r,i,a,n,o,s,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async agentSkillServiceSearchLookupAgentNotExistsSkill(t,r,i,a,n,o){const s=await AgentSkillServiceApiAxiosParamCreator(e).agentSkillServiceSearchLookupAgentNotExistsSkill(t,r,i,a,n,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async agentSkillServiceUpdateAgentSkill(t,r,i,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).agentSkillServiceUpdateAgentSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},AgentSkillServiceApiFactory=function(e,t,r){return{agentSkillServiceCreateAgentSkill:(i,a,n)=>AgentSkillServiceApiFp(e).agentSkillServiceCreateAgentSkill(i,a,n).then(e=>e(r,t)),agentSkillServiceDeleteAgentSkill:(i,a,n,o)=>AgentSkillServiceApiFp(e).agentSkillServiceDeleteAgentSkill(i,a,n,o).then(e=>e(r,t)),agentSkillServicePatchAgentSkill:(i,a,n,o)=>AgentSkillServiceApiFp(e).agentSkillServicePatchAgentSkill(i,a,n,o).then(e=>e(r,t)),agentSkillServiceReadAgentSkill:(i,a,n,o)=>AgentSkillServiceApiFp(e).agentSkillServiceReadAgentSkill(i,a,n,o).then(e=>e(r,t)),agentSkillServiceSearchAgentSkill:(i,a,n,o,s,c,u,l)=>AgentSkillServiceApiFp(e).agentSkillServiceSearchAgentSkill(i,a,n,o,s,c,u,l).then(e=>e(r,t)),agentSkillServiceSearchLookupAgentNotExistsSkill:(i,a,n,o,s,c)=>AgentSkillServiceApiFp(e).agentSkillServiceSearchLookupAgentNotExistsSkill(i,a,n,o,s,c).then(e=>e(r,t)),agentSkillServiceUpdateAgentSkill:(i,a,n,o)=>AgentSkillServiceApiFp(e).agentSkillServiceUpdateAgentSkill(i,a,n,o).then(e=>e(r,t))}};class AgentSkillServiceApi extends BaseAPI{agentSkillServiceCreateAgentSkill(e,t,r){return AgentSkillServiceApiFp(this.configuration).agentSkillServiceCreateAgentSkill(e,t,r).then(e=>e(this.axios,this.basePath))}agentSkillServiceDeleteAgentSkill(e,t,r,i){return AgentSkillServiceApiFp(this.configuration).agentSkillServiceDeleteAgentSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}agentSkillServicePatchAgentSkill(e,t,r,i){return AgentSkillServiceApiFp(this.configuration).agentSkillServicePatchAgentSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}agentSkillServiceReadAgentSkill(e,t,r,i){return AgentSkillServiceApiFp(this.configuration).agentSkillServiceReadAgentSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}agentSkillServiceSearchAgentSkill(e,t,r,i,a,n,o,s){return AgentSkillServiceApiFp(this.configuration).agentSkillServiceSearchAgentSkill(e,t,r,i,a,n,o,s).then(e=>e(this.axios,this.basePath))}agentSkillServiceSearchLookupAgentNotExistsSkill(e,t,r,i,a,n){return AgentSkillServiceApiFp(this.configuration).agentSkillServiceSearchLookupAgentNotExistsSkill(e,t,r,i,a,n).then(e=>e(this.axios,this.basePath))}agentSkillServiceUpdateAgentSkill(e,t,r,i){return AgentSkillServiceApiFp(this.configuration).agentSkillServiceUpdateAgentSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const AgentTeamServiceApiAxiosParamCreator=function(e){return{agentTeamServiceCreateAgentTeam:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling agentTeamServiceCreateAgentTeam.");const i=parse("/call_center/teams",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},agentTeamServiceDeleteAgentTeam:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling agentTeamServiceDeleteAgentTeam.");const a="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},agentTeamServiceReadAgentTeam:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling agentTeamServiceReadAgentTeam.");const a="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},agentTeamServiceSearchAgentTeam:async(t,r,i,a,n,o,s,c,u={})=>{const l=parse("/call_center/teams",!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},S={};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&&(S.page=t),void 0!==r&&(S.size=r),void 0!==i&&(S.q=i),void 0!==a&&(S.sort=a),n&&(S.fields=n),o&&(S.id=o),s&&(S.strategy=s),c&&(S.admin_id=c),l.query={...l.query,...S,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},agentTeamServiceUpdateAgentTeam:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling agentTeamServiceUpdateAgentTeam.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling agentTeamServiceUpdateAgentTeam.");const a="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}}}},AgentTeamServiceApiFp=function(e){return{async agentTeamServiceCreateAgentTeam(t,r){const i=await AgentTeamServiceApiAxiosParamCreator(e).agentTeamServiceCreateAgentTeam(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async agentTeamServiceDeleteAgentTeam(t,r,i){const a=await AgentTeamServiceApiAxiosParamCreator(e).agentTeamServiceDeleteAgentTeam(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async agentTeamServiceReadAgentTeam(t,r,i){const a=await AgentTeamServiceApiAxiosParamCreator(e).agentTeamServiceReadAgentTeam(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async agentTeamServiceSearchAgentTeam(t,r,i,a,n,o,s,c,u){const l=await AgentTeamServiceApiAxiosParamCreator(e).agentTeamServiceSearchAgentTeam(t,r,i,a,n,o,s,c,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async agentTeamServiceUpdateAgentTeam(t,r,i){const a=await AgentTeamServiceApiAxiosParamCreator(e).agentTeamServiceUpdateAgentTeam(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},AgentTeamServiceApiFactory=function(e,t,r){return{agentTeamServiceCreateAgentTeam:(i,a)=>AgentTeamServiceApiFp(e).agentTeamServiceCreateAgentTeam(i,a).then(e=>e(r,t)),agentTeamServiceDeleteAgentTeam:(i,a,n)=>AgentTeamServiceApiFp(e).agentTeamServiceDeleteAgentTeam(i,a,n).then(e=>e(r,t)),agentTeamServiceReadAgentTeam:(i,a,n)=>AgentTeamServiceApiFp(e).agentTeamServiceReadAgentTeam(i,a,n).then(e=>e(r,t)),agentTeamServiceSearchAgentTeam:(i,a,n,o,s,c,u,l,d)=>AgentTeamServiceApiFp(e).agentTeamServiceSearchAgentTeam(i,a,n,o,s,c,u,l,d).then(e=>e(r,t)),agentTeamServiceUpdateAgentTeam:(i,a,n)=>AgentTeamServiceApiFp(e).agentTeamServiceUpdateAgentTeam(i,a,n).then(e=>e(r,t))}};class AgentTeamServiceApi extends BaseAPI{agentTeamServiceCreateAgentTeam(e,t){return AgentTeamServiceApiFp(this.configuration).agentTeamServiceCreateAgentTeam(e,t).then(e=>e(this.axios,this.basePath))}agentTeamServiceDeleteAgentTeam(e,t,r){return AgentTeamServiceApiFp(this.configuration).agentTeamServiceDeleteAgentTeam(e,t,r).then(e=>e(this.axios,this.basePath))}agentTeamServiceReadAgentTeam(e,t,r){return AgentTeamServiceApiFp(this.configuration).agentTeamServiceReadAgentTeam(e,t,r).then(e=>e(this.axios,this.basePath))}agentTeamServiceSearchAgentTeam(e,t,r,i,a,n,o,s,c){return AgentTeamServiceApiFp(this.configuration).agentTeamServiceSearchAgentTeam(e,t,r,i,a,n,o,s,c).then(e=>e(this.axios,this.basePath))}agentTeamServiceUpdateAgentTeam(e,t,r){return AgentTeamServiceApiFp(this.configuration).agentTeamServiceUpdateAgentTeam(e,t,r).then(e=>e(this.axios,this.basePath))}}const BackendProfileServiceApiAxiosParamCreator=function(e){return{createBackendProfile:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createBackendProfile.");const i=parse("/storage/backend_profiles",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},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}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteBackendProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteBackendProfile.");const a="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},patchBackendProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchBackendProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchBackendProfile.");const a="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},readBackendProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readBackendProfile.");const a="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},searchBackendProfile:async(t,r,i,a,n,o,s={})=>{const c=parse("/storage/backend_profiles",!0);let u;e&&(u=e.baseOptions);const l={method:"GET",...u,...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!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),o&&(p.id=o),c.query={...c.query,...p,...s.query},delete c.search;let h=u&&u.headers?u.headers:{};return l.headers={...d,...h,...s.headers},{url:format(c),options:l}},updateBackendProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateBackendProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateBackendProfile.");const a="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}}}},BackendProfileServiceApiFp=function(e){return{async createBackendProfile(t,r){const i=await BackendProfileServiceApiAxiosParamCreator(e).createBackendProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteBackendProfile(t,r,i){const a=await BackendProfileServiceApiAxiosParamCreator(e).deleteBackendProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchBackendProfile(t,r,i){const a=await BackendProfileServiceApiAxiosParamCreator(e).patchBackendProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readBackendProfile(t,r,i){const a=await BackendProfileServiceApiAxiosParamCreator(e).readBackendProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchBackendProfile(t,r,i,a,n,o,s){const c=await BackendProfileServiceApiAxiosParamCreator(e).searchBackendProfile(t,r,i,a,n,o,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async updateBackendProfile(t,r,i){const a=await BackendProfileServiceApiAxiosParamCreator(e).updateBackendProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},BackendProfileServiceApiFactory=function(e,t,r){return{createBackendProfile:(i,a)=>BackendProfileServiceApiFp(e).createBackendProfile(i,a).then(e=>e(r,t)),deleteBackendProfile:(i,a,n)=>BackendProfileServiceApiFp(e).deleteBackendProfile(i,a,n).then(e=>e(r,t)),patchBackendProfile:(i,a,n)=>BackendProfileServiceApiFp(e).patchBackendProfile(i,a,n).then(e=>e(r,t)),readBackendProfile:(i,a,n)=>BackendProfileServiceApiFp(e).readBackendProfile(i,a,n).then(e=>e(r,t)),searchBackendProfile:(i,a,n,o,s,c,u)=>BackendProfileServiceApiFp(e).searchBackendProfile(i,a,n,o,s,c,u).then(e=>e(r,t)),updateBackendProfile:(i,a,n)=>BackendProfileServiceApiFp(e).updateBackendProfile(i,a,n).then(e=>e(r,t))}};class BackendProfileServiceApi extends BaseAPI{createBackendProfile(e,t){return BackendProfileServiceApiFp(this.configuration).createBackendProfile(e,t).then(e=>e(this.axios,this.basePath))}deleteBackendProfile(e,t,r){return BackendProfileServiceApiFp(this.configuration).deleteBackendProfile(e,t,r).then(e=>e(this.axios,this.basePath))}patchBackendProfile(e,t,r){return BackendProfileServiceApiFp(this.configuration).patchBackendProfile(e,t,r).then(e=>e(this.axios,this.basePath))}readBackendProfile(e,t,r){return BackendProfileServiceApiFp(this.configuration).readBackendProfile(e,t,r).then(e=>e(this.axios,this.basePath))}searchBackendProfile(e,t,r,i,a,n,o){return BackendProfileServiceApiFp(this.configuration).searchBackendProfile(e,t,r,i,a,n,o).then(e=>e(this.axios,this.basePath))}updateBackendProfile(e,t,r){return BackendProfileServiceApiFp(this.configuration).updateBackendProfile(e,t,r).then(e=>e(this.axios,this.basePath))}}const BucketServiceApiAxiosParamCreator=function(e){return{bucketServiceCreateBucket:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling bucketServiceCreateBucket.");const i=parse("/call_center/buckets",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},bucketServiceDeleteBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling bucketServiceDeleteBucket.");const a="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},bucketServiceReadBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling bucketServiceReadBucket.");const a="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},bucketServiceSearchBucket:async(t,r,i,a,n,o,s={})=>{const c=parse("/call_center/buckets",!0);let u;e&&(u=e.baseOptions);const l={method:"GET",...u,...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!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),o&&(p.id=o),c.query={...c.query,...p,...s.query},delete c.search;let h=u&&u.headers?u.headers:{};return l.headers={...d,...h,...s.headers},{url:format(c),options:l}},bucketServiceUpdateBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling bucketServiceUpdateBucket.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling bucketServiceUpdateBucket.");const a="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}}}},BucketServiceApiFp=function(e){return{async bucketServiceCreateBucket(t,r){const i=await BucketServiceApiAxiosParamCreator(e).bucketServiceCreateBucket(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async bucketServiceDeleteBucket(t,r,i){const a=await BucketServiceApiAxiosParamCreator(e).bucketServiceDeleteBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async bucketServiceReadBucket(t,r,i){const a=await BucketServiceApiAxiosParamCreator(e).bucketServiceReadBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async bucketServiceSearchBucket(t,r,i,a,n,o,s){const c=await BucketServiceApiAxiosParamCreator(e).bucketServiceSearchBucket(t,r,i,a,n,o,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async bucketServiceUpdateBucket(t,r,i){const a=await BucketServiceApiAxiosParamCreator(e).bucketServiceUpdateBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},BucketServiceApiFactory=function(e,t,r){return{bucketServiceCreateBucket:(i,a)=>BucketServiceApiFp(e).bucketServiceCreateBucket(i,a).then(e=>e(r,t)),bucketServiceDeleteBucket:(i,a,n)=>BucketServiceApiFp(e).bucketServiceDeleteBucket(i,a,n).then(e=>e(r,t)),bucketServiceReadBucket:(i,a,n)=>BucketServiceApiFp(e).bucketServiceReadBucket(i,a,n).then(e=>e(r,t)),bucketServiceSearchBucket:(i,a,n,o,s,c,u)=>BucketServiceApiFp(e).bucketServiceSearchBucket(i,a,n,o,s,c,u).then(e=>e(r,t)),bucketServiceUpdateBucket:(i,a,n)=>BucketServiceApiFp(e).bucketServiceUpdateBucket(i,a,n).then(e=>e(r,t))}};class BucketServiceApi extends BaseAPI{bucketServiceCreateBucket(e,t){return BucketServiceApiFp(this.configuration).bucketServiceCreateBucket(e,t).then(e=>e(this.axios,this.basePath))}bucketServiceDeleteBucket(e,t,r){return BucketServiceApiFp(this.configuration).bucketServiceDeleteBucket(e,t,r).then(e=>e(this.axios,this.basePath))}bucketServiceReadBucket(e,t,r){return BucketServiceApiFp(this.configuration).bucketServiceReadBucket(e,t,r).then(e=>e(this.axios,this.basePath))}bucketServiceSearchBucket(e,t,r,i,a,n,o){return BucketServiceApiFp(this.configuration).bucketServiceSearchBucket(e,t,r,i,a,n,o).then(e=>e(this.axios,this.basePath))}bucketServiceUpdateBucket(e,t,r){return BucketServiceApiFp(this.configuration).bucketServiceUpdateBucket(e,t,r).then(e=>e(this.axios,this.basePath))}}const CalendarServiceApiAxiosParamCreator=function(e){return{calendarServiceCreateCalendar:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling calendarServiceCreateCalendar.");const i=parse("/calendars",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},calendarServiceDeleteCalendar:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling calendarServiceDeleteCalendar.");const a="/calendars/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},calendarServiceReadCalendar:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling calendarServiceReadCalendar.");const a="/calendars/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},calendarServiceSearchCalendar:async(t,r,i,a,n,o,s={})=>{const c=parse("/calendars",!0);let u;e&&(u=e.baseOptions);const l={method:"GET",...u,...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!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),o&&(p.id=o),c.query={...c.query,...p,...s.query},delete c.search;let h=u&&u.headers?u.headers:{};return l.headers={...d,...h,...s.headers},{url:format(c),options:l}},calendarServiceSearchTimezones:async(t,r,i,a={})=>{const n=parse("/calendars/timezones",!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...a},c={},u={};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&&(u.page=t),void 0!==r&&(u.size=r),void 0!==i&&(u.q=i),n.query={...n.query,...u,...a.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...a.headers},{url:format(n),options:s}},calendarServiceUpdateCalendar:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling calendarServiceUpdateCalendar.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling calendarServiceUpdateCalendar.");const a="/calendars/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}}}},CalendarServiceApiFp=function(e){return{async calendarServiceCreateCalendar(t,r){const i=await CalendarServiceApiAxiosParamCreator(e).calendarServiceCreateCalendar(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async calendarServiceDeleteCalendar(t,r,i){const a=await CalendarServiceApiAxiosParamCreator(e).calendarServiceDeleteCalendar(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async calendarServiceReadCalendar(t,r,i){const a=await CalendarServiceApiAxiosParamCreator(e).calendarServiceReadCalendar(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async calendarServiceSearchCalendar(t,r,i,a,n,o,s){const c=await CalendarServiceApiAxiosParamCreator(e).calendarServiceSearchCalendar(t,r,i,a,n,o,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async calendarServiceSearchTimezones(t,r,i,a){const n=await CalendarServiceApiAxiosParamCreator(e).calendarServiceSearchTimezones(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async calendarServiceUpdateCalendar(t,r,i){const a=await CalendarServiceApiAxiosParamCreator(e).calendarServiceUpdateCalendar(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},CalendarServiceApiFactory=function(e,t,r){return{calendarServiceCreateCalendar:(i,a)=>CalendarServiceApiFp(e).calendarServiceCreateCalendar(i,a).then(e=>e(r,t)),calendarServiceDeleteCalendar:(i,a,n)=>CalendarServiceApiFp(e).calendarServiceDeleteCalendar(i,a,n).then(e=>e(r,t)),calendarServiceReadCalendar:(i,a,n)=>CalendarServiceApiFp(e).calendarServiceReadCalendar(i,a,n).then(e=>e(r,t)),calendarServiceSearchCalendar:(i,a,n,o,s,c,u)=>CalendarServiceApiFp(e).calendarServiceSearchCalendar(i,a,n,o,s,c,u).then(e=>e(r,t)),calendarServiceSearchTimezones:(i,a,n,o)=>CalendarServiceApiFp(e).calendarServiceSearchTimezones(i,a,n,o).then(e=>e(r,t)),calendarServiceUpdateCalendar:(i,a,n)=>CalendarServiceApiFp(e).calendarServiceUpdateCalendar(i,a,n).then(e=>e(r,t))}};class CalendarServiceApi extends BaseAPI{calendarServiceCreateCalendar(e,t){return CalendarServiceApiFp(this.configuration).calendarServiceCreateCalendar(e,t).then(e=>e(this.axios,this.basePath))}calendarServiceDeleteCalendar(e,t,r){return CalendarServiceApiFp(this.configuration).calendarServiceDeleteCalendar(e,t,r).then(e=>e(this.axios,this.basePath))}calendarServiceReadCalendar(e,t,r){return CalendarServiceApiFp(this.configuration).calendarServiceReadCalendar(e,t,r).then(e=>e(this.axios,this.basePath))}calendarServiceSearchCalendar(e,t,r,i,a,n,o){return CalendarServiceApiFp(this.configuration).calendarServiceSearchCalendar(e,t,r,i,a,n,o).then(e=>e(this.axios,this.basePath))}calendarServiceSearchTimezones(e,t,r,i){return CalendarServiceApiFp(this.configuration).calendarServiceSearchTimezones(e,t,r,i).then(e=>e(this.axios,this.basePath))}calendarServiceUpdateCalendar(e,t,r){return CalendarServiceApiFp(this.configuration).calendarServiceUpdateCalendar(e,t,r).then(e=>e(this.axios,this.basePath))}}const CallServiceApiAxiosParamCreator=function(e){return{callServiceAggregateHistoryCall:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling callServiceAggregateHistoryCall.");const i=parse("/calls/history/aggregate",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},callServiceBlindTransferCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling callServiceBlindTransferCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling callServiceBlindTransferCall.");const a="/calls/active/{id}/transfer".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},callServiceConfirmPush:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling callServiceConfirmPush.");const i="/calls/active/{id}/confirm_push".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const o={method:"PATCH",...n,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let c=n&&n.headers?n.headers:{};return o.headers={...s,...c,...r.headers},{url:format(a),options:o}},callServiceCreateCall:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling callServiceCreateCall.");const i=parse("/calls",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},callServiceCreateCallAnnotation:async(t,r,i={})=>{if(null==t)throw new RequiredError("callId","Required parameter callId was null or undefined when calling callServiceCreateCallAnnotation.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling callServiceCreateCallAnnotation.");const a="/calls/history/{call_id}/annotation".replace("{call_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},callServiceDeleteCallAnnotation:async(t,r,i={})=>{if(null==t)throw new RequiredError("callId","Required parameter callId was null or undefined when calling callServiceDeleteCallAnnotation.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling callServiceDeleteCallAnnotation.");const a="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},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}n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};return s.headers={...c,...u,...i.headers},{url:format(n),options:s}},callServiceDtmfCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling callServiceDtmfCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling callServiceDtmfCall.");const a="/calls/active/{id}/dtmf".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},callServiceEavesdropCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling callServiceEavesdropCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling callServiceEavesdropCall.");const a="/calls/active/{id}/eavesdrop".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},callServiceHangupCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling callServiceHangupCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling callServiceHangupCall.");const a="/calls/active/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},callServiceHoldCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling callServiceHoldCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling callServiceHoldCall.");const a="/calls/active/{id}/hold".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},callServiceReadCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling callServiceReadCall.");const a="/calls/active/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},callServiceSearchActiveCall:async(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w,C,q,R,P,T,_,E,k={})=>{const K=parse("/calls/active",!0);let O;e&&(O=e.baseOptions);const x={method:"GET",...O,...k},F={},I={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;F["X-Webitel-Access"]=t}void 0!==t&&(I.page=t),void 0!==r&&(I.size=r),void 0!==i&&(I.q=i),void 0!==a&&(I.sort=a),n&&(I.fields=n),void 0!==o&&(I["created_at.from"]=o),void 0!==s&&(I["created_at.to"]=s),c&&(I.user_id=c),u&&(I.agent_id=u),l&&(I.queue_id=l),d&&(I.team_id=d),p&&(I.member_id=p),h&&(I.gateway_id=h),void 0!==S&&(I["duration.from"]=S),void 0!==g&&(I["duration.to"]=g),void 0!==v&&(I.skip_parent=v),void 0!==m&&(I.parent_id=m),y&&(I.cause=y),void 0!==A&&(I.exists_file=A),void 0!==f&&(I.domain_id=f),void 0!==b&&(I.number=b),w&&(I.direction=w),void 0!==C&&(I["answered_at.from"]=C),void 0!==q&&(I["answered_at.to"]=q),void 0!==R&&(I.missed=R),void 0!==P&&(I["stored_at.from"]=P),void 0!==T&&(I["stored_at.to"]=T),_&&(I.supervisor_id=_),E&&(I.state=E),K.query={...K.query,...I,...k.query},delete K.search;let B=O&&O.headers?O.headers:{};return x.headers={...F,...B,...k.headers},{url:format(K),options:x}},callServiceSearchHistoryCall:async(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w,C,q,R,P,T,_,E,k,K,O,x,F,I,B,U,H,W,D={})=>{const X=parse("/calls/history",!0);let Q;e&&(Q=e.baseOptions);const G={method:"GET",...Q,...D},M={},L={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;M["X-Webitel-Access"]=t}void 0!==t&&(L.page=t),void 0!==r&&(L.size=r),void 0!==i&&(L.q=i),void 0!==a&&(L.sort=a),n&&(L.fields=n),void 0!==o&&(L["created_at.from"]=o),void 0!==s&&(L["created_at.to"]=s),c&&(L.user_id=c),u&&(L.agent_id=u),l&&(L.queue_id=l),d&&(L.team_id=d),p&&(L.member_id=p),h&&(L.gateway_id=h),void 0!==S&&(L["duration.from"]=S),void 0!==g&&(L["duration.to"]=g),void 0!==v&&(L.skip_parent=v),void 0!==m&&(L.parent_id=m),y&&(L.cause=y),void 0!==A&&(L.has_file=A),void 0!==f&&(L.domain_id=f),void 0!==b&&(L.number=b),void 0!==w&&(L.direction=w),void 0!==C&&(L["answered_at.from"]=C),void 0!==q&&(L["answered_at.to"]=q),void 0!==R&&(L.missed=R),void 0!==P&&(L["stored_at.from"]=P),void 0!==T&&(L["stored_at.to"]=T),_&&(L.id=_),E&&(L.transfer_from=E),k&&(L.transfer_to=k),K&&(L.dependency_id=K),O&&(L.tags=O),x&&(L.amd_result=x),void 0!==F&&(L.fts=F),I&&(L.directions=I),void 0!==B&&(L.has_transcript=B),void 0!==U&&(L.agent_description=U),H&&(L.owner_id=H),W&&(L.grantee_id=W),X.query={...X.query,...L,...D.query},delete X.search;let j=Q&&Q.headers?Q.headers:{};return G.headers={...M,...j,...D.headers},{url:format(X),options:G}},callServiceUnHoldCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling callServiceUnHoldCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling callServiceUnHoldCall.");const a="/calls/active/{id}/unhold".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},callServiceUpdateCallAnnotation:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("callId","Required parameter callId was null or undefined when calling callServiceUpdateCallAnnotation.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling callServiceUpdateCallAnnotation.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling callServiceUpdateCallAnnotation.");const n="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"PUT",...s,...a},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",o.query={...o.query,...a.query},delete o.search;let l=s&&s.headers?s.headers:{};c.headers={...u,...l,...a.headers};const d="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},CallServiceApiFp=function(e){return{async callServiceAggregateHistoryCall(t,r){const i=await CallServiceApiAxiosParamCreator(e).callServiceAggregateHistoryCall(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async callServiceBlindTransferCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).callServiceBlindTransferCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async callServiceConfirmPush(t,r){const i=await CallServiceApiAxiosParamCreator(e).callServiceConfirmPush(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async callServiceCreateCall(t,r){const i=await CallServiceApiAxiosParamCreator(e).callServiceCreateCall(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async callServiceCreateCallAnnotation(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).callServiceCreateCallAnnotation(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async callServiceDeleteCallAnnotation(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).callServiceDeleteCallAnnotation(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async callServiceDtmfCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).callServiceDtmfCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async callServiceEavesdropCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).callServiceEavesdropCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async callServiceHangupCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).callServiceHangupCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async callServiceHoldCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).callServiceHoldCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async callServiceReadCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).callServiceReadCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async callServiceSearchActiveCall(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w,C,q,R,P,T,_,E,k){const K=await CallServiceApiAxiosParamCreator(e).callServiceSearchActiveCall(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w,C,q,R,P,T,_,E,k);return(e=globalAxios,t=BASE_PATH)=>{const r={...K.options,url:t+K.url};return e.request(r)}},async callServiceSearchHistoryCall(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w,C,q,R,P,T,_,E,k,K,O,x,F,I,B,U,H,W,D){const X=await CallServiceApiAxiosParamCreator(e).callServiceSearchHistoryCall(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w,C,q,R,P,T,_,E,k,K,O,x,F,I,B,U,H,W,D);return(e=globalAxios,t=BASE_PATH)=>{const r={...X.options,url:t+X.url};return e.request(r)}},async callServiceUnHoldCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).callServiceUnHoldCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async callServiceUpdateCallAnnotation(t,r,i,a){const n=await CallServiceApiAxiosParamCreator(e).callServiceUpdateCallAnnotation(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},CallServiceApiFactory=function(e,t,r){return{callServiceAggregateHistoryCall:(i,a)=>CallServiceApiFp(e).callServiceAggregateHistoryCall(i,a).then(e=>e(r,t)),callServiceBlindTransferCall:(i,a,n)=>CallServiceApiFp(e).callServiceBlindTransferCall(i,a,n).then(e=>e(r,t)),callServiceConfirmPush:(i,a)=>CallServiceApiFp(e).callServiceConfirmPush(i,a).then(e=>e(r,t)),callServiceCreateCall:(i,a)=>CallServiceApiFp(e).callServiceCreateCall(i,a).then(e=>e(r,t)),callServiceCreateCallAnnotation:(i,a,n)=>CallServiceApiFp(e).callServiceCreateCallAnnotation(i,a,n).then(e=>e(r,t)),callServiceDeleteCallAnnotation:(i,a,n)=>CallServiceApiFp(e).callServiceDeleteCallAnnotation(i,a,n).then(e=>e(r,t)),callServiceDtmfCall:(i,a,n)=>CallServiceApiFp(e).callServiceDtmfCall(i,a,n).then(e=>e(r,t)),callServiceEavesdropCall:(i,a,n)=>CallServiceApiFp(e).callServiceEavesdropCall(i,a,n).then(e=>e(r,t)),callServiceHangupCall:(i,a,n)=>CallServiceApiFp(e).callServiceHangupCall(i,a,n).then(e=>e(r,t)),callServiceHoldCall:(i,a,n)=>CallServiceApiFp(e).callServiceHoldCall(i,a,n).then(e=>e(r,t)),callServiceReadCall:(i,a,n)=>CallServiceApiFp(e).callServiceReadCall(i,a,n).then(e=>e(r,t)),callServiceSearchActiveCall:(i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w,C,q,R,P,T,_,E,k,K,O)=>CallServiceApiFp(e).callServiceSearchActiveCall(i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w,C,q,R,P,T,_,E,k,K,O).then(e=>e(r,t)),callServiceSearchHistoryCall:(i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w,C,q,R,P,T,_,E,k,K,O,x,F,I,B,U,H,W,D,X,Q)=>CallServiceApiFp(e).callServiceSearchHistoryCall(i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w,C,q,R,P,T,_,E,k,K,O,x,F,I,B,U,H,W,D,X,Q).then(e=>e(r,t)),callServiceUnHoldCall:(i,a,n)=>CallServiceApiFp(e).callServiceUnHoldCall(i,a,n).then(e=>e(r,t)),callServiceUpdateCallAnnotation:(i,a,n,o)=>CallServiceApiFp(e).callServiceUpdateCallAnnotation(i,a,n,o).then(e=>e(r,t))}};class CallServiceApi extends BaseAPI{callServiceAggregateHistoryCall(e,t){return CallServiceApiFp(this.configuration).callServiceAggregateHistoryCall(e,t).then(e=>e(this.axios,this.basePath))}callServiceBlindTransferCall(e,t,r){return CallServiceApiFp(this.configuration).callServiceBlindTransferCall(e,t,r).then(e=>e(this.axios,this.basePath))}callServiceConfirmPush(e,t){return CallServiceApiFp(this.configuration).callServiceConfirmPush(e,t).then(e=>e(this.axios,this.basePath))}callServiceCreateCall(e,t){return CallServiceApiFp(this.configuration).callServiceCreateCall(e,t).then(e=>e(this.axios,this.basePath))}callServiceCreateCallAnnotation(e,t,r){return CallServiceApiFp(this.configuration).callServiceCreateCallAnnotation(e,t,r).then(e=>e(this.axios,this.basePath))}callServiceDeleteCallAnnotation(e,t,r){return CallServiceApiFp(this.configuration).callServiceDeleteCallAnnotation(e,t,r).then(e=>e(this.axios,this.basePath))}callServiceDtmfCall(e,t,r){return CallServiceApiFp(this.configuration).callServiceDtmfCall(e,t,r).then(e=>e(this.axios,this.basePath))}callServiceEavesdropCall(e,t,r){return CallServiceApiFp(this.configuration).callServiceEavesdropCall(e,t,r).then(e=>e(this.axios,this.basePath))}callServiceHangupCall(e,t,r){return CallServiceApiFp(this.configuration).callServiceHangupCall(e,t,r).then(e=>e(this.axios,this.basePath))}callServiceHoldCall(e,t,r){return CallServiceApiFp(this.configuration).callServiceHoldCall(e,t,r).then(e=>e(this.axios,this.basePath))}callServiceReadCall(e,t,r){return CallServiceApiFp(this.configuration).callServiceReadCall(e,t,r).then(e=>e(this.axios,this.basePath))}callServiceSearchActiveCall(e,t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w,C,q,R,P,T,_,E){return CallServiceApiFp(this.configuration).callServiceSearchActiveCall(e,t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w,C,q,R,P,T,_,E).then(e=>e(this.axios,this.basePath))}callServiceSearchHistoryCall(e,t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w,C,q,R,P,T,_,E,k,K,O,x,F,I,B,U,H,W){return CallServiceApiFp(this.configuration).callServiceSearchHistoryCall(e,t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w,C,q,R,P,T,_,E,k,K,O,x,F,I,B,U,H,W).then(e=>e(this.axios,this.basePath))}callServiceUnHoldCall(e,t,r){return CallServiceApiFp(this.configuration).callServiceUnHoldCall(e,t,r).then(e=>e(this.axios,this.basePath))}callServiceUpdateCallAnnotation(e,t,r,i){return CallServiceApiFp(this.configuration).callServiceUpdateCallAnnotation(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const CognitiveProfileServiceApiAxiosParamCreator=function(e){return{createCognitiveProfile:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCognitiveProfile.");const i=parse("/storage/cognitive_profiles",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},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}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteCognitiveProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteCognitiveProfile.");const i="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const o={method:"DELETE",...n,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let c=n&&n.headers?n.headers:{};return o.headers={...s,...c,...r.headers},{url:format(a),options:o}},patchCognitiveProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchCognitiveProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchCognitiveProfile.");const a="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},readCognitiveProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readCognitiveProfile.");const i="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const o={method:"GET",...n,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let c=n&&n.headers?n.headers:{};return o.headers={...s,...c,...r.headers},{url:format(a),options:o}},searchCognitiveProfile:async(t,r,i,a,n,o,s,c,u={})=>{const l=parse("/storage/cognitive_profiles",!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},S={};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&&(S.page=t),void 0!==r&&(S.size=r),void 0!==i&&(S.q=i),void 0!==a&&(S.sort=a),n&&(S.fields=n),o&&(S.id=o),s&&(S.service=s),void 0!==c&&(S.enabled=c),l.query={...l.query,...S,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},updateCognitiveProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCognitiveProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateCognitiveProfile.");const a="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}}}},CognitiveProfileServiceApiFp=function(e){return{async createCognitiveProfile(t,r){const i=await CognitiveProfileServiceApiAxiosParamCreator(e).createCognitiveProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteCognitiveProfile(t,r){const i=await CognitiveProfileServiceApiAxiosParamCreator(e).deleteCognitiveProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchCognitiveProfile(t,r,i){const a=await CognitiveProfileServiceApiAxiosParamCreator(e).patchCognitiveProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readCognitiveProfile(t,r){const i=await CognitiveProfileServiceApiAxiosParamCreator(e).readCognitiveProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchCognitiveProfile(t,r,i,a,n,o,s,c,u){const l=await CognitiveProfileServiceApiAxiosParamCreator(e).searchCognitiveProfile(t,r,i,a,n,o,s,c,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async updateCognitiveProfile(t,r,i){const a=await CognitiveProfileServiceApiAxiosParamCreator(e).updateCognitiveProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},CognitiveProfileServiceApiFactory=function(e,t,r){return{createCognitiveProfile:(i,a)=>CognitiveProfileServiceApiFp(e).createCognitiveProfile(i,a).then(e=>e(r,t)),deleteCognitiveProfile:(i,a)=>CognitiveProfileServiceApiFp(e).deleteCognitiveProfile(i,a).then(e=>e(r,t)),patchCognitiveProfile:(i,a,n)=>CognitiveProfileServiceApiFp(e).patchCognitiveProfile(i,a,n).then(e=>e(r,t)),readCognitiveProfile:(i,a)=>CognitiveProfileServiceApiFp(e).readCognitiveProfile(i,a).then(e=>e(r,t)),searchCognitiveProfile:(i,a,n,o,s,c,u,l,d)=>CognitiveProfileServiceApiFp(e).searchCognitiveProfile(i,a,n,o,s,c,u,l,d).then(e=>e(r,t)),updateCognitiveProfile:(i,a,n)=>CognitiveProfileServiceApiFp(e).updateCognitiveProfile(i,a,n).then(e=>e(r,t))}};class CognitiveProfileServiceApi extends BaseAPI{createCognitiveProfile(e,t){return CognitiveProfileServiceApiFp(this.configuration).createCognitiveProfile(e,t).then(e=>e(this.axios,this.basePath))}deleteCognitiveProfile(e,t){return CognitiveProfileServiceApiFp(this.configuration).deleteCognitiveProfile(e,t).then(e=>e(this.axios,this.basePath))}patchCognitiveProfile(e,t,r){return CognitiveProfileServiceApiFp(this.configuration).patchCognitiveProfile(e,t,r).then(e=>e(this.axios,this.basePath))}readCognitiveProfile(e,t){return CognitiveProfileServiceApiFp(this.configuration).readCognitiveProfile(e,t).then(e=>e(this.axios,this.basePath))}searchCognitiveProfile(e,t,r,i,a,n,o,s,c){return CognitiveProfileServiceApiFp(this.configuration).searchCognitiveProfile(e,t,r,i,a,n,o,s,c).then(e=>e(this.axios,this.basePath))}updateCognitiveProfile(e,t,r){return CognitiveProfileServiceApiFp(this.configuration).updateCognitiveProfile(e,t,r).then(e=>e(this.axios,this.basePath))}}const CommunicationTypeServiceApiAxiosParamCreator=function(e){return{communicationTypeServiceCreateCommunicationType:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling communicationTypeServiceCreateCommunicationType.");const i=parse("/call_center/communication_type",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},communicationTypeServiceDeleteCommunicationType:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling communicationTypeServiceDeleteCommunicationType.");const a="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},communicationTypeServiceReadCommunicationType:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling communicationTypeServiceReadCommunicationType.");const a="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},communicationTypeServiceSearchCommunicationType:async(t,r,i,a,n,o,s={})=>{const c=parse("/call_center/communication_type",!0);let u;e&&(u=e.baseOptions);const l={method:"GET",...u,...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!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),o&&(p.id=o),c.query={...c.query,...p,...s.query},delete c.search;let h=u&&u.headers?u.headers:{};return l.headers={...d,...h,...s.headers},{url:format(c),options:l}},communicationTypeServiceUpdateCommunicationType:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling communicationTypeServiceUpdateCommunicationType.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling communicationTypeServiceUpdateCommunicationType.");const a="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}}}},CommunicationTypeServiceApiFp=function(e){return{async communicationTypeServiceCreateCommunicationType(t,r){const i=await CommunicationTypeServiceApiAxiosParamCreator(e).communicationTypeServiceCreateCommunicationType(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async communicationTypeServiceDeleteCommunicationType(t,r,i){const a=await CommunicationTypeServiceApiAxiosParamCreator(e).communicationTypeServiceDeleteCommunicationType(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async communicationTypeServiceReadCommunicationType(t,r,i){const a=await CommunicationTypeServiceApiAxiosParamCreator(e).communicationTypeServiceReadCommunicationType(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async communicationTypeServiceSearchCommunicationType(t,r,i,a,n,o,s){const c=await CommunicationTypeServiceApiAxiosParamCreator(e).communicationTypeServiceSearchCommunicationType(t,r,i,a,n,o,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async communicationTypeServiceUpdateCommunicationType(t,r,i){const a=await CommunicationTypeServiceApiAxiosParamCreator(e).communicationTypeServiceUpdateCommunicationType(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},CommunicationTypeServiceApiFactory=function(e,t,r){return{communicationTypeServiceCreateCommunicationType:(i,a)=>CommunicationTypeServiceApiFp(e).communicationTypeServiceCreateCommunicationType(i,a).then(e=>e(r,t)),communicationTypeServiceDeleteCommunicationType:(i,a,n)=>CommunicationTypeServiceApiFp(e).communicationTypeServiceDeleteCommunicationType(i,a,n).then(e=>e(r,t)),communicationTypeServiceReadCommunicationType:(i,a,n)=>CommunicationTypeServiceApiFp(e).communicationTypeServiceReadCommunicationType(i,a,n).then(e=>e(r,t)),communicationTypeServiceSearchCommunicationType:(i,a,n,o,s,c,u)=>CommunicationTypeServiceApiFp(e).communicationTypeServiceSearchCommunicationType(i,a,n,o,s,c,u).then(e=>e(r,t)),communicationTypeServiceUpdateCommunicationType:(i,a,n)=>CommunicationTypeServiceApiFp(e).communicationTypeServiceUpdateCommunicationType(i,a,n).then(e=>e(r,t))}};class CommunicationTypeServiceApi extends BaseAPI{communicationTypeServiceCreateCommunicationType(e,t){return CommunicationTypeServiceApiFp(this.configuration).communicationTypeServiceCreateCommunicationType(e,t).then(e=>e(this.axios,this.basePath))}communicationTypeServiceDeleteCommunicationType(e,t,r){return CommunicationTypeServiceApiFp(this.configuration).communicationTypeServiceDeleteCommunicationType(e,t,r).then(e=>e(this.axios,this.basePath))}communicationTypeServiceReadCommunicationType(e,t,r){return CommunicationTypeServiceApiFp(this.configuration).communicationTypeServiceReadCommunicationType(e,t,r).then(e=>e(this.axios,this.basePath))}communicationTypeServiceSearchCommunicationType(e,t,r,i,a,n,o){return CommunicationTypeServiceApiFp(this.configuration).communicationTypeServiceSearchCommunicationType(e,t,r,i,a,n,o).then(e=>e(this.axios,this.basePath))}communicationTypeServiceUpdateCommunicationType(e,t,r){return CommunicationTypeServiceApiFp(this.configuration).communicationTypeServiceUpdateCommunicationType(e,t,r).then(e=>e(this.axios,this.basePath))}}const EmailProfileServiceApiAxiosParamCreator=function(e){return{emailProfileServiceCreateEmailProfile:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling emailProfileServiceCreateEmailProfile.");const i=parse("/email/profile",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},emailProfileServiceDeleteEmailProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling emailProfileServiceDeleteEmailProfile.");const i="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const o={method:"DELETE",...n,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let c=n&&n.headers?n.headers:{};return o.headers={...s,...c,...r.headers},{url:format(a),options:o}},emailProfileServicePatchEmailProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling emailProfileServicePatchEmailProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling emailProfileServicePatchEmailProfile.");const a="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},emailProfileServiceReadEmailProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling emailProfileServiceReadEmailProfile.");const i="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const o={method:"GET",...n,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let c=n&&n.headers?n.headers:{};return o.headers={...s,...c,...r.headers},{url:format(a),options:o}},emailProfileServiceSearchEmailProfile:async(t,r,i,a,n,o={})=>{const s=parse("/email/profile",!0);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...o},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}void 0!==t&&(d.page=t),void 0!==r&&(d.size=r),void 0!==i&&(d.q=i),void 0!==a&&(d.sort=a),n&&(d.fields=n),s.query={...s.query,...d,...o.query},delete s.search;let p=c&&c.headers?c.headers:{};return u.headers={...l,...p,...o.headers},{url:format(s),options:u}},emailProfileServiceTestEmailProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling emailProfileServiceTestEmailProfile.");const i="/email/profile/{id}/test".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const o={method:"GET",...n,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let c=n&&n.headers?n.headers:{};return o.headers={...s,...c,...r.headers},{url:format(a),options:o}},emailProfileServiceUpdateEmailProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling emailProfileServiceUpdateEmailProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling emailProfileServiceUpdateEmailProfile.");const a="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}}}},EmailProfileServiceApiFp=function(e){return{async emailProfileServiceCreateEmailProfile(t,r){const i=await EmailProfileServiceApiAxiosParamCreator(e).emailProfileServiceCreateEmailProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async emailProfileServiceDeleteEmailProfile(t,r){const i=await EmailProfileServiceApiAxiosParamCreator(e).emailProfileServiceDeleteEmailProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async emailProfileServicePatchEmailProfile(t,r,i){const a=await EmailProfileServiceApiAxiosParamCreator(e).emailProfileServicePatchEmailProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async emailProfileServiceReadEmailProfile(t,r){const i=await EmailProfileServiceApiAxiosParamCreator(e).emailProfileServiceReadEmailProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async emailProfileServiceSearchEmailProfile(t,r,i,a,n,o){const s=await EmailProfileServiceApiAxiosParamCreator(e).emailProfileServiceSearchEmailProfile(t,r,i,a,n,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async emailProfileServiceTestEmailProfile(t,r){const i=await EmailProfileServiceApiAxiosParamCreator(e).emailProfileServiceTestEmailProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async emailProfileServiceUpdateEmailProfile(t,r,i){const a=await EmailProfileServiceApiAxiosParamCreator(e).emailProfileServiceUpdateEmailProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},EmailProfileServiceApiFactory=function(e,t,r){return{emailProfileServiceCreateEmailProfile:(i,a)=>EmailProfileServiceApiFp(e).emailProfileServiceCreateEmailProfile(i,a).then(e=>e(r,t)),emailProfileServiceDeleteEmailProfile:(i,a)=>EmailProfileServiceApiFp(e).emailProfileServiceDeleteEmailProfile(i,a).then(e=>e(r,t)),emailProfileServicePatchEmailProfile:(i,a,n)=>EmailProfileServiceApiFp(e).emailProfileServicePatchEmailProfile(i,a,n).then(e=>e(r,t)),emailProfileServiceReadEmailProfile:(i,a)=>EmailProfileServiceApiFp(e).emailProfileServiceReadEmailProfile(i,a).then(e=>e(r,t)),emailProfileServiceSearchEmailProfile:(i,a,n,o,s,c)=>EmailProfileServiceApiFp(e).emailProfileServiceSearchEmailProfile(i,a,n,o,s,c).then(e=>e(r,t)),emailProfileServiceTestEmailProfile:(i,a)=>EmailProfileServiceApiFp(e).emailProfileServiceTestEmailProfile(i,a).then(e=>e(r,t)),emailProfileServiceUpdateEmailProfile:(i,a,n)=>EmailProfileServiceApiFp(e).emailProfileServiceUpdateEmailProfile(i,a,n).then(e=>e(r,t))}};class EmailProfileServiceApi extends BaseAPI{emailProfileServiceCreateEmailProfile(e,t){return EmailProfileServiceApiFp(this.configuration).emailProfileServiceCreateEmailProfile(e,t).then(e=>e(this.axios,this.basePath))}emailProfileServiceDeleteEmailProfile(e,t){return EmailProfileServiceApiFp(this.configuration).emailProfileServiceDeleteEmailProfile(e,t).then(e=>e(this.axios,this.basePath))}emailProfileServicePatchEmailProfile(e,t,r){return EmailProfileServiceApiFp(this.configuration).emailProfileServicePatchEmailProfile(e,t,r).then(e=>e(this.axios,this.basePath))}emailProfileServiceReadEmailProfile(e,t){return EmailProfileServiceApiFp(this.configuration).emailProfileServiceReadEmailProfile(e,t).then(e=>e(this.axios,this.basePath))}emailProfileServiceSearchEmailProfile(e,t,r,i,a,n){return EmailProfileServiceApiFp(this.configuration).emailProfileServiceSearchEmailProfile(e,t,r,i,a,n).then(e=>e(this.axios,this.basePath))}emailProfileServiceTestEmailProfile(e,t){return EmailProfileServiceApiFp(this.configuration).emailProfileServiceTestEmailProfile(e,t).then(e=>e(this.axios,this.basePath))}emailProfileServiceUpdateEmailProfile(e,t,r){return EmailProfileServiceApiFp(this.configuration).emailProfileServiceUpdateEmailProfile(e,t,r).then(e=>e(this.axios,this.basePath))}}const FileServiceApiAxiosParamCreator=function(e){return{deleteFiles:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling deleteFiles.");const i=parse("/storage/file",!0);let a;e&&(a=e.baseOptions);const n={method:"DELETE",...a,...r},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}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}}}},FileServiceApiFp=function(e){return{async deleteFiles(t,r){const i=await FileServiceApiAxiosParamCreator(e).deleteFiles(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}}}},FileServiceApiFactory=function(e,t,r){return{deleteFiles:(i,a)=>FileServiceApiFp(e).deleteFiles(i,a).then(e=>e(r,t))}};class FileServiceApi extends BaseAPI{deleteFiles(e,t){return FileServiceApiFp(this.configuration).deleteFiles(e,t).then(e=>e(this.axios,this.basePath))}}const FileTranscriptServiceApiAxiosParamCreator=function(e){return{createFileTranscript:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createFileTranscript.");const i=parse("/storage/transcript_file",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},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}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteFileTranscript:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling deleteFileTranscript.");const i=parse("/storage/transcript_file",!0);let a;e&&(a=e.baseOptions);const n={method:"DELETE",...a,...r},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}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},getFileTranscriptPhrases:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling getFileTranscriptPhrases.");const n="/storage/transcript_file/{id}/phrases".replace("{id}",encodeURIComponent(String(t))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...a},u={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(l.page=r),void 0!==i&&(l.size=i),o.query={...o.query,...l,...a.query},delete o.search;let d=s&&s.headers?s.headers:{};return c.headers={...u,...d,...a.headers},{url:format(o),options:c}}}},FileTranscriptServiceApiFp=function(e){return{async createFileTranscript(t,r){const i=await FileTranscriptServiceApiAxiosParamCreator(e).createFileTranscript(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteFileTranscript(t,r){const i=await FileTranscriptServiceApiAxiosParamCreator(e).deleteFileTranscript(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async getFileTranscriptPhrases(t,r,i,a){const n=await FileTranscriptServiceApiAxiosParamCreator(e).getFileTranscriptPhrases(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},FileTranscriptServiceApiFactory=function(e,t,r){return{createFileTranscript:(i,a)=>FileTranscriptServiceApiFp(e).createFileTranscript(i,a).then(e=>e(r,t)),deleteFileTranscript:(i,a)=>FileTranscriptServiceApiFp(e).deleteFileTranscript(i,a).then(e=>e(r,t)),getFileTranscriptPhrases:(i,a,n,o)=>FileTranscriptServiceApiFp(e).getFileTranscriptPhrases(i,a,n,o).then(e=>e(r,t))}};class FileTranscriptServiceApi extends BaseAPI{createFileTranscript(e,t){return FileTranscriptServiceApiFp(this.configuration).createFileTranscript(e,t).then(e=>e(this.axios,this.basePath))}deleteFileTranscript(e,t){return FileTranscriptServiceApiFp(this.configuration).deleteFileTranscript(e,t).then(e=>e(this.axios,this.basePath))}getFileTranscriptPhrases(e,t,r,i){return FileTranscriptServiceApiFp(this.configuration).getFileTranscriptPhrases(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const ImportTemplateServiceApiAxiosParamCreator=function(e){return{createImportTemplate:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createImportTemplate.");const i=parse("/storage/import_templates",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},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}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteImportTemplate:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteImportTemplate.");const i="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const o={method:"DELETE",...n,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let c=n&&n.headers?n.headers:{};return o.headers={...s,...c,...r.headers},{url:format(a),options:o}},patchImportTemplate:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchImportTemplate.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchImportTemplate.");const a="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},readImportTemplate:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readImportTemplate.");const i="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const o={method:"GET",...n,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let c=n&&n.headers?n.headers:{};return o.headers={...s,...c,...r.headers},{url:format(a),options:o}},searchImportTemplate:async(t,r,i,a,n,o,s={})=>{const c=parse("/storage/import_templates",!0);let u;e&&(u=e.baseOptions);const l={method:"GET",...u,...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!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),o&&(p.id=o),c.query={...c.query,...p,...s.query},delete c.search;let h=u&&u.headers?u.headers:{};return l.headers={...d,...h,...s.headers},{url:format(c),options:l}},updateImportTemplate:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateImportTemplate.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateImportTemplate.");const a="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}}}},ImportTemplateServiceApiFp=function(e){return{async createImportTemplate(t,r){const i=await ImportTemplateServiceApiAxiosParamCreator(e).createImportTemplate(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteImportTemplate(t,r){const i=await ImportTemplateServiceApiAxiosParamCreator(e).deleteImportTemplate(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchImportTemplate(t,r,i){const a=await ImportTemplateServiceApiAxiosParamCreator(e).patchImportTemplate(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readImportTemplate(t,r){const i=await ImportTemplateServiceApiAxiosParamCreator(e).readImportTemplate(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchImportTemplate(t,r,i,a,n,o,s){const c=await ImportTemplateServiceApiAxiosParamCreator(e).searchImportTemplate(t,r,i,a,n,o,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async updateImportTemplate(t,r,i){const a=await ImportTemplateServiceApiAxiosParamCreator(e).updateImportTemplate(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},ImportTemplateServiceApiFactory=function(e,t,r){return{createImportTemplate:(i,a)=>ImportTemplateServiceApiFp(e).createImportTemplate(i,a).then(e=>e(r,t)),deleteImportTemplate:(i,a)=>ImportTemplateServiceApiFp(e).deleteImportTemplate(i,a).then(e=>e(r,t)),patchImportTemplate:(i,a,n)=>ImportTemplateServiceApiFp(e).patchImportTemplate(i,a,n).then(e=>e(r,t)),readImportTemplate:(i,a)=>ImportTemplateServiceApiFp(e).readImportTemplate(i,a).then(e=>e(r,t)),searchImportTemplate:(i,a,n,o,s,c,u)=>ImportTemplateServiceApiFp(e).searchImportTemplate(i,a,n,o,s,c,u).then(e=>e(r,t)),updateImportTemplate:(i,a,n)=>ImportTemplateServiceApiFp(e).updateImportTemplate(i,a,n).then(e=>e(r,t))}};class ImportTemplateServiceApi extends BaseAPI{createImportTemplate(e,t){return ImportTemplateServiceApiFp(this.configuration).createImportTemplate(e,t).then(e=>e(this.axios,this.basePath))}deleteImportTemplate(e,t){return ImportTemplateServiceApiFp(this.configuration).deleteImportTemplate(e,t).then(e=>e(this.axios,this.basePath))}patchImportTemplate(e,t,r){return ImportTemplateServiceApiFp(this.configuration).patchImportTemplate(e,t,r).then(e=>e(this.axios,this.basePath))}readImportTemplate(e,t){return ImportTemplateServiceApiFp(this.configuration).readImportTemplate(e,t).then(e=>e(this.axios,this.basePath))}searchImportTemplate(e,t,r,i,a,n,o){return ImportTemplateServiceApiFp(this.configuration).searchImportTemplate(e,t,r,i,a,n,o).then(e=>e(this.axios,this.basePath))}updateImportTemplate(e,t,r){return ImportTemplateServiceApiFp(this.configuration).updateImportTemplate(e,t,r).then(e=>e(this.axios,this.basePath))}}const ListServiceApiAxiosParamCreator=function(e){return{listServiceCreateList:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling listServiceCreateList.");const i=parse("/call_center/list",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},listServiceCreateListCommunication:async(t,r,i={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling listServiceCreateListCommunication.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling listServiceCreateListCommunication.");const a="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},listServiceDeleteList:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling listServiceDeleteList.");const a="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},listServiceDeleteListCommunication:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling listServiceDeleteListCommunication.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling listServiceDeleteListCommunication.");const n="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"DELETE",...s,...a},u={},l={};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&&(l.domain_id=i),o.query={...o.query,...l,...a.query},delete o.search;let d=s&&s.headers?s.headers:{};return c.headers={...u,...d,...a.headers},{url:format(o),options:c}},listServiceReadList:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling listServiceReadList.");const a="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},listServiceReadListCommunication:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling listServiceReadListCommunication.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling listServiceReadListCommunication.");const n="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...a},u={},l={};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&&(l.domain_id=i),o.query={...o.query,...l,...a.query},delete o.search;let d=s&&s.headers?s.headers:{};return c.headers={...u,...d,...a.headers},{url:format(o),options:c}},listServiceSearchList:async(t,r,i,a,n,o,s={})=>{const c=parse("/call_center/list",!0);let u;e&&(u=e.baseOptions);const l={method:"GET",...u,...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!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),o&&(p.id=o),c.query={...c.query,...p,...s.query},delete c.search;let h=u&&u.headers?u.headers:{};return l.headers={...d,...h,...s.headers},{url:format(c),options:l}},listServiceSearchListCommunication:async(t,r,i,a,n,o,s,c,u,l={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling listServiceSearchListCommunication.");const d="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(t))),p=parse(d,!0);let h;e&&(h=e.baseOptions);const S={method:"GET",...h,...l},g={},v={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==r&&(v.page=r),void 0!==i&&(v.size=i),void 0!==a&&(v.q=a),void 0!==n&&(v.sort=n),o&&(v.fields=o),s&&(v.id=s),void 0!==c&&(v["expire_at.from"]=c),void 0!==u&&(v["expire_at.to"]=u),p.query={...p.query,...v,...l.query},delete p.search;let m=h&&h.headers?h.headers:{};return S.headers={...g,...m,...l.headers},{url:format(p),options:S}},listServiceUpdateList:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling listServiceUpdateList.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling listServiceUpdateList.");const a="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},listServiceUpdateListCommunication:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling listServiceUpdateListCommunication.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling listServiceUpdateListCommunication.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling listServiceUpdateListCommunication.");const n="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"PUT",...s,...a},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",o.query={...o.query,...a.query},delete o.search;let l=s&&s.headers?s.headers:{};c.headers={...u,...l,...a.headers};const d="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},ListServiceApiFp=function(e){return{async listServiceCreateList(t,r){const i=await ListServiceApiAxiosParamCreator(e).listServiceCreateList(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async listServiceCreateListCommunication(t,r,i){const a=await ListServiceApiAxiosParamCreator(e).listServiceCreateListCommunication(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async listServiceDeleteList(t,r,i){const a=await ListServiceApiAxiosParamCreator(e).listServiceDeleteList(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async listServiceDeleteListCommunication(t,r,i,a){const n=await ListServiceApiAxiosParamCreator(e).listServiceDeleteListCommunication(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async listServiceReadList(t,r,i){const a=await ListServiceApiAxiosParamCreator(e).listServiceReadList(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async listServiceReadListCommunication(t,r,i,a){const n=await ListServiceApiAxiosParamCreator(e).listServiceReadListCommunication(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async listServiceSearchList(t,r,i,a,n,o,s){const c=await ListServiceApiAxiosParamCreator(e).listServiceSearchList(t,r,i,a,n,o,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async listServiceSearchListCommunication(t,r,i,a,n,o,s,c,u,l){const d=await ListServiceApiAxiosParamCreator(e).listServiceSearchListCommunication(t,r,i,a,n,o,s,c,u,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async listServiceUpdateList(t,r,i){const a=await ListServiceApiAxiosParamCreator(e).listServiceUpdateList(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async listServiceUpdateListCommunication(t,r,i,a){const n=await ListServiceApiAxiosParamCreator(e).listServiceUpdateListCommunication(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},ListServiceApiFactory=function(e,t,r){return{listServiceCreateList:(i,a)=>ListServiceApiFp(e).listServiceCreateList(i,a).then(e=>e(r,t)),listServiceCreateListCommunication:(i,a,n)=>ListServiceApiFp(e).listServiceCreateListCommunication(i,a,n).then(e=>e(r,t)),listServiceDeleteList:(i,a,n)=>ListServiceApiFp(e).listServiceDeleteList(i,a,n).then(e=>e(r,t)),listServiceDeleteListCommunication:(i,a,n,o)=>ListServiceApiFp(e).listServiceDeleteListCommunication(i,a,n,o).then(e=>e(r,t)),listServiceReadList:(i,a,n)=>ListServiceApiFp(e).listServiceReadList(i,a,n).then(e=>e(r,t)),listServiceReadListCommunication:(i,a,n,o)=>ListServiceApiFp(e).listServiceReadListCommunication(i,a,n,o).then(e=>e(r,t)),listServiceSearchList:(i,a,n,o,s,c,u)=>ListServiceApiFp(e).listServiceSearchList(i,a,n,o,s,c,u).then(e=>e(r,t)),listServiceSearchListCommunication:(i,a,n,o,s,c,u,l,d,p)=>ListServiceApiFp(e).listServiceSearchListCommunication(i,a,n,o,s,c,u,l,d,p).then(e=>e(r,t)),listServiceUpdateList:(i,a,n)=>ListServiceApiFp(e).listServiceUpdateList(i,a,n).then(e=>e(r,t)),listServiceUpdateListCommunication:(i,a,n,o)=>ListServiceApiFp(e).listServiceUpdateListCommunication(i,a,n,o).then(e=>e(r,t))}};class ListServiceApi extends BaseAPI{listServiceCreateList(e,t){return ListServiceApiFp(this.configuration).listServiceCreateList(e,t).then(e=>e(this.axios,this.basePath))}listServiceCreateListCommunication(e,t,r){return ListServiceApiFp(this.configuration).listServiceCreateListCommunication(e,t,r).then(e=>e(this.axios,this.basePath))}listServiceDeleteList(e,t,r){return ListServiceApiFp(this.configuration).listServiceDeleteList(e,t,r).then(e=>e(this.axios,this.basePath))}listServiceDeleteListCommunication(e,t,r,i){return ListServiceApiFp(this.configuration).listServiceDeleteListCommunication(e,t,r,i).then(e=>e(this.axios,this.basePath))}listServiceReadList(e,t,r){return ListServiceApiFp(this.configuration).listServiceReadList(e,t,r).then(e=>e(this.axios,this.basePath))}listServiceReadListCommunication(e,t,r,i){return ListServiceApiFp(this.configuration).listServiceReadListCommunication(e,t,r,i).then(e=>e(this.axios,this.basePath))}listServiceSearchList(e,t,r,i,a,n,o){return ListServiceApiFp(this.configuration).listServiceSearchList(e,t,r,i,a,n,o).then(e=>e(this.axios,this.basePath))}listServiceSearchListCommunication(e,t,r,i,a,n,o,s,c,u){return ListServiceApiFp(this.configuration).listServiceSearchListCommunication(e,t,r,i,a,n,o,s,c,u).then(e=>e(this.axios,this.basePath))}listServiceUpdateList(e,t,r){return ListServiceApiFp(this.configuration).listServiceUpdateList(e,t,r).then(e=>e(this.axios,this.basePath))}listServiceUpdateListCommunication(e,t,r,i){return ListServiceApiFp(this.configuration).listServiceUpdateListCommunication(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const MediaFileServiceApiAxiosParamCreator=function(e){return{deleteMediaFile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteMediaFile.");const a="/storage/media/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},readMediaFile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readMediaFile.");const a="/storage/media/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},searchMediaFile:async(t,r,i,a,n,o,s={})=>{const c=parse("/storage/media",!0);let u;e&&(u=e.baseOptions);const l={method:"GET",...u,...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!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),o&&(p.id=o),c.query={...c.query,...p,...s.query},delete c.search;let h=u&&u.headers?u.headers:{};return l.headers={...d,...h,...s.headers},{url:format(c),options:l}}}},MediaFileServiceApiFp=function(e){return{async deleteMediaFile(t,r,i){const a=await MediaFileServiceApiAxiosParamCreator(e).deleteMediaFile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readMediaFile(t,r,i){const a=await MediaFileServiceApiAxiosParamCreator(e).readMediaFile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchMediaFile(t,r,i,a,n,o,s){const c=await MediaFileServiceApiAxiosParamCreator(e).searchMediaFile(t,r,i,a,n,o,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}}}},MediaFileServiceApiFactory=function(e,t,r){return{deleteMediaFile:(i,a,n)=>MediaFileServiceApiFp(e).deleteMediaFile(i,a,n).then(e=>e(r,t)),readMediaFile:(i,a,n)=>MediaFileServiceApiFp(e).readMediaFile(i,a,n).then(e=>e(r,t)),searchMediaFile:(i,a,n,o,s,c,u)=>MediaFileServiceApiFp(e).searchMediaFile(i,a,n,o,s,c,u).then(e=>e(r,t))}};class MediaFileServiceApi extends BaseAPI{deleteMediaFile(e,t,r){return MediaFileServiceApiFp(this.configuration).deleteMediaFile(e,t,r).then(e=>e(this.axios,this.basePath))}readMediaFile(e,t,r){return MediaFileServiceApiFp(this.configuration).readMediaFile(e,t,r).then(e=>e(this.axios,this.basePath))}searchMediaFile(e,t,r,i,a,n,o){return MediaFileServiceApiFp(this.configuration).searchMediaFile(e,t,r,i,a,n,o).then(e=>e(this.axios,this.basePath))}}const MemberServiceApiAxiosParamCreator=function(e){return{memberServiceAttemptCallback:async(t,r,i={})=>{if(null==t)throw new RequiredError("attemptId","Required parameter attemptId was null or undefined when calling memberServiceAttemptCallback.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling memberServiceAttemptCallback.");const a="/call_center/attempts/{attempt_id}".replace("{attempt_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},memberServiceAttemptResult:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling memberServiceAttemptResult.");if(null==r)throw new RequiredError("memberId","Required parameter memberId was null or undefined when calling memberServiceAttemptResult.");if(null==i)throw new RequiredError("attemptId","Required parameter attemptId was null or undefined when calling memberServiceAttemptResult.");if(null==a)throw new RequiredError("body","Required parameter body was null or undefined when calling memberServiceAttemptResult.");const o="/call_center/queues/{queue_id}/members/{member_id}/attempts/{attempt_id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{member_id}",encodeURIComponent(String(r))).replace("{attempt_id}",encodeURIComponent(String(i))),s=parse(o,!0);let c;e&&(c=e.baseOptions);const u={method:"PATCH",...c,...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",s.query={...s.query,...n.query},delete s.search;let d=c&&c.headers?c.headers:{};u.headers={...l,...d,...n.headers};const p="string"!=typeof a||"application/json"===u.headers["Content-Type"];return u.data=p?JSON.stringify(void 0!==a?a:{}):a||"",{url:format(s),options:u}},memberServiceAttemptsRenewalResult:async(t,r,i={})=>{if(null==t)throw new RequiredError("attemptId","Required parameter attemptId was null or undefined when calling memberServiceAttemptsRenewalResult.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling memberServiceAttemptsRenewalResult.");const a="/call_center/queues/attempts/{attempt_id}/renewal".replace("{attempt_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},memberServiceCreateAttempt:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling memberServiceCreateAttempt.");if(null==r)throw new RequiredError("memberId","Required parameter memberId was null or undefined when calling memberServiceCreateAttempt.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling memberServiceCreateAttempt.");const n="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(t))).replace("{member_id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"POST",...s,...a},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",o.query={...o.query,...a.query},delete o.search;let l=s&&s.headers?s.headers:{};c.headers={...u,...l,...a.headers};const d="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}},memberServiceCreateMember:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling memberServiceCreateMember.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling memberServiceCreateMember.");const a="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},memberServiceCreateMemberBulk:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling memberServiceCreateMemberBulk.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling memberServiceCreateMemberBulk.");const a="/call_center/queues/{queue_id}/members/bulk".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},memberServiceDeleteMember:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling memberServiceDeleteMember.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling memberServiceDeleteMember.");const n="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"DELETE",...s,...a},u={},l={};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&&(l.domain_id=i),o.query={...o.query,...l,...a.query},delete o.search;let d=s&&s.headers?s.headers:{};return c.headers={...u,...d,...a.headers},{url:format(o),options:c}},memberServiceDeleteMembers:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling memberServiceDeleteMembers.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling memberServiceDeleteMembers.");const a="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},memberServicePatchMember:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling memberServicePatchMember.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling memberServicePatchMember.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling memberServicePatchMember.");const n="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"PATCH",...s,...a},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",o.query={...o.query,...a.query},delete o.search;let l=s&&s.headers?s.headers:{};c.headers={...u,...l,...a.headers};const d="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}},memberServiceReadMember:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling memberServiceReadMember.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling memberServiceReadMember.");const n="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...a},u={},l={};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&&(l.domain_id=i),o.query={...o.query,...l,...a.query},delete o.search;let d=s&&s.headers?s.headers:{};return c.headers={...u,...d,...a.headers},{url:format(o),options:c}},memberServiceResetMembers:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling memberServiceResetMembers.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling memberServiceResetMembers.");const a="/call_center/queues/{queue_id}/members/reset".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},memberServiceSearchAttempts:async(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f={})=>{const b=parse("/call_center/queues/attempts/active",!0);let w;e&&(w=e.baseOptions);const C={method:"GET",...w,...f},q={},R={};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&&(R.page=t),void 0!==r&&(R.size=r),void 0!==i&&(R.q=i),void 0!==a&&(R.sort=a),n&&(R.fields=n),void 0!==o&&(R["joined_at.from"]=o),void 0!==s&&(R["joined_at.to"]=s),c&&(R.id=c),u&&(R.queue_id=u),l&&(R.bucket_id=l),d&&(R.member_id=d),p&&(R.agent_id=p),h&&(R.result=h),void 0!==S&&(R["leaving_at.from"]=S),void 0!==g&&(R["leaving_at.to"]=g),void 0!==v&&(R["offering_at.from"]=v),void 0!==m&&(R["offering_at.to"]=m),void 0!==y&&(R["duration.from"]=y),void 0!==A&&(R["duration.to"]=A),b.query={...b.query,...R,...f.query},delete b.search;let P=w&&w.headers?w.headers:{};return C.headers={...q,...P,...f.headers},{url:format(b),options:C}},memberServiceSearchAttemptsHistory:async(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f={})=>{const b=parse("/call_center/queues/attempts/history",!0);let w;e&&(w=e.baseOptions);const C={method:"GET",...w,...f},q={},R={};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&&(R.page=t),void 0!==r&&(R.size=r),void 0!==i&&(R.q=i),void 0!==a&&(R.sort=a),n&&(R.fields=n),void 0!==o&&(R["joined_at.from"]=o),void 0!==s&&(R["joined_at.to"]=s),c&&(R.id=c),u&&(R.queue_id=u),l&&(R.bucket_id=l),d&&(R.member_id=d),p&&(R.agent_id=p),h&&(R.result=h),void 0!==S&&(R["leaving_at.from"]=S),void 0!==g&&(R["leaving_at.to"]=g),void 0!==v&&(R["offering_at.from"]=v),void 0!==m&&(R["offering_at.to"]=m),void 0!==y&&(R["duration.from"]=y),void 0!==A&&(R["duration.to"]=A),b.query={...b.query,...R,...f.query},delete b.search;let P=w&&w.headers?w.headers:{};return C.headers={...q,...P,...f.headers},{url:format(b),options:C}},memberServiceSearchMemberAttempts:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling memberServiceSearchMemberAttempts.");if(null==r)throw new RequiredError("memberId","Required parameter memberId was null or undefined when calling memberServiceSearchMemberAttempts.");const n="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(t))).replace("{member_id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...a},u={},l={};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&&(l.domain_id=i),o.query={...o.query,...l,...a.query},delete o.search;let d=s&&s.headers?s.headers:{};return c.headers={...u,...d,...a.headers},{url:format(o),options:c}},memberServiceSearchMemberInQueue:async(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling memberServiceSearchMemberInQueue.");const w="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(t))),C=parse(w,!0);let q;e&&(q=e.baseOptions);const R={method:"GET",...q,...b},P={},T={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;P["X-Webitel-Access"]=t}void 0!==r&&(T.page=r),void 0!==i&&(T.size=i),void 0!==a&&(T.q=a),void 0!==n&&(T.sort=n),o&&(T.fields=o),s&&(T.id=s),c&&(T.bucket_id=c),void 0!==u&&(T.destination=u),void 0!==l&&(T["created_at.from"]=l),void 0!==d&&(T["created_at.to"]=d),void 0!==p&&(T["offering_at.from"]=p),void 0!==h&&(T["offering_at.to"]=h),S&&(T.stop_cause=S),void 0!==g&&(T["priority.from"]=g),void 0!==v&&(T["priority.to"]=v),void 0!==m&&(T.name=m),void 0!==y&&(T["attempts.from"]=y),void 0!==A&&(T["attempts.to"]=A),f&&(T.agent_id=f),C.query={...C.query,...T,...b.query},delete C.search;let _=q&&q.headers?q.headers:{};return R.headers={...P,..._,...b.headers},{url:format(C),options:R}},memberServiceSearchMembers:async(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b={})=>{const w=parse("/call_center/members",!0);let C;e&&(C=e.baseOptions);const q={method:"GET",...C,...b},R={},P={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;R["X-Webitel-Access"]=t}void 0!==t&&(P.page=t),void 0!==r&&(P.size=r),void 0!==i&&(P.q=i),void 0!==a&&(P.sort=a),n&&(P.fields=n),o&&(P.id=o),s&&(P.queue_id=s),c&&(P.bucket_id=c),void 0!==u&&(P.destination=u),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),S&&(P.stop_cause=S),void 0!==g&&(P["priority.from"]=g),void 0!==v&&(P["priority.to"]=v),void 0!==m&&(P.name=m),void 0!==y&&(P["attempts.from"]=y),void 0!==A&&(P["attempts.to"]=A),f&&(P.agent_id=f),w.query={...w.query,...P,...b.query},delete w.search;let T=C&&C.headers?C.headers:{};return q.headers={...R,...T,...b.headers},{url:format(w),options:q}},memberServiceUpdateMember:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling memberServiceUpdateMember.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling memberServiceUpdateMember.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling memberServiceUpdateMember.");const n="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"PUT",...s,...a},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",o.query={...o.query,...a.query},delete o.search;let l=s&&s.headers?s.headers:{};c.headers={...u,...l,...a.headers};const d="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},MemberServiceApiFp=function(e){return{async memberServiceAttemptCallback(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).memberServiceAttemptCallback(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async memberServiceAttemptResult(t,r,i,a,n){const o=await MemberServiceApiAxiosParamCreator(e).memberServiceAttemptResult(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...o.options,url:t+o.url};return e.request(r)}},async memberServiceAttemptsRenewalResult(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).memberServiceAttemptsRenewalResult(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async memberServiceCreateAttempt(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).memberServiceCreateAttempt(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async memberServiceCreateMember(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).memberServiceCreateMember(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async memberServiceCreateMemberBulk(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).memberServiceCreateMemberBulk(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async memberServiceDeleteMember(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).memberServiceDeleteMember(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async memberServiceDeleteMembers(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).memberServiceDeleteMembers(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async memberServicePatchMember(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).memberServicePatchMember(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async memberServiceReadMember(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).memberServiceReadMember(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async memberServiceResetMembers(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).memberServiceResetMembers(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async memberServiceSearchAttempts(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f){const b=await MemberServiceApiAxiosParamCreator(e).memberServiceSearchAttempts(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f);return(e=globalAxios,t=BASE_PATH)=>{const r={...b.options,url:t+b.url};return e.request(r)}},async memberServiceSearchAttemptsHistory(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f){const b=await MemberServiceApiAxiosParamCreator(e).memberServiceSearchAttemptsHistory(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f);return(e=globalAxios,t=BASE_PATH)=>{const r={...b.options,url:t+b.url};return e.request(r)}},async memberServiceSearchMemberAttempts(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).memberServiceSearchMemberAttempts(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async memberServiceSearchMemberInQueue(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b){const w=await MemberServiceApiAxiosParamCreator(e).memberServiceSearchMemberInQueue(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b);return(e=globalAxios,t=BASE_PATH)=>{const r={...w.options,url:t+w.url};return e.request(r)}},async memberServiceSearchMembers(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b){const w=await MemberServiceApiAxiosParamCreator(e).memberServiceSearchMembers(t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b);return(e=globalAxios,t=BASE_PATH)=>{const r={...w.options,url:t+w.url};return e.request(r)}},async memberServiceUpdateMember(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).memberServiceUpdateMember(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},MemberServiceApiFactory=function(e,t,r){return{memberServiceAttemptCallback:(i,a,n)=>MemberServiceApiFp(e).memberServiceAttemptCallback(i,a,n).then(e=>e(r,t)),memberServiceAttemptResult:(i,a,n,o,s)=>MemberServiceApiFp(e).memberServiceAttemptResult(i,a,n,o,s).then(e=>e(r,t)),memberServiceAttemptsRenewalResult:(i,a,n)=>MemberServiceApiFp(e).memberServiceAttemptsRenewalResult(i,a,n).then(e=>e(r,t)),memberServiceCreateAttempt:(i,a,n,o)=>MemberServiceApiFp(e).memberServiceCreateAttempt(i,a,n,o).then(e=>e(r,t)),memberServiceCreateMember:(i,a,n)=>MemberServiceApiFp(e).memberServiceCreateMember(i,a,n).then(e=>e(r,t)),memberServiceCreateMemberBulk:(i,a,n)=>MemberServiceApiFp(e).memberServiceCreateMemberBulk(i,a,n).then(e=>e(r,t)),memberServiceDeleteMember:(i,a,n,o)=>MemberServiceApiFp(e).memberServiceDeleteMember(i,a,n,o).then(e=>e(r,t)),memberServiceDeleteMembers:(i,a,n)=>MemberServiceApiFp(e).memberServiceDeleteMembers(i,a,n).then(e=>e(r,t)),memberServicePatchMember:(i,a,n,o)=>MemberServiceApiFp(e).memberServicePatchMember(i,a,n,o).then(e=>e(r,t)),memberServiceReadMember:(i,a,n,o)=>MemberServiceApiFp(e).memberServiceReadMember(i,a,n,o).then(e=>e(r,t)),memberServiceResetMembers:(i,a,n)=>MemberServiceApiFp(e).memberServiceResetMembers(i,a,n).then(e=>e(r,t)),memberServiceSearchAttempts:(i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w)=>MemberServiceApiFp(e).memberServiceSearchAttempts(i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w).then(e=>e(r,t)),memberServiceSearchAttemptsHistory:(i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w)=>MemberServiceApiFp(e).memberServiceSearchAttemptsHistory(i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w).then(e=>e(r,t)),memberServiceSearchMemberAttempts:(i,a,n,o)=>MemberServiceApiFp(e).memberServiceSearchMemberAttempts(i,a,n,o).then(e=>e(r,t)),memberServiceSearchMemberInQueue:(i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w,C)=>MemberServiceApiFp(e).memberServiceSearchMemberInQueue(i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w,C).then(e=>e(r,t)),memberServiceSearchMembers:(i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w,C)=>MemberServiceApiFp(e).memberServiceSearchMembers(i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f,b,w,C).then(e=>e(r,t)),memberServiceUpdateMember:(i,a,n,o)=>MemberServiceApiFp(e).memberServiceUpdateMember(i,a,n,o).then(e=>e(r,t))}};class MemberServiceApi extends BaseAPI{memberServiceAttemptCallback(e,t,r){return MemberServiceApiFp(this.configuration).memberServiceAttemptCallback(e,t,r).then(e=>e(this.axios,this.basePath))}memberServiceAttemptResult(e,t,r,i,a){return MemberServiceApiFp(this.configuration).memberServiceAttemptResult(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}memberServiceAttemptsRenewalResult(e,t,r){return MemberServiceApiFp(this.configuration).memberServiceAttemptsRenewalResult(e,t,r).then(e=>e(this.axios,this.basePath))}memberServiceCreateAttempt(e,t,r,i){return MemberServiceApiFp(this.configuration).memberServiceCreateAttempt(e,t,r,i).then(e=>e(this.axios,this.basePath))}memberServiceCreateMember(e,t,r){return MemberServiceApiFp(this.configuration).memberServiceCreateMember(e,t,r).then(e=>e(this.axios,this.basePath))}memberServiceCreateMemberBulk(e,t,r){return MemberServiceApiFp(this.configuration).memberServiceCreateMemberBulk(e,t,r).then(e=>e(this.axios,this.basePath))}memberServiceDeleteMember(e,t,r,i){return MemberServiceApiFp(this.configuration).memberServiceDeleteMember(e,t,r,i).then(e=>e(this.axios,this.basePath))}memberServiceDeleteMembers(e,t,r){return MemberServiceApiFp(this.configuration).memberServiceDeleteMembers(e,t,r).then(e=>e(this.axios,this.basePath))}memberServicePatchMember(e,t,r,i){return MemberServiceApiFp(this.configuration).memberServicePatchMember(e,t,r,i).then(e=>e(this.axios,this.basePath))}memberServiceReadMember(e,t,r,i){return MemberServiceApiFp(this.configuration).memberServiceReadMember(e,t,r,i).then(e=>e(this.axios,this.basePath))}memberServiceResetMembers(e,t,r){return MemberServiceApiFp(this.configuration).memberServiceResetMembers(e,t,r).then(e=>e(this.axios,this.basePath))}memberServiceSearchAttempts(e,t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A){return MemberServiceApiFp(this.configuration).memberServiceSearchAttempts(e,t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A).then(e=>e(this.axios,this.basePath))}memberServiceSearchAttemptsHistory(e,t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A){return MemberServiceApiFp(this.configuration).memberServiceSearchAttemptsHistory(e,t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A).then(e=>e(this.axios,this.basePath))}memberServiceSearchMemberAttempts(e,t,r,i){return MemberServiceApiFp(this.configuration).memberServiceSearchMemberAttempts(e,t,r,i).then(e=>e(this.axios,this.basePath))}memberServiceSearchMemberInQueue(e,t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f){return MemberServiceApiFp(this.configuration).memberServiceSearchMemberInQueue(e,t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f).then(e=>e(this.axios,this.basePath))}memberServiceSearchMembers(e,t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f){return MemberServiceApiFp(this.configuration).memberServiceSearchMembers(e,t,r,i,a,n,o,s,c,u,l,d,p,h,S,g,v,m,y,A,f).then(e=>e(this.axios,this.basePath))}memberServiceUpdateMember(e,t,r,i){return MemberServiceApiFp(this.configuration).memberServiceUpdateMember(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const OutboundResourceGroupServiceApiAxiosParamCreator=function(e){return{outboundResourceGroupServiceCreateOutboundResourceGroup:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling outboundResourceGroupServiceCreateOutboundResourceGroup.");const i=parse("/call_center/resource_group",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},outboundResourceGroupServiceCreateOutboundResourceInGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling outboundResourceGroupServiceCreateOutboundResourceInGroup.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling outboundResourceGroupServiceCreateOutboundResourceInGroup.");const a="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},outboundResourceGroupServiceDeleteOutboundResourceGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling outboundResourceGroupServiceDeleteOutboundResourceGroup.");const a="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},outboundResourceGroupServiceDeleteOutboundResourceInGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling outboundResourceGroupServiceDeleteOutboundResourceInGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling outboundResourceGroupServiceDeleteOutboundResourceInGroup.");const n="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"DELETE",...s,...a},u={},l={};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&&(l.domain_id=i),o.query={...o.query,...l,...a.query},delete o.search;let d=s&&s.headers?s.headers:{};return c.headers={...u,...d,...a.headers},{url:format(o),options:c}},outboundResourceGroupServiceReadOutboundResourceGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling outboundResourceGroupServiceReadOutboundResourceGroup.");const a="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},outboundResourceGroupServiceReadOutboundResourceInGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling outboundResourceGroupServiceReadOutboundResourceInGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling outboundResourceGroupServiceReadOutboundResourceInGroup.");const n="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...a},u={},l={};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&&(l.domain_id=i),o.query={...o.query,...l,...a.query},delete o.search;let d=s&&s.headers?s.headers:{};return c.headers={...u,...d,...a.headers},{url:format(o),options:c}},outboundResourceGroupServiceSearchOutboundResourceGroup:async(t,r,i,a,n,o,s={})=>{const c=parse("/call_center/resource_group",!0);let u;e&&(u=e.baseOptions);const l={method:"GET",...u,...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!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),o&&(p.id=o),c.query={...c.query,...p,...s.query},delete c.search;let h=u&&u.headers?u.headers:{};return l.headers={...d,...h,...s.headers},{url:format(c),options:l}},outboundResourceGroupServiceSearchOutboundResourceInGroup:async(t,r,i,a,n,o,s,c={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling outboundResourceGroupServiceSearchOutboundResourceInGroup.");const u="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(t))),l=parse(u,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},S={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(S.page=r),void 0!==i&&(S.size=i),void 0!==a&&(S.q=a),void 0!==n&&(S.sort=n),o&&(S.fields=o),s&&(S.id=s),l.query={...l.query,...S,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},outboundResourceGroupServiceUpdateOutboundResourceGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling outboundResourceGroupServiceUpdateOutboundResourceGroup.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling outboundResourceGroupServiceUpdateOutboundResourceGroup.");const a="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},outboundResourceGroupServiceUpdateOutboundResourceInGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling outboundResourceGroupServiceUpdateOutboundResourceInGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling outboundResourceGroupServiceUpdateOutboundResourceInGroup.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling outboundResourceGroupServiceUpdateOutboundResourceInGroup.");const n="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"PUT",...s,...a},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",o.query={...o.query,...a.query},delete o.search;let l=s&&s.headers?s.headers:{};c.headers={...u,...l,...a.headers};const d="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},OutboundResourceGroupServiceApiFp=function(e){return{async outboundResourceGroupServiceCreateOutboundResourceGroup(t,r){const i=await OutboundResourceGroupServiceApiAxiosParamCreator(e).outboundResourceGroupServiceCreateOutboundResourceGroup(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async outboundResourceGroupServiceCreateOutboundResourceInGroup(t,r,i){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).outboundResourceGroupServiceCreateOutboundResourceInGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async outboundResourceGroupServiceDeleteOutboundResourceGroup(t,r,i){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).outboundResourceGroupServiceDeleteOutboundResourceGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async outboundResourceGroupServiceDeleteOutboundResourceInGroup(t,r,i,a){const n=await OutboundResourceGroupServiceApiAxiosParamCreator(e).outboundResourceGroupServiceDeleteOutboundResourceInGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async outboundResourceGroupServiceReadOutboundResourceGroup(t,r,i){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).outboundResourceGroupServiceReadOutboundResourceGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async outboundResourceGroupServiceReadOutboundResourceInGroup(t,r,i,a){const n=await OutboundResourceGroupServiceApiAxiosParamCreator(e).outboundResourceGroupServiceReadOutboundResourceInGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async outboundResourceGroupServiceSearchOutboundResourceGroup(t,r,i,a,n,o,s){const c=await OutboundResourceGroupServiceApiAxiosParamCreator(e).outboundResourceGroupServiceSearchOutboundResourceGroup(t,r,i,a,n,o,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async outboundResourceGroupServiceSearchOutboundResourceInGroup(t,r,i,a,n,o,s,c){const u=await OutboundResourceGroupServiceApiAxiosParamCreator(e).outboundResourceGroupServiceSearchOutboundResourceInGroup(t,r,i,a,n,o,s,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async outboundResourceGroupServiceUpdateOutboundResourceGroup(t,r,i){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).outboundResourceGroupServiceUpdateOutboundResourceGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async outboundResourceGroupServiceUpdateOutboundResourceInGroup(t,r,i,a){const n=await OutboundResourceGroupServiceApiAxiosParamCreator(e).outboundResourceGroupServiceUpdateOutboundResourceInGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},OutboundResourceGroupServiceApiFactory=function(e,t,r){return{outboundResourceGroupServiceCreateOutboundResourceGroup:(i,a)=>OutboundResourceGroupServiceApiFp(e).outboundResourceGroupServiceCreateOutboundResourceGroup(i,a).then(e=>e(r,t)),outboundResourceGroupServiceCreateOutboundResourceInGroup:(i,a,n)=>OutboundResourceGroupServiceApiFp(e).outboundResourceGroupServiceCreateOutboundResourceInGroup(i,a,n).then(e=>e(r,t)),outboundResourceGroupServiceDeleteOutboundResourceGroup:(i,a,n)=>OutboundResourceGroupServiceApiFp(e).outboundResourceGroupServiceDeleteOutboundResourceGroup(i,a,n).then(e=>e(r,t)),outboundResourceGroupServiceDeleteOutboundResourceInGroup:(i,a,n,o)=>OutboundResourceGroupServiceApiFp(e).outboundResourceGroupServiceDeleteOutboundResourceInGroup(i,a,n,o).then(e=>e(r,t)),outboundResourceGroupServiceReadOutboundResourceGroup:(i,a,n)=>OutboundResourceGroupServiceApiFp(e).outboundResourceGroupServiceReadOutboundResourceGroup(i,a,n).then(e=>e(r,t)),outboundResourceGroupServiceReadOutboundResourceInGroup:(i,a,n,o)=>OutboundResourceGroupServiceApiFp(e).outboundResourceGroupServiceReadOutboundResourceInGroup(i,a,n,o).then(e=>e(r,t)),outboundResourceGroupServiceSearchOutboundResourceGroup:(i,a,n,o,s,c,u)=>OutboundResourceGroupServiceApiFp(e).outboundResourceGroupServiceSearchOutboundResourceGroup(i,a,n,o,s,c,u).then(e=>e(r,t)),outboundResourceGroupServiceSearchOutboundResourceInGroup:(i,a,n,o,s,c,u,l)=>OutboundResourceGroupServiceApiFp(e).outboundResourceGroupServiceSearchOutboundResourceInGroup(i,a,n,o,s,c,u,l).then(e=>e(r,t)),outboundResourceGroupServiceUpdateOutboundResourceGroup:(i,a,n)=>OutboundResourceGroupServiceApiFp(e).outboundResourceGroupServiceUpdateOutboundResourceGroup(i,a,n).then(e=>e(r,t)),outboundResourceGroupServiceUpdateOutboundResourceInGroup:(i,a,n,o)=>OutboundResourceGroupServiceApiFp(e).outboundResourceGroupServiceUpdateOutboundResourceInGroup(i,a,n,o).then(e=>e(r,t))}};class OutboundResourceGroupServiceApi extends BaseAPI{outboundResourceGroupServiceCreateOutboundResourceGroup(e,t){return OutboundResourceGroupServiceApiFp(this.configuration).outboundResourceGroupServiceCreateOutboundResourceGroup(e,t).then(e=>e(this.axios,this.basePath))}outboundResourceGroupServiceCreateOutboundResourceInGroup(e,t,r){return OutboundResourceGroupServiceApiFp(this.configuration).outboundResourceGroupServiceCreateOutboundResourceInGroup(e,t,r).then(e=>e(this.axios,this.basePath))}outboundResourceGroupServiceDeleteOutboundResourceGroup(e,t,r){return OutboundResourceGroupServiceApiFp(this.configuration).outboundResourceGroupServiceDeleteOutboundResourceGroup(e,t,r).then(e=>e(this.axios,this.basePath))}outboundResourceGroupServiceDeleteOutboundResourceInGroup(e,t,r,i){return OutboundResourceGroupServiceApiFp(this.configuration).outboundResourceGroupServiceDeleteOutboundResourceInGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}outboundResourceGroupServiceReadOutboundResourceGroup(e,t,r){return OutboundResourceGroupServiceApiFp(this.configuration).outboundResourceGroupServiceReadOutboundResourceGroup(e,t,r).then(e=>e(this.axios,this.basePath))}outboundResourceGroupServiceReadOutboundResourceInGroup(e,t,r,i){return OutboundResourceGroupServiceApiFp(this.configuration).outboundResourceGroupServiceReadOutboundResourceInGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}outboundResourceGroupServiceSearchOutboundResourceGroup(e,t,r,i,a,n,o){return OutboundResourceGroupServiceApiFp(this.configuration).outboundResourceGroupServiceSearchOutboundResourceGroup(e,t,r,i,a,n,o).then(e=>e(this.axios,this.basePath))}outboundResourceGroupServiceSearchOutboundResourceInGroup(e,t,r,i,a,n,o,s){return OutboundResourceGroupServiceApiFp(this.configuration).outboundResourceGroupServiceSearchOutboundResourceInGroup(e,t,r,i,a,n,o,s).then(e=>e(this.axios,this.basePath))}outboundResourceGroupServiceUpdateOutboundResourceGroup(e,t,r){return OutboundResourceGroupServiceApiFp(this.configuration).outboundResourceGroupServiceUpdateOutboundResourceGroup(e,t,r).then(e=>e(this.axios,this.basePath))}outboundResourceGroupServiceUpdateOutboundResourceInGroup(e,t,r,i){return OutboundResourceGroupServiceApiFp(this.configuration).outboundResourceGroupServiceUpdateOutboundResourceInGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const OutboundResourceServiceApiAxiosParamCreator=function(e){return{outboundResourceServiceCreateOutboundResource:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling outboundResourceServiceCreateOutboundResource.");const i=parse("/call_center/resources",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},outboundResourceServiceCreateOutboundResourceDisplay:async(t,r,i={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling outboundResourceServiceCreateOutboundResourceDisplay.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling outboundResourceServiceCreateOutboundResourceDisplay.");const a="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},outboundResourceServiceDeleteOutboundResource:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling outboundResourceServiceDeleteOutboundResource.");const a="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},outboundResourceServiceDeleteOutboundResourceDisplay:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling outboundResourceServiceDeleteOutboundResourceDisplay.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling outboundResourceServiceDeleteOutboundResourceDisplay.");const n="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"DELETE",...s,...a},u={},l={};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&&(l.domain_id=i),o.query={...o.query,...l,...a.query},delete o.search;let d=s&&s.headers?s.headers:{};return c.headers={...u,...d,...a.headers},{url:format(o),options:c}},outboundResourceServicePatchOutboundResource:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling outboundResourceServicePatchOutboundResource.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling outboundResourceServicePatchOutboundResource.");const a="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},outboundResourceServiceReadOutboundResource:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling outboundResourceServiceReadOutboundResource.");const a="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},outboundResourceServiceReadOutboundResourceDisplay:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling outboundResourceServiceReadOutboundResourceDisplay.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling outboundResourceServiceReadOutboundResourceDisplay.");const n="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...a},u={},l={};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&&(l.domain_id=i),o.query={...o.query,...l,...a.query},delete o.search;let d=s&&s.headers?s.headers:{};return c.headers={...u,...d,...a.headers},{url:format(o),options:c}},outboundResourceServiceSearchOutboundResource:async(t,r,i,a,n,o,s={})=>{const c=parse("/call_center/resources",!0);let u;e&&(u=e.baseOptions);const l={method:"GET",...u,...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!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),o&&(p.id=o),c.query={...c.query,...p,...s.query},delete c.search;let h=u&&u.headers?u.headers:{};return l.headers={...d,...h,...s.headers},{url:format(c),options:l}},outboundResourceServiceSearchOutboundResourceDisplay:async(t,r,i,a,n,o,s,c={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling outboundResourceServiceSearchOutboundResourceDisplay.");const u="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(t))),l=parse(u,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},S={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(S.page=r),void 0!==i&&(S.size=i),void 0!==a&&(S.q=a),void 0!==n&&(S.sort=n),o&&(S.fields=o),s&&(S.id=s),l.query={...l.query,...S,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},outboundResourceServiceUpdateOutboundResource:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling outboundResourceServiceUpdateOutboundResource.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling outboundResourceServiceUpdateOutboundResource.");const a="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},outboundResourceServiceUpdateOutboundResourceDisplay:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling outboundResourceServiceUpdateOutboundResourceDisplay.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling outboundResourceServiceUpdateOutboundResourceDisplay.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling outboundResourceServiceUpdateOutboundResourceDisplay.");const n="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"PUT",...s,...a},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",o.query={...o.query,...a.query},delete o.search;let l=s&&s.headers?s.headers:{};c.headers={...u,...l,...a.headers};const d="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},OutboundResourceServiceApiFp=function(e){return{async outboundResourceServiceCreateOutboundResource(t,r){const i=await OutboundResourceServiceApiAxiosParamCreator(e).outboundResourceServiceCreateOutboundResource(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async outboundResourceServiceCreateOutboundResourceDisplay(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).outboundResourceServiceCreateOutboundResourceDisplay(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async outboundResourceServiceDeleteOutboundResource(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).outboundResourceServiceDeleteOutboundResource(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async outboundResourceServiceDeleteOutboundResourceDisplay(t,r,i,a){const n=await OutboundResourceServiceApiAxiosParamCreator(e).outboundResourceServiceDeleteOutboundResourceDisplay(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async outboundResourceServicePatchOutboundResource(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).outboundResourceServicePatchOutboundResource(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async outboundResourceServiceReadOutboundResource(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).outboundResourceServiceReadOutboundResource(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async outboundResourceServiceReadOutboundResourceDisplay(t,r,i,a){const n=await OutboundResourceServiceApiAxiosParamCreator(e).outboundResourceServiceReadOutboundResourceDisplay(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async outboundResourceServiceSearchOutboundResource(t,r,i,a,n,o,s){const c=await OutboundResourceServiceApiAxiosParamCreator(e).outboundResourceServiceSearchOutboundResource(t,r,i,a,n,o,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async outboundResourceServiceSearchOutboundResourceDisplay(t,r,i,a,n,o,s,c){const u=await OutboundResourceServiceApiAxiosParamCreator(e).outboundResourceServiceSearchOutboundResourceDisplay(t,r,i,a,n,o,s,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async outboundResourceServiceUpdateOutboundResource(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).outboundResourceServiceUpdateOutboundResource(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async outboundResourceServiceUpdateOutboundResourceDisplay(t,r,i,a){const n=await OutboundResourceServiceApiAxiosParamCreator(e).outboundResourceServiceUpdateOutboundResourceDisplay(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},OutboundResourceServiceApiFactory=function(e,t,r){return{outboundResourceServiceCreateOutboundResource:(i,a)=>OutboundResourceServiceApiFp(e).outboundResourceServiceCreateOutboundResource(i,a).then(e=>e(r,t)),outboundResourceServiceCreateOutboundResourceDisplay:(i,a,n)=>OutboundResourceServiceApiFp(e).outboundResourceServiceCreateOutboundResourceDisplay(i,a,n).then(e=>e(r,t)),outboundResourceServiceDeleteOutboundResource:(i,a,n)=>OutboundResourceServiceApiFp(e).outboundResourceServiceDeleteOutboundResource(i,a,n).then(e=>e(r,t)),outboundResourceServiceDeleteOutboundResourceDisplay:(i,a,n,o)=>OutboundResourceServiceApiFp(e).outboundResourceServiceDeleteOutboundResourceDisplay(i,a,n,o).then(e=>e(r,t)),outboundResourceServicePatchOutboundResource:(i,a,n)=>OutboundResourceServiceApiFp(e).outboundResourceServicePatchOutboundResource(i,a,n).then(e=>e(r,t)),outboundResourceServiceReadOutboundResource:(i,a,n)=>OutboundResourceServiceApiFp(e).outboundResourceServiceReadOutboundResource(i,a,n).then(e=>e(r,t)),outboundResourceServiceReadOutboundResourceDisplay:(i,a,n,o)=>OutboundResourceServiceApiFp(e).outboundResourceServiceReadOutboundResourceDisplay(i,a,n,o).then(e=>e(r,t)),outboundResourceServiceSearchOutboundResource:(i,a,n,o,s,c,u)=>OutboundResourceServiceApiFp(e).outboundResourceServiceSearchOutboundResource(i,a,n,o,s,c,u).then(e=>e(r,t)),outboundResourceServiceSearchOutboundResourceDisplay:(i,a,n,o,s,c,u,l)=>OutboundResourceServiceApiFp(e).outboundResourceServiceSearchOutboundResourceDisplay(i,a,n,o,s,c,u,l).then(e=>e(r,t)),outboundResourceServiceUpdateOutboundResource:(i,a,n)=>OutboundResourceServiceApiFp(e).outboundResourceServiceUpdateOutboundResource(i,a,n).then(e=>e(r,t)),outboundResourceServiceUpdateOutboundResourceDisplay:(i,a,n,o)=>OutboundResourceServiceApiFp(e).outboundResourceServiceUpdateOutboundResourceDisplay(i,a,n,o).then(e=>e(r,t))}};class OutboundResourceServiceApi extends BaseAPI{outboundResourceServiceCreateOutboundResource(e,t){return OutboundResourceServiceApiFp(this.configuration).outboundResourceServiceCreateOutboundResource(e,t).then(e=>e(this.axios,this.basePath))}outboundResourceServiceCreateOutboundResourceDisplay(e,t,r){return OutboundResourceServiceApiFp(this.configuration).outboundResourceServiceCreateOutboundResourceDisplay(e,t,r).then(e=>e(this.axios,this.basePath))}outboundResourceServiceDeleteOutboundResource(e,t,r){return OutboundResourceServiceApiFp(this.configuration).outboundResourceServiceDeleteOutboundResource(e,t,r).then(e=>e(this.axios,this.basePath))}outboundResourceServiceDeleteOutboundResourceDisplay(e,t,r,i){return OutboundResourceServiceApiFp(this.configuration).outboundResourceServiceDeleteOutboundResourceDisplay(e,t,r,i).then(e=>e(this.axios,this.basePath))}outboundResourceServicePatchOutboundResource(e,t,r){return OutboundResourceServiceApiFp(this.configuration).outboundResourceServicePatchOutboundResource(e,t,r).then(e=>e(this.axios,this.basePath))}outboundResourceServiceReadOutboundResource(e,t,r){return OutboundResourceServiceApiFp(this.configuration).outboundResourceServiceReadOutboundResource(e,t,r).then(e=>e(this.axios,this.basePath))}outboundResourceServiceReadOutboundResourceDisplay(e,t,r,i){return OutboundResourceServiceApiFp(this.configuration).outboundResourceServiceReadOutboundResourceDisplay(e,t,r,i).then(e=>e(this.axios,this.basePath))}outboundResourceServiceSearchOutboundResource(e,t,r,i,a,n,o){return OutboundResourceServiceApiFp(this.configuration).outboundResourceServiceSearchOutboundResource(e,t,r,i,a,n,o).then(e=>e(this.axios,this.basePath))}outboundResourceServiceSearchOutboundResourceDisplay(e,t,r,i,a,n,o,s){return OutboundResourceServiceApiFp(this.configuration).outboundResourceServiceSearchOutboundResourceDisplay(e,t,r,i,a,n,o,s).then(e=>e(this.axios,this.basePath))}outboundResourceServiceUpdateOutboundResource(e,t,r){return OutboundResourceServiceApiFp(this.configuration).outboundResourceServiceUpdateOutboundResource(e,t,r).then(e=>e(this.axios,this.basePath))}outboundResourceServiceUpdateOutboundResourceDisplay(e,t,r,i){return OutboundResourceServiceApiFp(this.configuration).outboundResourceServiceUpdateOutboundResourceDisplay(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const QueueBucketServiceApiAxiosParamCreator=function(e){return{queueBucketServiceCreateQueueBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueBucketServiceCreateQueueBucket.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling queueBucketServiceCreateQueueBucket.");const a="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},queueBucketServiceDeleteQueueBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueBucketServiceDeleteQueueBucket.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling queueBucketServiceDeleteQueueBucket.");const a="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},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}n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};return s.headers={...c,...u,...i.headers},{url:format(n),options:s}},queueBucketServicePatchQueueBucket:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueBucketServicePatchQueueBucket.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling queueBucketServicePatchQueueBucket.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling queueBucketServicePatchQueueBucket.");const n="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"PATCH",...s,...a},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",o.query={...o.query,...a.query},delete o.search;let l=s&&s.headers?s.headers:{};c.headers={...u,...l,...a.headers};const d="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}},queueBucketServiceReadQueueBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueBucketServiceReadQueueBucket.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling queueBucketServiceReadQueueBucket.");const a="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},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}n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};return s.headers={...c,...u,...i.headers},{url:format(n),options:s}},queueBucketServiceSearchQueueBucket:async(t,r,i,a,n,o,s,c={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueBucketServiceSearchQueueBucket.");const u="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(t))),l=parse(u,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},S={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(S.page=r),void 0!==i&&(S.size=i),void 0!==a&&(S.q=a),void 0!==n&&(S.sort=n),o&&(S.fields=o),s&&(S.id=s),l.query={...l.query,...S,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},queueBucketServiceUpdateQueueBucket:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueBucketServiceUpdateQueueBucket.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling queueBucketServiceUpdateQueueBucket.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling queueBucketServiceUpdateQueueBucket.");const n="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"PUT",...s,...a},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",o.query={...o.query,...a.query},delete o.search;let l=s&&s.headers?s.headers:{};c.headers={...u,...l,...a.headers};const d="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},QueueBucketServiceApiFp=function(e){return{async queueBucketServiceCreateQueueBucket(t,r,i){const a=await QueueBucketServiceApiAxiosParamCreator(e).queueBucketServiceCreateQueueBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async queueBucketServiceDeleteQueueBucket(t,r,i){const a=await QueueBucketServiceApiAxiosParamCreator(e).queueBucketServiceDeleteQueueBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async queueBucketServicePatchQueueBucket(t,r,i,a){const n=await QueueBucketServiceApiAxiosParamCreator(e).queueBucketServicePatchQueueBucket(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async queueBucketServiceReadQueueBucket(t,r,i){const a=await QueueBucketServiceApiAxiosParamCreator(e).queueBucketServiceReadQueueBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async queueBucketServiceSearchQueueBucket(t,r,i,a,n,o,s,c){const u=await QueueBucketServiceApiAxiosParamCreator(e).queueBucketServiceSearchQueueBucket(t,r,i,a,n,o,s,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async queueBucketServiceUpdateQueueBucket(t,r,i,a){const n=await QueueBucketServiceApiAxiosParamCreator(e).queueBucketServiceUpdateQueueBucket(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},QueueBucketServiceApiFactory=function(e,t,r){return{queueBucketServiceCreateQueueBucket:(i,a,n)=>QueueBucketServiceApiFp(e).queueBucketServiceCreateQueueBucket(i,a,n).then(e=>e(r,t)),queueBucketServiceDeleteQueueBucket:(i,a,n)=>QueueBucketServiceApiFp(e).queueBucketServiceDeleteQueueBucket(i,a,n).then(e=>e(r,t)),queueBucketServicePatchQueueBucket:(i,a,n,o)=>QueueBucketServiceApiFp(e).queueBucketServicePatchQueueBucket(i,a,n,o).then(e=>e(r,t)),queueBucketServiceReadQueueBucket:(i,a,n)=>QueueBucketServiceApiFp(e).queueBucketServiceReadQueueBucket(i,a,n).then(e=>e(r,t)),queueBucketServiceSearchQueueBucket:(i,a,n,o,s,c,u,l)=>QueueBucketServiceApiFp(e).queueBucketServiceSearchQueueBucket(i,a,n,o,s,c,u,l).then(e=>e(r,t)),queueBucketServiceUpdateQueueBucket:(i,a,n,o)=>QueueBucketServiceApiFp(e).queueBucketServiceUpdateQueueBucket(i,a,n,o).then(e=>e(r,t))}};class QueueBucketServiceApi extends BaseAPI{queueBucketServiceCreateQueueBucket(e,t,r){return QueueBucketServiceApiFp(this.configuration).queueBucketServiceCreateQueueBucket(e,t,r).then(e=>e(this.axios,this.basePath))}queueBucketServiceDeleteQueueBucket(e,t,r){return QueueBucketServiceApiFp(this.configuration).queueBucketServiceDeleteQueueBucket(e,t,r).then(e=>e(this.axios,this.basePath))}queueBucketServicePatchQueueBucket(e,t,r,i){return QueueBucketServiceApiFp(this.configuration).queueBucketServicePatchQueueBucket(e,t,r,i).then(e=>e(this.axios,this.basePath))}queueBucketServiceReadQueueBucket(e,t,r){return QueueBucketServiceApiFp(this.configuration).queueBucketServiceReadQueueBucket(e,t,r).then(e=>e(this.axios,this.basePath))}queueBucketServiceSearchQueueBucket(e,t,r,i,a,n,o,s){return QueueBucketServiceApiFp(this.configuration).queueBucketServiceSearchQueueBucket(e,t,r,i,a,n,o,s).then(e=>e(this.axios,this.basePath))}queueBucketServiceUpdateQueueBucket(e,t,r,i){return QueueBucketServiceApiFp(this.configuration).queueBucketServiceUpdateQueueBucket(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const QueueHookServiceApiAxiosParamCreator=function(e){return{queueHookServiceCreateQueueHook:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueHookServiceCreateQueueHook.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling queueHookServiceCreateQueueHook.");const a="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},queueHookServiceDeleteQueueHook:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueHookServiceDeleteQueueHook.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling queueHookServiceDeleteQueueHook.");const a="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},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}n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};return s.headers={...c,...u,...i.headers},{url:format(n),options:s}},queueHookServicePatchQueueHook:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueHookServicePatchQueueHook.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling queueHookServicePatchQueueHook.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling queueHookServicePatchQueueHook.");const n="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"PATCH",...s,...a},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",o.query={...o.query,...a.query},delete o.search;let l=s&&s.headers?s.headers:{};c.headers={...u,...l,...a.headers};const d="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}},queueHookServiceReadQueueHook:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueHookServiceReadQueueHook.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling queueHookServiceReadQueueHook.");const a="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},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}n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};return s.headers={...c,...u,...i.headers},{url:format(n),options:s}},queueHookServiceSearchQueueHook:async(t,r,i,a,n,o,s,c,u,l={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueHookServiceSearchQueueHook.");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 S={method:"GET",...h,...l},g={},v={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==r&&(v.page=r),void 0!==i&&(v.size=i),void 0!==a&&(v.q=a),void 0!==n&&(v.sort=n),o&&(v.fields=o),s&&(v.id=s),c&&(v.schema_id=c),u&&(v.event=u),p.query={...p.query,...v,...l.query},delete p.search;let m=h&&h.headers?h.headers:{};return S.headers={...g,...m,...l.headers},{url:format(p),options:S}},queueHookServiceUpdateQueueHook:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueHookServiceUpdateQueueHook.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling queueHookServiceUpdateQueueHook.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling queueHookServiceUpdateQueueHook.");const n="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"PUT",...s,...a},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",o.query={...o.query,...a.query},delete o.search;let l=s&&s.headers?s.headers:{};c.headers={...u,...l,...a.headers};const d="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},QueueHookServiceApiFp=function(e){return{async queueHookServiceCreateQueueHook(t,r,i){const a=await QueueHookServiceApiAxiosParamCreator(e).queueHookServiceCreateQueueHook(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async queueHookServiceDeleteQueueHook(t,r,i){const a=await QueueHookServiceApiAxiosParamCreator(e).queueHookServiceDeleteQueueHook(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async queueHookServicePatchQueueHook(t,r,i,a){const n=await QueueHookServiceApiAxiosParamCreator(e).queueHookServicePatchQueueHook(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async queueHookServiceReadQueueHook(t,r,i){const a=await QueueHookServiceApiAxiosParamCreator(e).queueHookServiceReadQueueHook(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async queueHookServiceSearchQueueHook(t,r,i,a,n,o,s,c,u,l){const d=await QueueHookServiceApiAxiosParamCreator(e).queueHookServiceSearchQueueHook(t,r,i,a,n,o,s,c,u,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async queueHookServiceUpdateQueueHook(t,r,i,a){const n=await QueueHookServiceApiAxiosParamCreator(e).queueHookServiceUpdateQueueHook(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},QueueHookServiceApiFactory=function(e,t,r){return{queueHookServiceCreateQueueHook:(i,a,n)=>QueueHookServiceApiFp(e).queueHookServiceCreateQueueHook(i,a,n).then(e=>e(r,t)),queueHookServiceDeleteQueueHook:(i,a,n)=>QueueHookServiceApiFp(e).queueHookServiceDeleteQueueHook(i,a,n).then(e=>e(r,t)),queueHookServicePatchQueueHook:(i,a,n,o)=>QueueHookServiceApiFp(e).queueHookServicePatchQueueHook(i,a,n,o).then(e=>e(r,t)),queueHookServiceReadQueueHook:(i,a,n)=>QueueHookServiceApiFp(e).queueHookServiceReadQueueHook(i,a,n).then(e=>e(r,t)),queueHookServiceSearchQueueHook:(i,a,n,o,s,c,u,l,d,p)=>QueueHookServiceApiFp(e).queueHookServiceSearchQueueHook(i,a,n,o,s,c,u,l,d,p).then(e=>e(r,t)),queueHookServiceUpdateQueueHook:(i,a,n,o)=>QueueHookServiceApiFp(e).queueHookServiceUpdateQueueHook(i,a,n,o).then(e=>e(r,t))}};class QueueHookServiceApi extends BaseAPI{queueHookServiceCreateQueueHook(e,t,r){return QueueHookServiceApiFp(this.configuration).queueHookServiceCreateQueueHook(e,t,r).then(e=>e(this.axios,this.basePath))}queueHookServiceDeleteQueueHook(e,t,r){return QueueHookServiceApiFp(this.configuration).queueHookServiceDeleteQueueHook(e,t,r).then(e=>e(this.axios,this.basePath))}queueHookServicePatchQueueHook(e,t,r,i){return QueueHookServiceApiFp(this.configuration).queueHookServicePatchQueueHook(e,t,r,i).then(e=>e(this.axios,this.basePath))}queueHookServiceReadQueueHook(e,t,r){return QueueHookServiceApiFp(this.configuration).queueHookServiceReadQueueHook(e,t,r).then(e=>e(this.axios,this.basePath))}queueHookServiceSearchQueueHook(e,t,r,i,a,n,o,s,c,u){return QueueHookServiceApiFp(this.configuration).queueHookServiceSearchQueueHook(e,t,r,i,a,n,o,s,c,u).then(e=>e(this.axios,this.basePath))}queueHookServiceUpdateQueueHook(e,t,r,i){return QueueHookServiceApiFp(this.configuration).queueHookServiceUpdateQueueHook(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const QueueResourcesServiceApiAxiosParamCreator=function(e){return{queueResourcesServiceCreateQueueResourceGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueResourcesServiceCreateQueueResourceGroup.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling queueResourcesServiceCreateQueueResourceGroup.");const a="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},queueResourcesServiceDeleteQueueResourceGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueResourcesServiceDeleteQueueResourceGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling queueResourcesServiceDeleteQueueResourceGroup.");const n="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"DELETE",...s,...a},u={},l={};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&&(l.domain_id=i),o.query={...o.query,...l,...a.query},delete o.search;let d=s&&s.headers?s.headers:{};return c.headers={...u,...d,...a.headers},{url:format(o),options:c}},queueResourcesServiceReadQueueResourceGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueResourcesServiceReadQueueResourceGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling queueResourcesServiceReadQueueResourceGroup.");const n="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...a},u={},l={};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&&(l.domain_id=i),o.query={...o.query,...l,...a.query},delete o.search;let d=s&&s.headers?s.headers:{};return c.headers={...u,...d,...a.headers},{url:format(o),options:c}},queueResourcesServiceSearchQueueResourceGroup:async(t,r,i,a,n,o,s,c={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueResourcesServiceSearchQueueResourceGroup.");const u="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(t))),l=parse(u,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},S={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(S.page=r),void 0!==i&&(S.size=i),void 0!==a&&(S.q=a),void 0!==n&&(S.sort=n),o&&(S.fields=o),s&&(S.id=s),l.query={...l.query,...S,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},queueResourcesServiceUpdateQueueResourceGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueResourcesServiceUpdateQueueResourceGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling queueResourcesServiceUpdateQueueResourceGroup.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling queueResourcesServiceUpdateQueueResourceGroup.");const n="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"PUT",...s,...a},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",o.query={...o.query,...a.query},delete o.search;let l=s&&s.headers?s.headers:{};c.headers={...u,...l,...a.headers};const d="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},QueueResourcesServiceApiFp=function(e){return{async queueResourcesServiceCreateQueueResourceGroup(t,r,i){const a=await QueueResourcesServiceApiAxiosParamCreator(e).queueResourcesServiceCreateQueueResourceGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async queueResourcesServiceDeleteQueueResourceGroup(t,r,i,a){const n=await QueueResourcesServiceApiAxiosParamCreator(e).queueResourcesServiceDeleteQueueResourceGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async queueResourcesServiceReadQueueResourceGroup(t,r,i,a){const n=await QueueResourcesServiceApiAxiosParamCreator(e).queueResourcesServiceReadQueueResourceGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async queueResourcesServiceSearchQueueResourceGroup(t,r,i,a,n,o,s,c){const u=await QueueResourcesServiceApiAxiosParamCreator(e).queueResourcesServiceSearchQueueResourceGroup(t,r,i,a,n,o,s,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async queueResourcesServiceUpdateQueueResourceGroup(t,r,i,a){const n=await QueueResourcesServiceApiAxiosParamCreator(e).queueResourcesServiceUpdateQueueResourceGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},QueueResourcesServiceApiFactory=function(e,t,r){return{queueResourcesServiceCreateQueueResourceGroup:(i,a,n)=>QueueResourcesServiceApiFp(e).queueResourcesServiceCreateQueueResourceGroup(i,a,n).then(e=>e(r,t)),queueResourcesServiceDeleteQueueResourceGroup:(i,a,n,o)=>QueueResourcesServiceApiFp(e).queueResourcesServiceDeleteQueueResourceGroup(i,a,n,o).then(e=>e(r,t)),queueResourcesServiceReadQueueResourceGroup:(i,a,n,o)=>QueueResourcesServiceApiFp(e).queueResourcesServiceReadQueueResourceGroup(i,a,n,o).then(e=>e(r,t)),queueResourcesServiceSearchQueueResourceGroup:(i,a,n,o,s,c,u,l)=>QueueResourcesServiceApiFp(e).queueResourcesServiceSearchQueueResourceGroup(i,a,n,o,s,c,u,l).then(e=>e(r,t)),queueResourcesServiceUpdateQueueResourceGroup:(i,a,n,o)=>QueueResourcesServiceApiFp(e).queueResourcesServiceUpdateQueueResourceGroup(i,a,n,o).then(e=>e(r,t))}};class QueueResourcesServiceApi extends BaseAPI{queueResourcesServiceCreateQueueResourceGroup(e,t,r){return QueueResourcesServiceApiFp(this.configuration).queueResourcesServiceCreateQueueResourceGroup(e,t,r).then(e=>e(this.axios,this.basePath))}queueResourcesServiceDeleteQueueResourceGroup(e,t,r,i){return QueueResourcesServiceApiFp(this.configuration).queueResourcesServiceDeleteQueueResourceGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}queueResourcesServiceReadQueueResourceGroup(e,t,r,i){return QueueResourcesServiceApiFp(this.configuration).queueResourcesServiceReadQueueResourceGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}queueResourcesServiceSearchQueueResourceGroup(e,t,r,i,a,n,o,s){return QueueResourcesServiceApiFp(this.configuration).queueResourcesServiceSearchQueueResourceGroup(e,t,r,i,a,n,o,s).then(e=>e(this.axios,this.basePath))}queueResourcesServiceUpdateQueueResourceGroup(e,t,r,i){return QueueResourcesServiceApiFp(this.configuration).queueResourcesServiceUpdateQueueResourceGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const QueueServiceApiAxiosParamCreator=function(e){return{queueServiceCreateQueue:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling queueServiceCreateQueue.");const i=parse("/call_center/queues",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},queueServiceDeleteQueue:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling queueServiceDeleteQueue.");const a="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},queueServicePatchQueue:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling queueServicePatchQueue.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling queueServicePatchQueue.");const a="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},queueServiceReadQueue:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling queueServiceReadQueue.");const a="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},queueServiceSearchQueue:async(t,r,i,a,n,o,s,c={})=>{const u=parse("/call_center/queues",!0);let l;e&&(l=e.baseOptions);const d={method:"GET",...l,...c},p={},h={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;p["X-Webitel-Access"]=t}void 0!==t&&(h.page=t),void 0!==r&&(h.size=r),void 0!==i&&(h.q=i),void 0!==a&&(h.sort=a),n&&(h.fields=n),o&&(h.id=o),s&&(h.type=s),u.query={...u.query,...h,...c.query},delete u.search;let S=l&&l.headers?l.headers:{};return d.headers={...p,...S,...c.headers},{url:format(u),options:d}},queueServiceSearchQueueReportGeneral:async(t,r,i,a,n,o,s,c,u,l,d,p={})=>{const h=parse("/call_center/queues/reports/general",!0);let S;e&&(S=e.baseOptions);const g={method:"GET",...S,...p},v={},m={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;v["X-Webitel-Access"]=t}void 0!==t&&(m.page=t),void 0!==r&&(m.size=r),void 0!==i&&(m["joined_at.from"]=i),void 0!==a&&(m["joined_at.to"]=a),void 0!==n&&(m.domain_id=n),o&&(m.fields=o),void 0!==s&&(m.sort=s),void 0!==c&&(m.q=c),u&&(m.queue_id=u),l&&(m.team_id=l),d&&(m.type=d),h.query={...h.query,...m,...p.query},delete h.search;let y=S&&S.headers?S.headers:{};return g.headers={...v,...y,...p.headers},{url:format(h),options:g}},queueServiceUpdateQueue:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling queueServiceUpdateQueue.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling queueServiceUpdateQueue.");const a="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}}}},QueueServiceApiFp=function(e){return{async queueServiceCreateQueue(t,r){const i=await QueueServiceApiAxiosParamCreator(e).queueServiceCreateQueue(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async queueServiceDeleteQueue(t,r,i){const a=await QueueServiceApiAxiosParamCreator(e).queueServiceDeleteQueue(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async queueServicePatchQueue(t,r,i){const a=await QueueServiceApiAxiosParamCreator(e).queueServicePatchQueue(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async queueServiceReadQueue(t,r,i){const a=await QueueServiceApiAxiosParamCreator(e).queueServiceReadQueue(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async queueServiceSearchQueue(t,r,i,a,n,o,s,c){const u=await QueueServiceApiAxiosParamCreator(e).queueServiceSearchQueue(t,r,i,a,n,o,s,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async queueServiceSearchQueueReportGeneral(t,r,i,a,n,o,s,c,u,l,d,p){const h=await QueueServiceApiAxiosParamCreator(e).queueServiceSearchQueueReportGeneral(t,r,i,a,n,o,s,c,u,l,d,p);return(e=globalAxios,t=BASE_PATH)=>{const r={...h.options,url:t+h.url};return e.request(r)}},async queueServiceUpdateQueue(t,r,i){const a=await QueueServiceApiAxiosParamCreator(e).queueServiceUpdateQueue(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},QueueServiceApiFactory=function(e,t,r){return{queueServiceCreateQueue:(i,a)=>QueueServiceApiFp(e).queueServiceCreateQueue(i,a).then(e=>e(r,t)),queueServiceDeleteQueue:(i,a,n)=>QueueServiceApiFp(e).queueServiceDeleteQueue(i,a,n).then(e=>e(r,t)),queueServicePatchQueue:(i,a,n)=>QueueServiceApiFp(e).queueServicePatchQueue(i,a,n).then(e=>e(r,t)),queueServiceReadQueue:(i,a,n)=>QueueServiceApiFp(e).queueServiceReadQueue(i,a,n).then(e=>e(r,t)),queueServiceSearchQueue:(i,a,n,o,s,c,u,l)=>QueueServiceApiFp(e).queueServiceSearchQueue(i,a,n,o,s,c,u,l).then(e=>e(r,t)),queueServiceSearchQueueReportGeneral:(i,a,n,o,s,c,u,l,d,p,h,S)=>QueueServiceApiFp(e).queueServiceSearchQueueReportGeneral(i,a,n,o,s,c,u,l,d,p,h,S).then(e=>e(r,t)),queueServiceUpdateQueue:(i,a,n)=>QueueServiceApiFp(e).queueServiceUpdateQueue(i,a,n).then(e=>e(r,t))}};class QueueServiceApi extends BaseAPI{queueServiceCreateQueue(e,t){return QueueServiceApiFp(this.configuration).queueServiceCreateQueue(e,t).then(e=>e(this.axios,this.basePath))}queueServiceDeleteQueue(e,t,r){return QueueServiceApiFp(this.configuration).queueServiceDeleteQueue(e,t,r).then(e=>e(this.axios,this.basePath))}queueServicePatchQueue(e,t,r){return QueueServiceApiFp(this.configuration).queueServicePatchQueue(e,t,r).then(e=>e(this.axios,this.basePath))}queueServiceReadQueue(e,t,r){return QueueServiceApiFp(this.configuration).queueServiceReadQueue(e,t,r).then(e=>e(this.axios,this.basePath))}queueServiceSearchQueue(e,t,r,i,a,n,o,s){return QueueServiceApiFp(this.configuration).queueServiceSearchQueue(e,t,r,i,a,n,o,s).then(e=>e(this.axios,this.basePath))}queueServiceSearchQueueReportGeneral(e,t,r,i,a,n,o,s,c,u,l,d){return QueueServiceApiFp(this.configuration).queueServiceSearchQueueReportGeneral(e,t,r,i,a,n,o,s,c,u,l,d).then(e=>e(this.axios,this.basePath))}queueServiceUpdateQueue(e,t,r){return QueueServiceApiFp(this.configuration).queueServiceUpdateQueue(e,t,r).then(e=>e(this.axios,this.basePath))}}const QueueSkillServiceApiAxiosParamCreator=function(e){return{queueSkillServiceCreateQueueSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueSkillServiceCreateQueueSkill.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling queueSkillServiceCreateQueueSkill.");const a="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},queueSkillServiceDeleteQueueSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueSkillServiceDeleteQueueSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling queueSkillServiceDeleteQueueSkill.");const a="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},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}n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};return s.headers={...c,...u,...i.headers},{url:format(n),options:s}},queueSkillServicePatchQueueSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueSkillServicePatchQueueSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling queueSkillServicePatchQueueSkill.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling queueSkillServicePatchQueueSkill.");const n="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"PATCH",...s,...a},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",o.query={...o.query,...a.query},delete o.search;let l=s&&s.headers?s.headers:{};c.headers={...u,...l,...a.headers};const d="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}},queueSkillServiceReadQueueSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueSkillServiceReadQueueSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling queueSkillServiceReadQueueSkill.");const a="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},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}n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};return s.headers={...c,...u,...i.headers},{url:format(n),options:s}},queueSkillServiceSearchQueueSkill:async(t,r,i,a,n,o,s,c,u,l,d,p,h,S={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueSkillServiceSearchQueueSkill.");const g="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(t))),v=parse(g,!0);let m;e&&(m=e.baseOptions);const y={method:"GET",...m,...S},A={},f={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;A["X-Webitel-Access"]=t}void 0!==r&&(f.page=r),void 0!==i&&(f.size=i),void 0!==a&&(f.q=a),void 0!==n&&(f.sort=n),o&&(f.fields=o),s&&(f.id=s),c&&(f.skill_id=c),u&&(f.bucket_id=u),l&&(f.lvl=l),d&&(f.min_capacity=d),p&&(f.max_capacity=p),void 0!==h&&(f.enabled=h),v.query={...v.query,...f,...S.query},delete v.search;let b=m&&m.headers?m.headers:{};return y.headers={...A,...b,...S.headers},{url:format(v),options:y}},queueSkillServiceUpdateQueueSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling queueSkillServiceUpdateQueueSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling queueSkillServiceUpdateQueueSkill.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling queueSkillServiceUpdateQueueSkill.");const n="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"PUT",...s,...a},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",o.query={...o.query,...a.query},delete o.search;let l=s&&s.headers?s.headers:{};c.headers={...u,...l,...a.headers};const d="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}}}},QueueSkillServiceApiFp=function(e){return{async queueSkillServiceCreateQueueSkill(t,r,i){const a=await QueueSkillServiceApiAxiosParamCreator(e).queueSkillServiceCreateQueueSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async queueSkillServiceDeleteQueueSkill(t,r,i){const a=await QueueSkillServiceApiAxiosParamCreator(e).queueSkillServiceDeleteQueueSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async queueSkillServicePatchQueueSkill(t,r,i,a){const n=await QueueSkillServiceApiAxiosParamCreator(e).queueSkillServicePatchQueueSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async queueSkillServiceReadQueueSkill(t,r,i){const a=await QueueSkillServiceApiAxiosParamCreator(e).queueSkillServiceReadQueueSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async queueSkillServiceSearchQueueSkill(t,r,i,a,n,o,s,c,u,l,d,p,h,S){const g=await QueueSkillServiceApiAxiosParamCreator(e).queueSkillServiceSearchQueueSkill(t,r,i,a,n,o,s,c,u,l,d,p,h,S);return(e=globalAxios,t=BASE_PATH)=>{const r={...g.options,url:t+g.url};return e.request(r)}},async queueSkillServiceUpdateQueueSkill(t,r,i,a){const n=await QueueSkillServiceApiAxiosParamCreator(e).queueSkillServiceUpdateQueueSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},QueueSkillServiceApiFactory=function(e,t,r){return{queueSkillServiceCreateQueueSkill:(i,a,n)=>QueueSkillServiceApiFp(e).queueSkillServiceCreateQueueSkill(i,a,n).then(e=>e(r,t)),queueSkillServiceDeleteQueueSkill:(i,a,n)=>QueueSkillServiceApiFp(e).queueSkillServiceDeleteQueueSkill(i,a,n).then(e=>e(r,t)),queueSkillServicePatchQueueSkill:(i,a,n,o)=>QueueSkillServiceApiFp(e).queueSkillServicePatchQueueSkill(i,a,n,o).then(e=>e(r,t)),queueSkillServiceReadQueueSkill:(i,a,n)=>QueueSkillServiceApiFp(e).queueSkillServiceReadQueueSkill(i,a,n).then(e=>e(r,t)),queueSkillServiceSearchQueueSkill:(i,a,n,o,s,c,u,l,d,p,h,S,g,v)=>QueueSkillServiceApiFp(e).queueSkillServiceSearchQueueSkill(i,a,n,o,s,c,u,l,d,p,h,S,g,v).then(e=>e(r,t)),queueSkillServiceUpdateQueueSkill:(i,a,n,o)=>QueueSkillServiceApiFp(e).queueSkillServiceUpdateQueueSkill(i,a,n,o).then(e=>e(r,t))}};class QueueSkillServiceApi extends BaseAPI{queueSkillServiceCreateQueueSkill(e,t,r){return QueueSkillServiceApiFp(this.configuration).queueSkillServiceCreateQueueSkill(e,t,r).then(e=>e(this.axios,this.basePath))}queueSkillServiceDeleteQueueSkill(e,t,r){return QueueSkillServiceApiFp(this.configuration).queueSkillServiceDeleteQueueSkill(e,t,r).then(e=>e(this.axios,this.basePath))}queueSkillServicePatchQueueSkill(e,t,r,i){return QueueSkillServiceApiFp(this.configuration).queueSkillServicePatchQueueSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}queueSkillServiceReadQueueSkill(e,t,r){return QueueSkillServiceApiFp(this.configuration).queueSkillServiceReadQueueSkill(e,t,r).then(e=>e(this.axios,this.basePath))}queueSkillServiceSearchQueueSkill(e,t,r,i,a,n,o,s,c,u,l,d,p,h){return QueueSkillServiceApiFp(this.configuration).queueSkillServiceSearchQueueSkill(e,t,r,i,a,n,o,s,c,u,l,d,p,h).then(e=>e(this.axios,this.basePath))}queueSkillServiceUpdateQueueSkill(e,t,r,i){return QueueSkillServiceApiFp(this.configuration).queueSkillServiceUpdateQueueSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const RegionServiceApiAxiosParamCreator=function(e){return{regionServiceCreateRegion:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling regionServiceCreateRegion.");const i=parse("/regions",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},regionServiceDeleteRegion:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling regionServiceDeleteRegion.");const i="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const o={method:"DELETE",...n,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let c=n&&n.headers?n.headers:{};return o.headers={...s,...c,...r.headers},{url:format(a),options:o}},regionServicePatchRegion:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling regionServicePatchRegion.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling regionServicePatchRegion.");const a="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},regionServiceReadRegion:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling regionServiceReadRegion.");const i="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const o={method:"GET",...n,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let c=n&&n.headers?n.headers:{};return o.headers={...s,...c,...r.headers},{url:format(a),options:o}},regionServiceSearchRegion:async(t,r,i,a,n,o,s,c,u,l={})=>{const d=parse("/regions",!0);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...l},S={},g={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;S["X-Webitel-Access"]=t}void 0!==t&&(g.page=t),void 0!==r&&(g.size=r),void 0!==i&&(g.q=i),void 0!==a&&(g.sort=a),n&&(g.fields=n),o&&(g.id=o),void 0!==s&&(g.name=s),void 0!==c&&(g.description=c),u&&(g.timezone_id=u),d.query={...d.query,...g,...l.query},delete d.search;let v=p&&p.headers?p.headers:{};return h.headers={...S,...v,...l.headers},{url:format(d),options:h}},regionServiceUpdateRegion:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling regionServiceUpdateRegion.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling regionServiceUpdateRegion.");const a="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}}}},RegionServiceApiFp=function(e){return{async regionServiceCreateRegion(t,r){const i=await RegionServiceApiAxiosParamCreator(e).regionServiceCreateRegion(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async regionServiceDeleteRegion(t,r){const i=await RegionServiceApiAxiosParamCreator(e).regionServiceDeleteRegion(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async regionServicePatchRegion(t,r,i){const a=await RegionServiceApiAxiosParamCreator(e).regionServicePatchRegion(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async regionServiceReadRegion(t,r){const i=await RegionServiceApiAxiosParamCreator(e).regionServiceReadRegion(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async regionServiceSearchRegion(t,r,i,a,n,o,s,c,u,l){const d=await RegionServiceApiAxiosParamCreator(e).regionServiceSearchRegion(t,r,i,a,n,o,s,c,u,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async regionServiceUpdateRegion(t,r,i){const a=await RegionServiceApiAxiosParamCreator(e).regionServiceUpdateRegion(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RegionServiceApiFactory=function(e,t,r){return{regionServiceCreateRegion:(i,a)=>RegionServiceApiFp(e).regionServiceCreateRegion(i,a).then(e=>e(r,t)),regionServiceDeleteRegion:(i,a)=>RegionServiceApiFp(e).regionServiceDeleteRegion(i,a).then(e=>e(r,t)),regionServicePatchRegion:(i,a,n)=>RegionServiceApiFp(e).regionServicePatchRegion(i,a,n).then(e=>e(r,t)),regionServiceReadRegion:(i,a)=>RegionServiceApiFp(e).regionServiceReadRegion(i,a).then(e=>e(r,t)),regionServiceSearchRegion:(i,a,n,o,s,c,u,l,d,p)=>RegionServiceApiFp(e).regionServiceSearchRegion(i,a,n,o,s,c,u,l,d,p).then(e=>e(r,t)),regionServiceUpdateRegion:(i,a,n)=>RegionServiceApiFp(e).regionServiceUpdateRegion(i,a,n).then(e=>e(r,t))}};class RegionServiceApi extends BaseAPI{regionServiceCreateRegion(e,t){return RegionServiceApiFp(this.configuration).regionServiceCreateRegion(e,t).then(e=>e(this.axios,this.basePath))}regionServiceDeleteRegion(e,t){return RegionServiceApiFp(this.configuration).regionServiceDeleteRegion(e,t).then(e=>e(this.axios,this.basePath))}regionServicePatchRegion(e,t,r){return RegionServiceApiFp(this.configuration).regionServicePatchRegion(e,t,r).then(e=>e(this.axios,this.basePath))}regionServiceReadRegion(e,t){return RegionServiceApiFp(this.configuration).regionServiceReadRegion(e,t).then(e=>e(this.axios,this.basePath))}regionServiceSearchRegion(e,t,r,i,a,n,o,s,c,u){return RegionServiceApiFp(this.configuration).regionServiceSearchRegion(e,t,r,i,a,n,o,s,c,u).then(e=>e(this.axios,this.basePath))}regionServiceUpdateRegion(e,t,r){return RegionServiceApiFp(this.configuration).regionServiceUpdateRegion(e,t,r).then(e=>e(this.axios,this.basePath))}}const RoutingChatPlanServiceApiAxiosParamCreator=function(e){return{routingChatPlanServiceCreateChatPlan:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling routingChatPlanServiceCreateChatPlan.");const i=parse("/routing/outbound/chat",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},routingChatPlanServiceDeleteChatPlan:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling routingChatPlanServiceDeleteChatPlan.");const i="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const o={method:"DELETE",...n,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let c=n&&n.headers?n.headers:{};return o.headers={...s,...c,...r.headers},{url:format(a),options:o}},routingChatPlanServicePatchChatPlan:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling routingChatPlanServicePatchChatPlan.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling routingChatPlanServicePatchChatPlan.");const a="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},routingChatPlanServiceReadChatPlan:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling routingChatPlanServiceReadChatPlan.");const i="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const o={method:"GET",...n,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let c=n&&n.headers?n.headers:{};return o.headers={...s,...c,...r.headers},{url:format(a),options:o}},routingChatPlanServiceSearchChatPlan:async(t,r,i,a,n,o,s,c,u={})=>{const l=parse("/routing/outbound/chat",!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},S={};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&&(S.page=t),void 0!==r&&(S.size=r),void 0!==i&&(S.q=i),void 0!==a&&(S.sort=a),n&&(S.fields=n),o&&(S.id=o),void 0!==s&&(S.name=s),void 0!==c&&(S.enabled=c),l.query={...l.query,...S,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},routingChatPlanServiceUpdateChatPlan:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling routingChatPlanServiceUpdateChatPlan.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling routingChatPlanServiceUpdateChatPlan.");const a="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}}}},RoutingChatPlanServiceApiFp=function(e){return{async routingChatPlanServiceCreateChatPlan(t,r){const i=await RoutingChatPlanServiceApiAxiosParamCreator(e).routingChatPlanServiceCreateChatPlan(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async routingChatPlanServiceDeleteChatPlan(t,r){const i=await RoutingChatPlanServiceApiAxiosParamCreator(e).routingChatPlanServiceDeleteChatPlan(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async routingChatPlanServicePatchChatPlan(t,r,i){const a=await RoutingChatPlanServiceApiAxiosParamCreator(e).routingChatPlanServicePatchChatPlan(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async routingChatPlanServiceReadChatPlan(t,r){const i=await RoutingChatPlanServiceApiAxiosParamCreator(e).routingChatPlanServiceReadChatPlan(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async routingChatPlanServiceSearchChatPlan(t,r,i,a,n,o,s,c,u){const l=await RoutingChatPlanServiceApiAxiosParamCreator(e).routingChatPlanServiceSearchChatPlan(t,r,i,a,n,o,s,c,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async routingChatPlanServiceUpdateChatPlan(t,r,i){const a=await RoutingChatPlanServiceApiAxiosParamCreator(e).routingChatPlanServiceUpdateChatPlan(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RoutingChatPlanServiceApiFactory=function(e,t,r){return{routingChatPlanServiceCreateChatPlan:(i,a)=>RoutingChatPlanServiceApiFp(e).routingChatPlanServiceCreateChatPlan(i,a).then(e=>e(r,t)),routingChatPlanServiceDeleteChatPlan:(i,a)=>RoutingChatPlanServiceApiFp(e).routingChatPlanServiceDeleteChatPlan(i,a).then(e=>e(r,t)),routingChatPlanServicePatchChatPlan:(i,a,n)=>RoutingChatPlanServiceApiFp(e).routingChatPlanServicePatchChatPlan(i,a,n).then(e=>e(r,t)),routingChatPlanServiceReadChatPlan:(i,a)=>RoutingChatPlanServiceApiFp(e).routingChatPlanServiceReadChatPlan(i,a).then(e=>e(r,t)),routingChatPlanServiceSearchChatPlan:(i,a,n,o,s,c,u,l,d)=>RoutingChatPlanServiceApiFp(e).routingChatPlanServiceSearchChatPlan(i,a,n,o,s,c,u,l,d).then(e=>e(r,t)),routingChatPlanServiceUpdateChatPlan:(i,a,n)=>RoutingChatPlanServiceApiFp(e).routingChatPlanServiceUpdateChatPlan(i,a,n).then(e=>e(r,t))}};class RoutingChatPlanServiceApi extends BaseAPI{routingChatPlanServiceCreateChatPlan(e,t){return RoutingChatPlanServiceApiFp(this.configuration).routingChatPlanServiceCreateChatPlan(e,t).then(e=>e(this.axios,this.basePath))}routingChatPlanServiceDeleteChatPlan(e,t){return RoutingChatPlanServiceApiFp(this.configuration).routingChatPlanServiceDeleteChatPlan(e,t).then(e=>e(this.axios,this.basePath))}routingChatPlanServicePatchChatPlan(e,t,r){return RoutingChatPlanServiceApiFp(this.configuration).routingChatPlanServicePatchChatPlan(e,t,r).then(e=>e(this.axios,this.basePath))}routingChatPlanServiceReadChatPlan(e,t){return RoutingChatPlanServiceApiFp(this.configuration).routingChatPlanServiceReadChatPlan(e,t).then(e=>e(this.axios,this.basePath))}routingChatPlanServiceSearchChatPlan(e,t,r,i,a,n,o,s,c){return RoutingChatPlanServiceApiFp(this.configuration).routingChatPlanServiceSearchChatPlan(e,t,r,i,a,n,o,s,c).then(e=>e(this.axios,this.basePath))}routingChatPlanServiceUpdateChatPlan(e,t,r){return RoutingChatPlanServiceApiFp(this.configuration).routingChatPlanServiceUpdateChatPlan(e,t,r).then(e=>e(this.axios,this.basePath))}}const RoutingOutboundCallServiceApiAxiosParamCreator=function(e){return{routingOutboundCallServiceCreateRoutingOutboundCall:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling routingOutboundCallServiceCreateRoutingOutboundCall.");const i=parse("/routing/outbound/calls",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},routingOutboundCallServiceDeleteRoutingOutboundCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling routingOutboundCallServiceDeleteRoutingOutboundCall.");const a="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},routingOutboundCallServiceMovePositionRoutingOutboundCall:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("fromId","Required parameter fromId was null or undefined when calling routingOutboundCallServiceMovePositionRoutingOutboundCall.");if(null==r)throw new RequiredError("toId","Required parameter toId was null or undefined when calling routingOutboundCallServiceMovePositionRoutingOutboundCall.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling routingOutboundCallServiceMovePositionRoutingOutboundCall.");const n="/routing/outbound/calls/{from_id}/to/{to_id}".replace("{from_id}",encodeURIComponent(String(t))).replace("{to_id}",encodeURIComponent(String(r))),o=parse(n,!0);let s;e&&(s=e.baseOptions);const c={method:"PATCH",...s,...a},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",o.query={...o.query,...a.query},delete o.search;let l=s&&s.headers?s.headers:{};c.headers={...u,...l,...a.headers};const d="string"!=typeof i||"application/json"===c.headers["Content-Type"];return c.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(o),options:c}},routingOutboundCallServicePatchRoutingOutboundCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling routingOutboundCallServicePatchRoutingOutboundCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling routingOutboundCallServicePatchRoutingOutboundCall.");const a="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},routingOutboundCallServiceReadRoutingOutboundCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling routingOutboundCallServiceReadRoutingOutboundCall.");const a="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},routingOutboundCallServiceSearchRoutingOutboundCall:async(t,r,i,a,n,o,s,c,u,l,d={})=>{const p=parse("/routing/outbound/calls",!0);let h;e&&(h=e.baseOptions);const S={method:"GET",...h,...d},g={},v={};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&&(v.page=t),void 0!==r&&(v.size=r),void 0!==i&&(v.q=i),void 0!==a&&(v.sort=a),n&&(v.fields=n),o&&(v.id=o),void 0!==s&&(v.name=s),c&&(v.schema_id=c),void 0!==u&&(v.pattern=u),void 0!==l&&(v.description=l),p.query={...p.query,...v,...d.query},delete p.search;let m=h&&h.headers?h.headers:{};return S.headers={...g,...m,...d.headers},{url:format(p),options:S}},routingOutboundCallServiceUpdateRoutingOutboundCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling routingOutboundCallServiceUpdateRoutingOutboundCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling routingOutboundCallServiceUpdateRoutingOutboundCall.");const a="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}}}},RoutingOutboundCallServiceApiFp=function(e){return{async routingOutboundCallServiceCreateRoutingOutboundCall(t,r){const i=await RoutingOutboundCallServiceApiAxiosParamCreator(e).routingOutboundCallServiceCreateRoutingOutboundCall(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async routingOutboundCallServiceDeleteRoutingOutboundCall(t,r,i){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).routingOutboundCallServiceDeleteRoutingOutboundCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async routingOutboundCallServiceMovePositionRoutingOutboundCall(t,r,i,a){const n=await RoutingOutboundCallServiceApiAxiosParamCreator(e).routingOutboundCallServiceMovePositionRoutingOutboundCall(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async routingOutboundCallServicePatchRoutingOutboundCall(t,r,i){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).routingOutboundCallServicePatchRoutingOutboundCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async routingOutboundCallServiceReadRoutingOutboundCall(t,r,i){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).routingOutboundCallServiceReadRoutingOutboundCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async routingOutboundCallServiceSearchRoutingOutboundCall(t,r,i,a,n,o,s,c,u,l,d){const p=await RoutingOutboundCallServiceApiAxiosParamCreator(e).routingOutboundCallServiceSearchRoutingOutboundCall(t,r,i,a,n,o,s,c,u,l,d);return(e=globalAxios,t=BASE_PATH)=>{const r={...p.options,url:t+p.url};return e.request(r)}},async routingOutboundCallServiceUpdateRoutingOutboundCall(t,r,i){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).routingOutboundCallServiceUpdateRoutingOutboundCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RoutingOutboundCallServiceApiFactory=function(e,t,r){return{routingOutboundCallServiceCreateRoutingOutboundCall:(i,a)=>RoutingOutboundCallServiceApiFp(e).routingOutboundCallServiceCreateRoutingOutboundCall(i,a).then(e=>e(r,t)),routingOutboundCallServiceDeleteRoutingOutboundCall:(i,a,n)=>RoutingOutboundCallServiceApiFp(e).routingOutboundCallServiceDeleteRoutingOutboundCall(i,a,n).then(e=>e(r,t)),routingOutboundCallServiceMovePositionRoutingOutboundCall:(i,a,n,o)=>RoutingOutboundCallServiceApiFp(e).routingOutboundCallServiceMovePositionRoutingOutboundCall(i,a,n,o).then(e=>e(r,t)),routingOutboundCallServicePatchRoutingOutboundCall:(i,a,n)=>RoutingOutboundCallServiceApiFp(e).routingOutboundCallServicePatchRoutingOutboundCall(i,a,n).then(e=>e(r,t)),routingOutboundCallServiceReadRoutingOutboundCall:(i,a,n)=>RoutingOutboundCallServiceApiFp(e).routingOutboundCallServiceReadRoutingOutboundCall(i,a,n).then(e=>e(r,t)),routingOutboundCallServiceSearchRoutingOutboundCall:(i,a,n,o,s,c,u,l,d,p,h)=>RoutingOutboundCallServiceApiFp(e).routingOutboundCallServiceSearchRoutingOutboundCall(i,a,n,o,s,c,u,l,d,p,h).then(e=>e(r,t)),routingOutboundCallServiceUpdateRoutingOutboundCall:(i,a,n)=>RoutingOutboundCallServiceApiFp(e).routingOutboundCallServiceUpdateRoutingOutboundCall(i,a,n).then(e=>e(r,t))}};class RoutingOutboundCallServiceApi extends BaseAPI{routingOutboundCallServiceCreateRoutingOutboundCall(e,t){return RoutingOutboundCallServiceApiFp(this.configuration).routingOutboundCallServiceCreateRoutingOutboundCall(e,t).then(e=>e(this.axios,this.basePath))}routingOutboundCallServiceDeleteRoutingOutboundCall(e,t,r){return RoutingOutboundCallServiceApiFp(this.configuration).routingOutboundCallServiceDeleteRoutingOutboundCall(e,t,r).then(e=>e(this.axios,this.basePath))}routingOutboundCallServiceMovePositionRoutingOutboundCall(e,t,r,i){return RoutingOutboundCallServiceApiFp(this.configuration).routingOutboundCallServiceMovePositionRoutingOutboundCall(e,t,r,i).then(e=>e(this.axios,this.basePath))}routingOutboundCallServicePatchRoutingOutboundCall(e,t,r){return RoutingOutboundCallServiceApiFp(this.configuration).routingOutboundCallServicePatchRoutingOutboundCall(e,t,r).then(e=>e(this.axios,this.basePath))}routingOutboundCallServiceReadRoutingOutboundCall(e,t,r){return RoutingOutboundCallServiceApiFp(this.configuration).routingOutboundCallServiceReadRoutingOutboundCall(e,t,r).then(e=>e(this.axios,this.basePath))}routingOutboundCallServiceSearchRoutingOutboundCall(e,t,r,i,a,n,o,s,c,u,l){return RoutingOutboundCallServiceApiFp(this.configuration).routingOutboundCallServiceSearchRoutingOutboundCall(e,t,r,i,a,n,o,s,c,u,l).then(e=>e(this.axios,this.basePath))}routingOutboundCallServiceUpdateRoutingOutboundCall(e,t,r){return RoutingOutboundCallServiceApiFp(this.configuration).routingOutboundCallServiceUpdateRoutingOutboundCall(e,t,r).then(e=>e(this.axios,this.basePath))}}const RoutingSchemaServiceApiAxiosParamCreator=function(e){return{routingSchemaServiceCreateRoutingSchema:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling routingSchemaServiceCreateRoutingSchema.");const i=parse("/routing/schema",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},routingSchemaServiceDeleteRoutingSchema:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling routingSchemaServiceDeleteRoutingSchema.");const a="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},routingSchemaServicePatchRoutingSchema:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling routingSchemaServicePatchRoutingSchema.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling routingSchemaServicePatchRoutingSchema.");const a="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},routingSchemaServiceReadRoutingSchema:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling routingSchemaServiceReadRoutingSchema.");const a="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},routingSchemaServiceSearchRoutingSchema:async(t,r,i,a,n,o,s,c,u,l,d={})=>{const p=parse("/routing/schema",!0);let h;e&&(h=e.baseOptions);const S={method:"GET",...h,...d},g={},v={};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&&(v.page=t),void 0!==r&&(v.size=r),void 0!==i&&(v.q=i),void 0!==a&&(v.sort=a),n&&(v.fields=n),o&&(v.id=o),void 0!==s&&(v.name=s),c&&(v.type=c),void 0!==u&&(v.editor=u),l&&(v.tags=l),p.query={...p.query,...v,...d.query},delete p.search;let m=h&&h.headers?h.headers:{};return S.headers={...g,...m,...d.headers},{url:format(p),options:S}},routingSchemaServiceSearchRoutingSchemaTags:async(t,r,i,a,n,o,s={})=>{const c=parse("/routing/schema/tags",!0);let u;e&&(u=e.baseOptions);const l={method:"GET",...u,...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!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),o&&(p.type=o),c.query={...c.query,...p,...s.query},delete c.search;let h=u&&u.headers?u.headers:{};return l.headers={...d,...h,...s.headers},{url:format(c),options:l}},routingSchemaServiceUpdateRoutingSchema:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling routingSchemaServiceUpdateRoutingSchema.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling routingSchemaServiceUpdateRoutingSchema.");const a="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}}}},RoutingSchemaServiceApiFp=function(e){return{async routingSchemaServiceCreateRoutingSchema(t,r){const i=await RoutingSchemaServiceApiAxiosParamCreator(e).routingSchemaServiceCreateRoutingSchema(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async routingSchemaServiceDeleteRoutingSchema(t,r,i){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).routingSchemaServiceDeleteRoutingSchema(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async routingSchemaServicePatchRoutingSchema(t,r,i){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).routingSchemaServicePatchRoutingSchema(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async routingSchemaServiceReadRoutingSchema(t,r,i){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).routingSchemaServiceReadRoutingSchema(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async routingSchemaServiceSearchRoutingSchema(t,r,i,a,n,o,s,c,u,l,d){const p=await RoutingSchemaServiceApiAxiosParamCreator(e).routingSchemaServiceSearchRoutingSchema(t,r,i,a,n,o,s,c,u,l,d);return(e=globalAxios,t=BASE_PATH)=>{const r={...p.options,url:t+p.url};return e.request(r)}},async routingSchemaServiceSearchRoutingSchemaTags(t,r,i,a,n,o,s){const c=await RoutingSchemaServiceApiAxiosParamCreator(e).routingSchemaServiceSearchRoutingSchemaTags(t,r,i,a,n,o,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async routingSchemaServiceUpdateRoutingSchema(t,r,i){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).routingSchemaServiceUpdateRoutingSchema(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RoutingSchemaServiceApiFactory=function(e,t,r){return{routingSchemaServiceCreateRoutingSchema:(i,a)=>RoutingSchemaServiceApiFp(e).routingSchemaServiceCreateRoutingSchema(i,a).then(e=>e(r,t)),routingSchemaServiceDeleteRoutingSchema:(i,a,n)=>RoutingSchemaServiceApiFp(e).routingSchemaServiceDeleteRoutingSchema(i,a,n).then(e=>e(r,t)),routingSchemaServicePatchRoutingSchema:(i,a,n)=>RoutingSchemaServiceApiFp(e).routingSchemaServicePatchRoutingSchema(i,a,n).then(e=>e(r,t)),routingSchemaServiceReadRoutingSchema:(i,a,n)=>RoutingSchemaServiceApiFp(e).routingSchemaServiceReadRoutingSchema(i,a,n).then(e=>e(r,t)),routingSchemaServiceSearchRoutingSchema:(i,a,n,o,s,c,u,l,d,p,h)=>RoutingSchemaServiceApiFp(e).routingSchemaServiceSearchRoutingSchema(i,a,n,o,s,c,u,l,d,p,h).then(e=>e(r,t)),routingSchemaServiceSearchRoutingSchemaTags:(i,a,n,o,s,c,u)=>RoutingSchemaServiceApiFp(e).routingSchemaServiceSearchRoutingSchemaTags(i,a,n,o,s,c,u).then(e=>e(r,t)),routingSchemaServiceUpdateRoutingSchema:(i,a,n)=>RoutingSchemaServiceApiFp(e).routingSchemaServiceUpdateRoutingSchema(i,a,n).then(e=>e(r,t))}};class RoutingSchemaServiceApi extends BaseAPI{routingSchemaServiceCreateRoutingSchema(e,t){return RoutingSchemaServiceApiFp(this.configuration).routingSchemaServiceCreateRoutingSchema(e,t).then(e=>e(this.axios,this.basePath))}routingSchemaServiceDeleteRoutingSchema(e,t,r){return RoutingSchemaServiceApiFp(this.configuration).routingSchemaServiceDeleteRoutingSchema(e,t,r).then(e=>e(this.axios,this.basePath))}routingSchemaServicePatchRoutingSchema(e,t,r){return RoutingSchemaServiceApiFp(this.configuration).routingSchemaServicePatchRoutingSchema(e,t,r).then(e=>e(this.axios,this.basePath))}routingSchemaServiceReadRoutingSchema(e,t,r){return RoutingSchemaServiceApiFp(this.configuration).routingSchemaServiceReadRoutingSchema(e,t,r).then(e=>e(this.axios,this.basePath))}routingSchemaServiceSearchRoutingSchema(e,t,r,i,a,n,o,s,c,u,l){return RoutingSchemaServiceApiFp(this.configuration).routingSchemaServiceSearchRoutingSchema(e,t,r,i,a,n,o,s,c,u,l).then(e=>e(this.axios,this.basePath))}routingSchemaServiceSearchRoutingSchemaTags(e,t,r,i,a,n,o){return RoutingSchemaServiceApiFp(this.configuration).routingSchemaServiceSearchRoutingSchemaTags(e,t,r,i,a,n,o).then(e=>e(this.axios,this.basePath))}routingSchemaServiceUpdateRoutingSchema(e,t,r){return RoutingSchemaServiceApiFp(this.configuration).routingSchemaServiceUpdateRoutingSchema(e,t,r).then(e=>e(this.axios,this.basePath))}}const RoutingVariableServiceApiAxiosParamCreator=function(e){return{routingVariableServiceCreateRoutingVariable:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling routingVariableServiceCreateRoutingVariable.");const i=parse("/routing/variables",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},routingVariableServiceDeleteRoutingVariable:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling routingVariableServiceDeleteRoutingVariable.");const a="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},routingVariableServiceReadRoutingVariable:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling routingVariableServiceReadRoutingVariable.");const a="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},routingVariableServiceSearchRoutingVariable:async(t,r,i,a={})=>{const n=parse("/routing/variables",!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...a},c={},u={};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&&(u.page=t),void 0!==r&&(u.size=r),void 0!==i&&(u.domain_id=i),n.query={...n.query,...u,...a.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...a.headers},{url:format(n),options:s}},routingVariableServiceUpdateRoutingVariable:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling routingVariableServiceUpdateRoutingVariable.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling routingVariableServiceUpdateRoutingVariable.");const a="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}}}},RoutingVariableServiceApiFp=function(e){return{async routingVariableServiceCreateRoutingVariable(t,r){const i=await RoutingVariableServiceApiAxiosParamCreator(e).routingVariableServiceCreateRoutingVariable(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async routingVariableServiceDeleteRoutingVariable(t,r,i){const a=await RoutingVariableServiceApiAxiosParamCreator(e).routingVariableServiceDeleteRoutingVariable(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async routingVariableServiceReadRoutingVariable(t,r,i){const a=await RoutingVariableServiceApiAxiosParamCreator(e).routingVariableServiceReadRoutingVariable(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async routingVariableServiceSearchRoutingVariable(t,r,i,a){const n=await RoutingVariableServiceApiAxiosParamCreator(e).routingVariableServiceSearchRoutingVariable(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async routingVariableServiceUpdateRoutingVariable(t,r,i){const a=await RoutingVariableServiceApiAxiosParamCreator(e).routingVariableServiceUpdateRoutingVariable(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RoutingVariableServiceApiFactory=function(e,t,r){return{routingVariableServiceCreateRoutingVariable:(i,a)=>RoutingVariableServiceApiFp(e).routingVariableServiceCreateRoutingVariable(i,a).then(e=>e(r,t)),routingVariableServiceDeleteRoutingVariable:(i,a,n)=>RoutingVariableServiceApiFp(e).routingVariableServiceDeleteRoutingVariable(i,a,n).then(e=>e(r,t)),routingVariableServiceReadRoutingVariable:(i,a,n)=>RoutingVariableServiceApiFp(e).routingVariableServiceReadRoutingVariable(i,a,n).then(e=>e(r,t)),routingVariableServiceSearchRoutingVariable:(i,a,n,o)=>RoutingVariableServiceApiFp(e).routingVariableServiceSearchRoutingVariable(i,a,n,o).then(e=>e(r,t)),routingVariableServiceUpdateRoutingVariable:(i,a,n)=>RoutingVariableServiceApiFp(e).routingVariableServiceUpdateRoutingVariable(i,a,n).then(e=>e(r,t))}};class RoutingVariableServiceApi extends BaseAPI{routingVariableServiceCreateRoutingVariable(e,t){return RoutingVariableServiceApiFp(this.configuration).routingVariableServiceCreateRoutingVariable(e,t).then(e=>e(this.axios,this.basePath))}routingVariableServiceDeleteRoutingVariable(e,t,r){return RoutingVariableServiceApiFp(this.configuration).routingVariableServiceDeleteRoutingVariable(e,t,r).then(e=>e(this.axios,this.basePath))}routingVariableServiceReadRoutingVariable(e,t,r){return RoutingVariableServiceApiFp(this.configuration).routingVariableServiceReadRoutingVariable(e,t,r).then(e=>e(this.axios,this.basePath))}routingVariableServiceSearchRoutingVariable(e,t,r,i){return RoutingVariableServiceApiFp(this.configuration).routingVariableServiceSearchRoutingVariable(e,t,r,i).then(e=>e(this.axios,this.basePath))}routingVariableServiceUpdateRoutingVariable(e,t,r){return RoutingVariableServiceApiFp(this.configuration).routingVariableServiceUpdateRoutingVariable(e,t,r).then(e=>e(this.axios,this.basePath))}}const SkillServiceApiAxiosParamCreator=function(e){return{skillServiceCreateSkill:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling skillServiceCreateSkill.");const i=parse("/call_center/skills",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},skillServiceDeleteSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling skillServiceDeleteSkill.");const a="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"DELETE",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},skillServiceReadSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling skillServiceReadSkill.");const a="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...i},c={},u={};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&&(u.domain_id=r),n.query={...n.query,...u,...i.query},delete n.search;let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...i.headers},{url:format(n),options:s}},skillServiceSearchSkill:async(t,r,i,a,n,o,s={})=>{const c=parse("/call_center/skills",!0);let u;e&&(u=e.baseOptions);const l={method:"GET",...u,...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!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),o&&(p.id=o),c.query={...c.query,...p,...s.query},delete c.search;let h=u&&u.headers?u.headers:{};return l.headers={...d,...h,...s.headers},{url:format(c),options:l}},skillServiceUpdateSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling skillServiceUpdateSkill.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling skillServiceUpdateSkill.");const a="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}}}},SkillServiceApiFp=function(e){return{async skillServiceCreateSkill(t,r){const i=await SkillServiceApiAxiosParamCreator(e).skillServiceCreateSkill(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async skillServiceDeleteSkill(t,r,i){const a=await SkillServiceApiAxiosParamCreator(e).skillServiceDeleteSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async skillServiceReadSkill(t,r,i){const a=await SkillServiceApiAxiosParamCreator(e).skillServiceReadSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async skillServiceSearchSkill(t,r,i,a,n,o,s){const c=await SkillServiceApiAxiosParamCreator(e).skillServiceSearchSkill(t,r,i,a,n,o,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async skillServiceUpdateSkill(t,r,i){const a=await SkillServiceApiAxiosParamCreator(e).skillServiceUpdateSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},SkillServiceApiFactory=function(e,t,r){return{skillServiceCreateSkill:(i,a)=>SkillServiceApiFp(e).skillServiceCreateSkill(i,a).then(e=>e(r,t)),skillServiceDeleteSkill:(i,a,n)=>SkillServiceApiFp(e).skillServiceDeleteSkill(i,a,n).then(e=>e(r,t)),skillServiceReadSkill:(i,a,n)=>SkillServiceApiFp(e).skillServiceReadSkill(i,a,n).then(e=>e(r,t)),skillServiceSearchSkill:(i,a,n,o,s,c,u)=>SkillServiceApiFp(e).skillServiceSearchSkill(i,a,n,o,s,c,u).then(e=>e(r,t)),skillServiceUpdateSkill:(i,a,n)=>SkillServiceApiFp(e).skillServiceUpdateSkill(i,a,n).then(e=>e(r,t))}};class SkillServiceApi extends BaseAPI{skillServiceCreateSkill(e,t){return SkillServiceApiFp(this.configuration).skillServiceCreateSkill(e,t).then(e=>e(this.axios,this.basePath))}skillServiceDeleteSkill(e,t,r){return SkillServiceApiFp(this.configuration).skillServiceDeleteSkill(e,t,r).then(e=>e(this.axios,this.basePath))}skillServiceReadSkill(e,t,r){return SkillServiceApiFp(this.configuration).skillServiceReadSkill(e,t,r).then(e=>e(this.axios,this.basePath))}skillServiceSearchSkill(e,t,r,i,a,n,o){return SkillServiceApiFp(this.configuration).skillServiceSearchSkill(e,t,r,i,a,n,o).then(e=>e(this.axios,this.basePath))}skillServiceUpdateSkill(e,t,r){return SkillServiceApiFp(this.configuration).skillServiceUpdateSkill(e,t,r).then(e=>e(this.axios,this.basePath))}}const TriggerServiceApiAxiosParamCreator=function(e){return{triggerServiceCreateTrigger:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling triggerServiceCreateTrigger.");const i=parse("/trigger",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}o["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let s=a&&a.headers?a.headers:{};n.headers={...o,...s,...r.headers};const c="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=c?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},triggerServiceCreateTriggerJob:async(t,r,i={})=>{if(null==t)throw new RequiredError("triggerId","Required parameter triggerId was null or undefined when calling triggerServiceCreateTriggerJob.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling triggerServiceCreateTriggerJob.");const a="/trigger/{trigger_id}/job".replace("{trigger_id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},triggerServiceDeleteTrigger:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling triggerServiceDeleteTrigger.");const i="/trigger/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const o={method:"DELETE",...n,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let c=n&&n.headers?n.headers:{};return o.headers={...s,...c,...r.headers},{url:format(a),options:o}},triggerServicePatchTrigger:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling triggerServicePatchTrigger.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling triggerServicePatchTrigger.");const a="/trigger/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PATCH",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}},triggerServiceReadTrigger:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling triggerServiceReadTrigger.");const i="/trigger/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const o={method:"GET",...n,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let c=n&&n.headers?n.headers:{};return o.headers={...s,...c,...r.headers},{url:format(a),options:o}},triggerServiceSearchTrigger:async(t,r,i,a,n,o,s,c={})=>{const u=parse("/trigger",!0);let l;e&&(l=e.baseOptions);const d={method:"GET",...l,...c},p={},h={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;p["X-Webitel-Access"]=t}void 0!==t&&(h.page=t),void 0!==r&&(h.size=r),void 0!==i&&(h.q=i),void 0!==a&&(h.sort=a),n&&(h.fields=n),o&&(h.id=o),s&&(h.schema_id=s),u.query={...u.query,...h,...c.query},delete u.search;let S=l&&l.headers?l.headers:{};return d.headers={...p,...S,...c.headers},{url:format(u),options:d}},triggerServiceSearchTriggerJob:async(t,r,i,a,n,o,s,c,u={})=>{if(null==t)throw new RequiredError("triggerId","Required parameter triggerId was null or undefined when calling triggerServiceSearchTriggerJob.");const l="/trigger/{trigger_id}/job".replace("{trigger_id}",encodeURIComponent(String(t))),d=parse(l,!0);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...u},S={},g={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;S["X-Webitel-Access"]=t}void 0!==r&&(g.page=r),void 0!==i&&(g.size=i),void 0!==a&&(g.q=a),void 0!==n&&(g.sort=n),o&&(g.fields=o),void 0!==s&&(g["created_at.from"]=s),void 0!==c&&(g["created_at.to"]=c),d.query={...d.query,...g,...u.query},delete d.search;let v=p&&p.headers?p.headers:{};return h.headers={...S,...v,...u.headers},{url:format(d),options:h}},triggerServiceUpdateTrigger:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling triggerServiceUpdateTrigger.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling triggerServiceUpdateTrigger.");const a="/trigger/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let o;e&&(o=e.baseOptions);const s={method:"PUT",...o,...i},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",n.query={...n.query,...i.query},delete n.search;let u=o&&o.headers?o.headers:{};s.headers={...c,...u,...i.headers};const l="string"!=typeof r||"application/json"===s.headers["Content-Type"];return s.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:s}}}},TriggerServiceApiFp=function(e){return{async triggerServiceCreateTrigger(t,r){const i=await TriggerServiceApiAxiosParamCreator(e).triggerServiceCreateTrigger(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async triggerServiceCreateTriggerJob(t,r,i){const a=await TriggerServiceApiAxiosParamCreator(e).triggerServiceCreateTriggerJob(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async triggerServiceDeleteTrigger(t,r){const i=await TriggerServiceApiAxiosParamCreator(e).triggerServiceDeleteTrigger(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async triggerServicePatchTrigger(t,r,i){const a=await TriggerServiceApiAxiosParamCreator(e).triggerServicePatchTrigger(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async triggerServiceReadTrigger(t,r){const i=await TriggerServiceApiAxiosParamCreator(e).triggerServiceReadTrigger(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async triggerServiceSearchTrigger(t,r,i,a,n,o,s,c){const u=await TriggerServiceApiAxiosParamCreator(e).triggerServiceSearchTrigger(t,r,i,a,n,o,s,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async triggerServiceSearchTriggerJob(t,r,i,a,n,o,s,c,u){const l=await TriggerServiceApiAxiosParamCreator(e).triggerServiceSearchTriggerJob(t,r,i,a,n,o,s,c,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async triggerServiceUpdateTrigger(t,r,i){const a=await TriggerServiceApiAxiosParamCreator(e).triggerServiceUpdateTrigger(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},TriggerServiceApiFactory=function(e,t,r){return{triggerServiceCreateTrigger:(i,a)=>TriggerServiceApiFp(e).triggerServiceCreateTrigger(i,a).then(e=>e(r,t)),triggerServiceCreateTriggerJob:(i,a,n)=>TriggerServiceApiFp(e).triggerServiceCreateTriggerJob(i,a,n).then(e=>e(r,t)),triggerServiceDeleteTrigger:(i,a)=>TriggerServiceApiFp(e).triggerServiceDeleteTrigger(i,a).then(e=>e(r,t)),triggerServicePatchTrigger:(i,a,n)=>TriggerServiceApiFp(e).triggerServicePatchTrigger(i,a,n).then(e=>e(r,t)),triggerServiceReadTrigger:(i,a)=>TriggerServiceApiFp(e).triggerServiceReadTrigger(i,a).then(e=>e(r,t)),triggerServiceSearchTrigger:(i,a,n,o,s,c,u,l)=>TriggerServiceApiFp(e).triggerServiceSearchTrigger(i,a,n,o,s,c,u,l).then(e=>e(r,t)),triggerServiceSearchTriggerJob:(i,a,n,o,s,c,u,l,d)=>TriggerServiceApiFp(e).triggerServiceSearchTriggerJob(i,a,n,o,s,c,u,l,d).then(e=>e(r,t)),triggerServiceUpdateTrigger:(i,a,n)=>TriggerServiceApiFp(e).triggerServiceUpdateTrigger(i,a,n).then(e=>e(r,t))}};class TriggerServiceApi extends BaseAPI{triggerServiceCreateTrigger(e,t){return TriggerServiceApiFp(this.configuration).triggerServiceCreateTrigger(e,t).then(e=>e(this.axios,this.basePath))}triggerServiceCreateTriggerJob(e,t,r){return TriggerServiceApiFp(this.configuration).triggerServiceCreateTriggerJob(e,t,r).then(e=>e(this.axios,this.basePath))}triggerServiceDeleteTrigger(e,t){return TriggerServiceApiFp(this.configuration).triggerServiceDeleteTrigger(e,t).then(e=>e(this.axios,this.basePath))}triggerServicePatchTrigger(e,t,r){return TriggerServiceApiFp(this.configuration).triggerServicePatchTrigger(e,t,r).then(e=>e(this.axios,this.basePath))}triggerServiceReadTrigger(e,t){return TriggerServiceApiFp(this.configuration).triggerServiceReadTrigger(e,t).then(e=>e(this.axios,this.basePath))}triggerServiceSearchTrigger(e,t,r,i,a,n,o,s){return TriggerServiceApiFp(this.configuration).triggerServiceSearchTrigger(e,t,r,i,a,n,o,s).then(e=>e(this.axios,this.basePath))}triggerServiceSearchTriggerJob(e,t,r,i,a,n,o,s,c){return TriggerServiceApiFp(this.configuration).triggerServiceSearchTriggerJob(e,t,r,i,a,n,o,s,c).then(e=>e(this.axios,this.basePath))}triggerServiceUpdateTrigger(e,t,r){return TriggerServiceApiFp(this.configuration).triggerServiceUpdateTrigger(e,t,r).then(e=>e(this.axios,this.basePath))}}const UserHelperServiceApiAxiosParamCreator=function(e){return{userHelperServiceDefaultDeviceConfig:async(t,r={})=>{if(null==t)throw new RequiredError("type","Required parameter type was null or undefined when calling userHelperServiceDefaultDeviceConfig.");const i="/user/device/config/{type}".replace("{type}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const o={method:"GET",...n,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let c=n&&n.headers?n.headers:{};return o.headers={...s,...c,...r.headers},{url:format(a),options:o}}}},UserHelperServiceApiFp=function(e){return{async userHelperServiceDefaultDeviceConfig(t,r){const i=await UserHelperServiceApiAxiosParamCreator(e).userHelperServiceDefaultDeviceConfig(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}}}},UserHelperServiceApiFactory=function(e,t,r){return{userHelperServiceDefaultDeviceConfig:(i,a)=>UserHelperServiceApiFp(e).userHelperServiceDefaultDeviceConfig(i,a).then(e=>e(r,t))}};class UserHelperServiceApi extends BaseAPI{userHelperServiceDefaultDeviceConfig(e,t){return UserHelperServiceApiFp(this.configuration).userHelperServiceDefaultDeviceConfig(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 EngineBoolFilter,EngineRoutingSchemaType,EngineTriggerJobState,EngineTriggerType,HistoryFileJobHistoryFileJobAction,HistoryFileJobHistoryFileJobState,ProtobufNullValue,StorageImportSourceType,StorageProviderType,StorageServiceType,StorageUploadStatusCode;!function(e){e.Undefined="undefined",e.True="true",e.False="false"}(EngineBoolFilter||(EngineBoolFilter={})),function(e){e.Default="default",e.Voice="voice",e.Chat="chat",e.Processing="processing",e.Service="service"}(EngineRoutingSchemaType||(EngineRoutingSchemaType={})),function(e){e.Idle="idle",e.Active="active",e.Done="done",e.Error="error"}(EngineTriggerJobState||(EngineTriggerJobState={})),function(e){e.DefaultTriggerType="default_trigger_type",e.Cron="cron"}(EngineTriggerType||(EngineTriggerType={})),function(e){e.Undefined="undefined",e.STT="STT",e.Delete="delete"}(HistoryFileJobHistoryFileJobAction||(HistoryFileJobHistoryFileJobAction={})),function(e){e.Idle="idle",e.Active="active",e.Finished="finished",e.Error="error"}(HistoryFileJobHistoryFileJobState||(HistoryFileJobHistoryFileJobState={})),function(e){e.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,r){r.length>0?console[e](t,...r):console[e](t)}}class Session{constructor(e){this.session=e.session,this.callId=e.request.getHeader("X-Webitel-Uuid"),this.incoming="incoming"===e.session.direction,this.instanceId=e.request.getHeader("X-Webitel-Sock-Id")}get id(){return this.session.id}getLocalMedia(){if(this.session.connection){const e=this.session.connection.getLocalStreams();if(e.length)return e}return[]}getPeerMedia(){if(this.session.connection){const e=this.session.connection.getRemoteStreams();if(e.length)return e}return[]}answer(e){return new Promise(()=>{this.session.answer(e)})}}class SipPhone extends EventEmitter{constructor(e,t){super(),this.instanceId=e,this.type="webrtc",this.sessionCache=new Map,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 r=this.sessionCache.get(e),i=await this.callOption(t);return r.answer(i)}return!1}async call(e){const t={};let r=null;if(e.params&&(t.audio=e.params.audio,t.video=e.params.video||!1,t.screen=e.params.screen||!1,t.disableStun=e.params.disableStun||!1),"string"!=typeof e.destination)throw new Error("bad destination type");const i=await this.callOption(t);e.params&&e.params.display&&(r={extraHeaders:[`X-Webitel-Display: ${e.params.display}`]}),await this.ua.call(e.destination,{...i,...r})}async register(e){const t=new WebSocketInterface(e.server),r={realm:e.realm,uri:e.uri,authorization_user:e.authorization_user,ha1:e.ha1,user_agent:SipPhone.userAgent,sockets:[t],session_timers:!0,display_name:e.display_name,register_expires:e.register_expires||90,connection_recovery_min_interval:5,connection_recovery_max_interval:60},i=this.ua=new UA(r);i.on("newRTCSession",e=>{const t=e.session,r=t.id,i=new Session(e);this.storeSession(r,i),t.on("connecting",()=>{this.emit("localStreams",i,t.connection.getLocalStreams())}),t.connection&&t.connection.addEventListener("addstream",e=>{this.emit("peerStreams",i,new Array(e.stream))}),t.on("peerconnection",e=>{e.peerconnection.addEventListener("addstream",async e=>{this.emit("peerStreams",i,new Array(e.stream))})}),t.on("ended",()=>{this.removeSession(r,t.connection)}),t.on("failed",()=>{this.removeSession(r,t.connection)}),t.on("accepted",()=>{i.incoming||this.emit("peerStreams",i,t.connection.getRemoteStreams())}),t.on("confirmed",()=>{}),this.emit("newSession",i)}),i.on("disconnected",e=>{this.emit("unregistered")}),i.on("unregistered",e=>{this.emit("unregistered")}),i.on("registrationFailed",e=>{this.log.error("registrationFailed",e)}),i.on("registered",e=>{this.emit("registered")}),i.start()}async unregister(){this.ua&&(this.ua.terminateSessions(),this.ua.removeAllListeners(),await this.ua.stop(),delete this.ua)}sipSessionByCallId(e){for(const t of this.allSession)if(t.callId===e)return t;return null}sipSessionBySipId(e){for(const t of this.allSession)if(t.id.startsWith(e))return t;return null}removeSession(e,t){if(t){const e=t.getLocalStreams(),r=t.getRemoteStreams();e&&e.forEach(e=>{e.getTracks().forEach(e=>{e.stop()})}),r&&r.forEach(e=>{e.getTracks().forEach(e=>{e.stop()})})}return!!this.sessionCache.has(e)&&(this.sessionCache.delete(e),!0)}storeSession(e,t){if(this.sessionCache.has(e))throw new Error("Session already store");this.sessionCache.set(e,t)}get allSession(){return Array.from(this.sessionCache.values())}getMediaConstraints(e){return e.screen?{video:!1,audio:!1,screen:!0}:{video:e.video||!1,audio:!0}}getSession(e){return this.sessionCache.has(e)?this.sessionCache.get(e):null}hasSession(e){return this.sessionCache.has(e)}async getUserScreen(){return new Promise(async(e,t)=>{try{e(await navigator.mediaDevices.getDisplayMedia())}catch(e){t(e)}})}async getUserCallStream(e){let t;if(!0===e.screen&&(t=await this.getUserScreen()),!1!==e.audio||e.video){const r=await this.getUserMedia(e.audio,e.video);t?r.getTracks().forEach(e=>{t.addTrack(e)}):t=r}if(!t)throw new Error("bad stream request");return t}async getUserMedia(e,t){return new Promise(async(r,i)=>{const a={audio:!(!1===e),video:void 0};return t&&(a.video={width:{min:10,ideal:1280,max:1920},height:{min:10,ideal:720,max:1080},frameRate:{ideal:10,max:15}}),getMediaStream(a).then(r).catch(i)})}}async function getMediaStream(e){return new Promise((t,r)=>{if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)navigator.mediaDevices.getUserMedia(e).then(e=>t(e)).catch(e=>r(e));else{(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)(e,e=>t(e),e=>r(e))}})}SipPhone.userAgent="Webitel-Phone/0.0.1";const getVersion=()=>'"0.1.164"';var JobState,ChannelName,AgentStatus,ChannelState,ChannelType,CallReportingStatus,CallActions,CallDirection,version='"0.1.164"';!function(e){e.Distribute="distribute",e.Offering="offering",e.Bridged="bridged",e.Missed="missed",e.Processing="processing",e.Closed="closed",e.Destroy="destroy"}(JobState||(JobState={})),function(e){e.Call="call",e.Chat="chat",e.Task="task"}(ChannelName||(ChannelName={}));class Task{constructor(e,t,r){this.client=e,this.distribute=r,this.id=t.attempt_id,this.state=JobState.Offering,this.setState(t.status),this.lastStatusChange=t.timestamp,this.createdAt=t.timestamp,this._processing=null,this.offeringAt=0,this.answeredAt=0,this.bridgedAt=0,this.reportedAt=0,this.startProcessingAt=0,this.stopAt=0,this.closedAt=0,this.form=null,this.communication=r.communication,this.history=[r]}get queue(){return{id:this.distribute.queue_id,name:this.distribute.queue_name}}get duration(){return Math.round((Date.now()-this.lastStatusChange)/1e3)}get hasForm(){return this.distribute.has_form||!1}get channel(){return this.distribute.channel}get allowAccept(){return this.channel===ChannelName.Task&&0===this.bridgedAt&&0===this.closedAt}get allowDecline(){return this.allowAccept}get allowClose(){return this.channel===ChannelName.Task&&0===this.closedAt&&this.bridgedAt>0}get memberId(){return this.distribute.member_id}get queueId(){return this.distribute.queue_id}get hasReporting(){return this.distribute.has_reporting}get allowReporting(){return this.hasReporting&&this.bridgedAt>0}get agentChannelId(){return this.distribute.agent_channel_id}setState(e){this.state=e}setAnswered(e){this.answeredAt=e,this.lastStatusChange=Date.now()}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._listOfflineMembers=null,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 r=e;if(!r)throw new Error("bad event");if(t=new Task(this.client,e,r.distribute),this.task.set(t.id,t),t.agentChannelId)switch(t.channel){case ChannelType.Call:const e=this.client.callById(t.agentChannelId);e&&!e.task&&(e.task=t);break;case ChannelType.Chat:const r=this.client.conversationById(t.agentChannelId);r&&!r.task&&(r.task=t)}break;case ChannelState.Offering:const i=e;(t=this.task.get(e.attempt_id))&&(t.setOffering(i),i.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 o=e;return void((t=this.task.get(e.attempt_id))&&(t.form=o.form||null));case ChannelState.Missed:if(e.attempt_id&&(t=this.task.get(e.attempt_id))){t.stopAt=e.timestamp;const r=e;if(!r)throw new Error("bad event");return t.setMissed(),this.setChannelStateTimeout(e.channel,e,r.missed.timeout),this.task.delete(e.attempt_id),this.client.reportingChannelTask(t),t}break;case ChannelState.WrapTime:if(e.attempt_id){if(!e)throw new Error("bad event");t=this.task.get(e.attempt_id),this.task.delete(e.attempt_id),this.client.reportingChannelTask(t)}break;case ChannelState.Processing:if(e.attempt_id){const r=e;if(!r)throw new Error("bad event");if(t=this.task.get(e.attempt_id))return t.setProcessing(e.timestamp,r.processing),this.setChannelStateTimeout(e.channel,e,r.processing.timeout||0),t}break;case ChannelState.Waiting:e.attempt_id&&(t=this.task.get(e.attempt_id))&&(t.setClosed(e.timestamp),this.task.delete(e.attempt_id),this.client.reportingChannelTask(t))}return this.setChannelState(e.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,r){return this._listOfflineMembers=await this.client.request("cc_fetch_offline_members",{agent_id:this.agentId,page:t,q:e,per_page:r}),this._listOfflineMembers}hasTask(e){return this.task.has(e.id)}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,r){this._channel.channel=e||null,this._channel.state=t.status,this._channel.timeout=r,this._channel.joined_at=t.timestamp}}!function(e){e.Abandoned="abandoned",e.Cancel="cancel",e.Success="success",e.Failed="failed",e.Missed="missed",e.Timeout="timeout",e.Endless="endless",e.Transferred="transferred"}(CallReportingStatus||(CallReportingStatus={})),function(e){e.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 r=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&&(r.sip_id?this.setSip(e.phone.sipSessionBySipId(r.sip_id)):this.setSip(e.phone.sipSessionByCallId(t.id))),this.params={},this.id=t.id,this.digits=[],this.applications=[],this.appId=t.app_id,this.setState(t),this.setInfo(r),this.queue&&this.client.agent&&(this.task=this.client.agent.task.get(+this.queue.attempt_id)||null)}setState(e){this.state=e.event}setSip(e){e&&!this.sip&&(this.sip=e,this.localStreams=e.getLocalMedia(),this.peerStreams=e.getPeerMedia())}get duration(){return 0===this.hangupAt?Math.round((Date.now()-this.createdAt)/1e3):Math.round((this.hangupAt-this.createdAt)/1e3)}get allowDtmf(){return this.answeredAt>0&&this.allowHangup}get allowHangup(){return 0===this.hangupAt}get allowHold(){return 0===this.hangupAt&&("active"===this.state||"bridge"===this.state)}get allowAnswer(){return this.client.phone&&0===this.hangupAt&&0===this.answeredAt&&(this.queue||this.direction===CallDirection.Inbound||this.params&&!this.params.autoAnswer)}get allowUnHold(){return 0===this.hangupAt&&"hold"===this.state}get memberCommunication(){return this.task?this.task.communication:null}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 r=Math.ceil(e.length/t),i=new Array(r);let a=0;for(let n=0;n<r;n++)i[n]=e.substr(a,t),a+=t;return i}const maxSizeMessage=4096;var DeclineCause,ChatActions,ConversationState,TypeErrors,NotificationActions;!function(e){e.Timeout="TIMEOUT",e.Busy="BUSY",e.Cancel="CANCEL"}(DeclineCause||(DeclineCause={})),function(e){e.Message="message",e.UserInvite="user_invite",e.Invite="invite_conversation",e.Joined="join_conversation",e.Close="close_conversation",e.Leave="leave_conversation",e.Decline="decline_invite",e.Update="update_channel",e.Destroy="destroy"}(ChatActions||(ChatActions={})),function(e){e.Init="init",e.Invite="invite",e.Active="active",e.Pending="pending",e.Closed="closed"}(ConversationState||(ConversationState={}));class Conversation{constructor(e,t,r,i,a,n){this.client=e,this.conversationId=t,this.title=r,this.channelId=null,this.createdAt=Date.now(),this.answeredAt=0,this.updatedAt=0,this.invitedAt=0,this.closedAt=0,this.task=null,this.data=null,this.queue=null,this.members=(i||[]).map(e=>wrapChannelMember(e)),this._messages=a||[],this.state=ConversationState.Invite,this.variables={},this._hasReporting=!(!n||"true"!==n.cc_reporting),this._autoAnswer=!1,this._cause=null,this.lastAction=null;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.queue={id:+n.cc_queue_id||null,name:n.cc_queue_name||""},this.task=this.client.agent.task.get(+n.cc_attempt_id)||null)}setInvite(e,t){this.inviteId=e,this.invitedAt=t,this._autoAnswer&&this.join().catch(e=>{this.client.emit("error",e)})}setAnswered(e,t,r){this.state=ConversationState.Active,this.answeredAt=t,this.channelId=e,this.member=wrapChannelMember(r),this.inviteId=null}setClosed(e){this.state=ConversationState.Closed,this.closedAt=e}setDecline(e){this.setClosed(e.timestamp),this._cause=e.cause||null}setLeave(e){this.setClosed(e.timestamp)}get id(){return this.channelId||this.inviteId||this.conversationId}get cause(){return this._cause}get messages(){return this.getMessages()}getMessages(){return this._messages.map(e=>{const t={id:e.id,type:e.type,member:this.messageMember(e),channelId:e.channel_id,createdAt:e.created_at,updatedAt:e.updated_at,contact:null};return e.hasOwnProperty("file")&&(e.file.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&&this.hasReporting)}get allowReporting(){return this.answeredAt>0&&this.hasReporting}get hasReporting(){return this._hasReporting}get membersId(){const e=[this.id];for(const t of this.members)e.push(t.id);return e}get attempt(){return this.task}async decline(e){if(!this.inviteId)throw new Error("This conversation is joined");let t=e;return e||0!==this.answeredAt||(t=DeclineCause.Busy),this.client.request("decline_chat",{invite_id:this.inviteId,cause:t})}async join(){if(!this.inviteId)throw new Error("This conversation is joined");return this.client.request("join_chat",{invite_id:this.inviteId})}async close(e){if(!this.channelId)throw new Error("This conversation not active");return this.client.request("close_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:e})}async leave(e){if(!this.channelId)throw new Error("This conversation not active");return 0===this.closedAt||this.hasReporting||this.cause===DeclineCause.Busy?this.client.request("leave_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:e}):this.client.destroyConversation(this)}async sendText(e){if(!this.channelId)throw new Error("conversation not active");if(!e.length)throw new Error("empty message");const t=chunkString(e,maxSizeMessage);for(let e=0;e<t.length;e++){if(e+1>=t.length)return this.sendMessageTextChunk(t[e]);await this.sendMessageTextChunk(t[e])}}async sendFile(e,t){const r=(await this.client.storeFile(this.conversationId,[e],t))[0];return this.client.request("send_file_chat",{channel_id:this.channelId,conversation_id:this.conversationId,id:r.id,name:e.name,mime:r.mime,url:r.shared,size:r.size})}async send(e,t){if("string"==typeof e)return this.sendText(e);if(e instanceof File)return this.sendFile(e,t);throw new Error("unknown send data")}async addToChat(e,t){return this.client.request("add_to_chat",{channel_id:this.channelId,conversation_id:this.conversationId,user_id:e,title:t})}async startChat(e){return this.client.request("start_chat",{user_id:e})}async updateChannel(){return this.client.request("update_channel_chat",{channel_id:this.channelId})}async reporting(e){if(!this.task)throw new Error("this conversation not in queue");return this.task.reporting(e)}async renew(e){if(!this.task)throw new Error("this conversation not in queue");return this.task.renew(e)}async transferToPlan(e){return this.client.request("blind_transfer_chat",{conversation_id:this.conversationId,channel_id:this.channelId,plan_id:e})}async transferToUser(e){return this.client.request("transfer_user_chat",{conversation_id:this.conversationId,channel_id:this.channelId,user_id:e})}sendMessageTextChunk(e){return this.client.request("send_text_chat",{channel_id:this.channelId,conversation_id:this.conversationId,text:e})}messageMember(e){if(this.member&&e.channel_id===this.channelId)return{self:!0};for(const t of this.members)if(t.id===e.channel_id)return t;return null}}function wrapChannelMember(e){return e.messenger=e.type,e}!function(e){e.RolePermission="api.context.permissions.app_error"}(TypeErrors||(TypeErrors={}));class DeviceNotFoundError extends Error{constructor(e){super(e),this.id=DeviceNotFoundError.id}}DeviceNotFoundError.id="device_not_found";class DeviceNotAllowPermissionError extends Error{constructor(e){super(e),this.id=DeviceNotAllowPermissionError.id}}DeviceNotAllowPermissionError.id="device_not_allow";class RolePermissionError extends Error{constructor(e){super(e),this.id=RolePermissionError.id}}RolePermissionError.id="api.context.permissions.app_error",function(e){e.HideMember="hide_member"}(NotificationActions||(NotificationActions={}));const SOCKET_URL_SUFFIX="websocket",spamData="\0\0\0\0";class Socket extends EventEmitter{constructor(e){super(),this.host=e}connect(e){this.socket=new WebSocket(`${formatWebSocketUri(this.host)}/${SOCKET_URL_SUFFIX}`),this.socket.onclose=(e=>this.onClose(e.code)),this.socket.onmessage=(e=>this.onMessage(e.data)),this.socket.onopen=(()=>this.onOpen())}send(e){return this.socket.send(JSON.stringify(e)),null}close(e){this.socket.close(e||1e3),delete this.socket}onOpen(){this.emit("open")}onClose(e){this.emit("close",e),this.off("*")}onMessage(e){if(e!==spamData){const t=JSON.parse(e);this.emit("message",t)}}}const API_HEADER_TOKEN="X-Webitel-Access",WEBSOCKET_AUTHENTICATION_CHALLENGE="authentication_challenge",WEBSOCKET_DEFAULT_DEVICE_CONFIG="user_default_device",WEBSOCKET_AGENT_SESSION="cc_agent_session",WEBSOCKET_PING="ping",WEBSOCKET_MAKE_OUTBOUND_CALL="call_invite",WEBSOCKET_MAKE_USER_CALL="call_user",WEBSOCKET_EVENT_HELLO="hello",WEBSOCKET_EVENT_CALL="call",WEBSOCKET_EVENT_CHAT="chat",WEBSOCKET_EVENT_USER_STATE="user_state",WEBSOCKET_EVENT_AGENT_STATUS="agent_status",WEBSOCKET_EVENT_CHANNEL_STATUS="channel",WEBSOCKET_EVENT_ERROR="error",WEBSOCKET_EVENT_NOTIFICATION="notification",TASK_EVENT="task",JOB_EVENT="job",WEBSOCKET_EVENT_SIP="sip";var HandleError,Response;!function(e){e.NotFoundError="NotFoundError",e.NotAllowedError="NotAllowedError"}(HandleError||(HandleError={})),function(e){e.STATUS_FAIL="FAIL",e.STATUS_OK="OK"}(Response||(Response={}));class Client extends EventEmitter{constructor(e){super(),this._config=e,this.reqSeq=0,this.queueRequest=new Map,this.log=new Log,this.eventHandler=new EventEmitter,this.callStore=new Map,this.conversationStore=new Map,this.pingTimer=null,this.basePath=`${formatBaseUri(e.storageEndpoint||e.endpoint)}`,this.lastError=null}async connect(){await this.connectToSocket()}async disconnect(){this.socket.close()}async subscribeCall(e,t){const r=await this.request("subscribe_call",t);if(this.eventHandler.on(WEBSOCKET_EVENT_CALL,e),r.items&&r.items.length)for(const e of r.items){if(e.hangup_at&&e.hangup_at>0&&!e.task)continue;const t={cc_app_id:"",app_id:e.app_id,event:e.state,id:e.id,timestamp:Date.now(),data:{app_id:e.app_id,event:e.state,id:e.id,timestamp:Date.now(),cc_app_id:"",sip_id:"",parent_id:e.parent_id,direction:e.direction,destination:e.destination,queue:e.queue,from:e.from,to:e.to,payload:e.variables}},r=new Call(this,t);r.createdAt=e.created_at,r.answeredAt=e.answered_at||0,r.bridgedAt=e.bridged_at||0,r.hangupAt=e.hangup_at||0,e.task&&(r.task=new Task(this,{attempt_id:e.task.attempt_id,channel:e.task.channel,status:e.task.status,timestamp:Date.now()},e.task),r.queue.reporting="true",r.task.form=e.task.form||null,e.leaving_at&&e.task.processing_sec&&(r.task.startProcessingAt=e.leaving_at,r.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(r.id,r)}return r}async subscribeChat(e,t){const r=await this.request("subscribe_chat",t);if(this.eventHandler.on(WEBSOCKET_EVENT_CHAT,e),r&&r.items)for(const e of r.items){const t=e.messages.reverse(),r=new Conversation(this,e.id,e.title,e.members,t,e.variables);if(r.createdAt=e.created_at,r.closedAt=e.closed_at,e.task&&(r.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&&(r.task.startProcessingAt=e.leaving_at,r.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})),r.task.form=e.task.form||null),e.invite_id)r.setInvite(e.invite_id,e.created_at);else{if(!e.channel_id){this.log.error(`conversation ${e.id} not valid`);continue}r.setAnswered(e.channel_id,e.joined_at,{id:e.channel_id,name:"TODO",type:"webitel"})}this.conversationStore.set(r.id,r)}return r}async subscribeUsersStatus(e,t){const r=await this.request("subscribe_users_status",t);return this.eventHandler.on(WEBSOCKET_EVENT_USER_STATE,e),r}async subscribeAgentsStatus(e,t){const r=await this.request("cc_agent_subscribe_status",t);return this.eventHandler.on(WEBSOCKET_EVENT_AGENT_STATUS,e),r}subscribeTask(e){this.eventHandler.on(TASK_EVENT,e)}subscribeJob(e){this.eventHandler.on(JOB_EVENT,e)}async unSubscribe(e,t,r){return this.request(`un_subscribe_${e}`,r)}async destroy(){await this.disconnect(),this.phone&&(await this.phone.unregister(),this.phone.off("*"),delete this.phone),this.eventHandler.off("*")}allCall(){return Array.from(this.callStore.values())}allConversations(){return Array.from(this.conversationStore.values())}allTask(){return this.agent?Array.from(this.agent.task.values()):[]}allJob(){return this.allTask().filter(isJobTask)}callById(e){if(this.callStore.has(e))return this.callStore.get(e)}conversationById(e){if(this.conversationStore.has(e))return this.conversationStore.get(e)}callBySipId(e){for(const t of this.allCall())if(t.sipId&&e.startsWith(t.sipId))return t}async reportingTask(e,t){return this.request("cc_reporting",{attempt_id:e,...t})}async agentActiveTasks(e){return this.request("cc_agent_tasks",{agent_id:e})}async auth(){try{return await this.request(WEBSOCKET_AUTHENTICATION_CHALLENGE,{token:this._config.token})}catch(e){throw this.handleError(e),await this.disconnect(),e}}async ping(){return this.request(WEBSOCKET_PING,{ping:1})}sessionInfo(){return this.connectionInfo.session}get version(){return this.connectionInfo.server_version}get buildVersion(){return version}get instanceId(){return this.connectionInfo.sock_id}get autoAnswerDelayTime(){return this._config.autoAnswerDelayTime||400}async agentSession(){if(this.agent)return this.agent;const e=await this.request(WEBSOCKET_AGENT_SESSION);this.agent=new Agent(this,e);const t=await this.agentActiveTasks(this.agent.agentId);for(const e of t.items){const t=new Task(this,{status:e.status,timestamp:Date.now(),channel:e.channel,attempt_id:e.attempt_id},e);t.postProcessData={},t.setState(e.state),e.bridged_at&&(t.bridgedAt=e.bridged_at,t.answeredAt=e.bridged_at),e.leaving_at&&(t.closedAt=e.leaving_at),e.leaving_at&&e.processing_sec&&(t.startProcessingAt=e.leaving_at,t.setProcessing(e.leaving_at,{sec:e.processing_sec||0,timeout:e.processing_timeout_at||null,renewal_sec:e.processing_renewal_sec||0})),t.form=e.form||null,this.agent.task.set(t.id,t)}for(const e of this.allCall())e.task&&this.agent.task.set(e.task.id,e.task);for(const e of this.allConversations())e.task&&this.agent.task.set(e.task.id,e.task);return this.agent}async invite(e){return this.request(WEBSOCKET_MAKE_OUTBOUND_CALL,e)}async call(e){if(this.phone)try{await this.phone.call(e)}catch(e){this.handleError(e)}else await this.invite(e)}async callRecordId(e){return this.request("call_recordings",{id:e})}async eavesdrop(e){return this.request("call_eavesdrop",e)}async agentSetOnline(e,t,r){return this.request("cc_agent_online",{agent_id:e,channels:t,on_demand:r})}async agentSetWaiting(e,t){return this.request("cc_agent_waiting",{agent_id:e,channel:t})}async agentSetPause(e,t){return this.request("cc_agent_pause",{agent_id:e,payload:t})}async agentSetOffline(e){return this.request("cc_agent_offline",{agent_id:e})}inviteToUser(e){return this.request(WEBSOCKET_MAKE_USER_CALL,e)}async answer(e,t){const r=this.callById(e);if(r)return r.answer(t)}request(e,t){return new Promise((r,i)=>{this.queueRequest.set(++this.reqSeq,{resolve:r,reject:i}),this.socket.send({seq:this.reqSeq,action:e,data:t})})}useWebPhone(){return this._config.registerWebDevice||!1}callDestroyed(e){return e.hangupAt>0&&!this.hasAgentTask(e.task)}conversationDestroyed(e){return e.closedAt>0&&(!this.hasAgentTask(e.task)||!e.hasReporting)&&(e.hasReporting||!(e.lastAction===ChatActions.Close&&e.answeredAt>0))}reportingChannelTask(e){switch(e.channel){case ChannelName.Call:for(const e of this.allCall())if(this.callDestroyed(e))return void this.destroyCall(e);break;case ChannelName.Chat:if(e.agentChannelId){const t=this.conversationById(e.agentChannelId);if(t&&this.conversationDestroyed(t))return void this.destroyConversation(t)}}}async registerCallClient(e){this.phone=e,this.subscribePhone(e);try{const e=await this.deviceConfig(this.phone.type);await this.phone.register(e)}catch(e){this.log.error(e)}}subscribePhone(e){e.on("peerStreams",(e,t)=>{const r=this.callBySession(e);r&&!r.peerStreams.length&&(r.setPeerStreams(t),this.eventHandler.emit(WEBSOCKET_EVENT_CALL,CallActions.PeerStream,r))}),e.on("localStreams",(e,t)=>{const r=this.callBySession(e);r&&!r.localStreams.length&&(r.setLocalStreams(t),this.eventHandler.emit(WEBSOCKET_EVENT_CALL,CallActions.LocalStream,r))}),e.on("newSession",this.onNewCallSession.bind(this)),e.on("registered",()=>this.emit("phone_registered",!0)),e.on("unregistered",()=>this.emit("phone_registered",!1))}async deviceConfig(e){return this.request(WEBSOCKET_DEFAULT_DEVICE_CONFIG,{name:e})}async storeFile(e,t,r){if(!t||t.length<1)throw new Error("no files");const i=new FormData;for(const e of t)i.append(e.name,e);const a=(await globalAxios.post(`${this.basePath}/api/storage/file/${e}/upload`,i,{headers:{[API_HEADER_TOKEN]:this._config.token},onUploadProgress:r})).data;for(const e of a)e.shared=this.basePath+e.shared;return a}fileUrlDownload(e){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)}}destroyConversation(e){this.conversationStore.delete(e.id),this.eventHandler.emit(WEBSOCKET_EVENT_CHAT,ChatActions.Destroy,e)}async onMessage(e){if(this.log.debug("receive message: ",e),e.seq_reply>0){if(this.queueRequest.has(e.seq_reply)){const t=this.queueRequest.get(e.seq_reply);if(this.queueRequest.delete(e.seq_reply),e.status===Response.STATUS_OK)t.resolve(e.data);else{const r=e.error;r&&r.id===TypeErrors.RolePermission?t.reject(new RolePermissionError(r.detail)):t.reject(e.error)}}}else switch(e.event){case WEBSOCKET_EVENT_HELLO:await this.connected(e.data),this.log.debug(`opened session ${this.connectionInfo.sock_id} for userId=${this.connectionInfo.session.user_id}`);break;case WEBSOCKET_EVENT_CALL:await this.handleCallEvents(e.data.call);break;case WEBSOCKET_EVENT_CHAT:await this.handleChatEvents(e.data);break;case WEBSOCKET_EVENT_USER_STATE:this.handleUserStateEvent(e.data.state);break;case WEBSOCKET_EVENT_SIP:this.eventHandler.emit(WEBSOCKET_EVENT_SIP,e.data);break;case WEBSOCKET_EVENT_AGENT_STATUS:this.handleAgentStatus(e.data);break;case WEBSOCKET_EVENT_CHANNEL_STATUS:this.handleChannelEvents(e.data);break;case WEBSOCKET_EVENT_ERROR:this.lastError=e.data.error;break;case WEBSOCKET_EVENT_NOTIFICATION:this.handleNotification(e.data.notification);break;default:this.log.error(`event ${e.event} not handler`)}}handleNotification(e){switch(e.action){case NotificationActions.HideMember:if(this.agent&&this.agent._listOfflineMembers){const t=this.agent._listOfflineMembers;if(t.items)for(let r=0;r<t.items.length;r++)if(t.items[r].id===e.body.member_id){t.items.splice(r,1);break}}break;default:this.log.error(`notification "${e.action}" not handled`)}}handleAgentStatus(e){this.agent&&e.agent_id===this.agent.agentId&&this.agent.setStatus(e),this.eventHandler.emit(WEBSOCKET_EVENT_AGENT_STATUS,e,this.agent)}handleChannelEvents(e){if(this.agent){e.timestamp=Date.now();const t=this.agent.onChannelEvent(e)||void 0;this.eventHandler.emit(TASK_EVENT,e.status,t),t&&isJobTask(t)&&(this.eventHandler.emit(JOB_EVENT,t.state,t),isDestroyJob(t.state)&&this.eventHandler.emit(JOB_EVENT,JobState.Destroy,t))}}async pingServer(){if(this.pingTimer&&this.connectionInfo.ping_interval){const e=setTimeout(async()=>{this.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},this.autoAnswerDelayTime)}connectToSocket(){return new Promise((e,t)=>{try{this.socket=new Socket(this._config.endpoint),this.socket.connect(this._config.token)}catch(e){return void t(e)}this.socket.on("message",this.onMessage.bind(this)),this.socket.on("close",e=>{this.pingTimer&&clearTimeout(this.pingTimer),this.log.error("socket close code: ",e),1e3!==e&&(this.emit("disconnected",e,this.lastError),t(new Error(`close socket code: ${e}`))),this.eventHandler.off("*")}),this.socket.on("open",()=>{e(null),this.emit("connected")})})}handleUserStateEvent(e){this.eventHandler.emit(WEBSOCKET_EVENT_USER_STATE,e)}async handleCallEvents(e){let t;switch(e.timestamp=Date.now(),e.event){case CallActions.Ringing:t=new Call(this,e),this.callStore.set(t.id,t),this.checkAutoAnswer(t);break;case CallActions.Active:(t=this.callById(e.id))&&t.setActive(e);break;case CallActions.Bridge:(t=this.callById(e.id))&&t.setBridged(e);break;case CallActions.Execute:(t=this.callById(e.id))&&t.setExecute(e.data);break;case CallActions.DTMF:(t=this.callById(e.id))&&t.addDigit(e.data);break;case CallActions.Voice:(t=this.callById(e.id))&&t.setVoice();break;case CallActions.Silence:(t=this.callById(e.id))&&t.setSilence();break;case CallActions.Hold:(t=this.callById(e.id))&&t.setHold(e);break;case CallActions.Hangup:(t=this.callById(e.id))&&t.setHangup(e);break;default:throw new Error("Unhandled action")}t&&(this.eventHandler.emit(WEBSOCKET_EVENT_CALL,e.event,t),this.callDestroyed(t)&&this.destroyCall(t))}async handleChatEvents(e){let t;const r=Date.now();switch(e.action){case ChatActions.UserInvite:const i=e.data;(t=new Conversation(this,i.conversation_id,i.title,i.members,i.messages,i.variables)).setInvite(i.invite_id,r),this.conversationStore.set(t.id,t);break;case ChatActions.Joined:const a=e.data;(t=this.conversationById(a.member.id))&&t.setAnswered(a.member.id,r,a.member);break;case ChatActions.Message:const n=e.data;n.timestamp=r;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 o=e.data;for(const e of this.allConversations())!e.closedAt&&e.membersId.indexOf(o.from_channel_id)>-1&&(t=e);t&&t.setClosed(r);break;case ChatActions.Leave:const s=e.data;(t=this.conversationById(s.leaved_channel_id))&&t.setLeave(s);break;case ChatActions.Decline:const c=e.data;(t=this.conversationById(c.invite_id))&&t.setDecline(c)}t&&(t.lastAction=e.action,this.eventHandler.emit(WEBSOCKET_EVENT_CHAT,e.action,t),this.conversationDestroyed(t)&&this.destroyConversation(t))}hasAgentTask(e){return!(!this.agent||!e)&&this.agent.hasTask(e)}destroyCall(e){this.callStore.delete(e.id),this.eventHandler.emit(WEBSOCKET_EVENT_CALL,CallActions.Destroy,e)}}function isJobTask(e){return e.channel===ChannelName.Task}function isDestroyJob(e){return[ChannelState.Missed.toString(),ChannelState.Waiting,ChannelState.WrapTime,JobState.Closed].indexOf(e)>-1}class SipClient extends EventEmitter{}var commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var ee=createCommonjsModule(function(e,t){var r=commonjsGlobal&&commonjsGlobal.__generator||function(e,t){var r,i,a,n,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return n={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function s(n){return function(s){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(a=2&n[0]?i.return:n[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,n[1])).done)return a;switch(i=0,a&&(n=[2&n[0],a.value]),n[0]){case 0:case 1:a=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){o=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){o.label=n[1];break}if(6===n[0]&&o.label<a[1]){o.label=a[1],a=n;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(n);break}a[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],i=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.$listeners=Symbol("EventEmitter.listeners"),t.$addListener=Symbol("EventEmitter.addListener");var i=function(){function e(){this[t.$listeners]={}}return e.count=function(e,r){var i=0,a=e[t.$listeners][r];if(a)for(var n=a.first;++i&&n.next;)n=n.next;return i},e.has=function(e,r){if("*"==r){for(r in e[t.$listeners])return!0;return!1}return void 0!==e[t.$listeners][r]},e.keys=function(e){return Object.keys(e[t.$listeners])},e.unhandle=function(e,r,i,a){return e.on(r,function(){for(var a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];if(!e[t.$listeners][r].first.next)return i.apply(void 0,a)},a)},e.prototype.on=function(e,r,i){return"function"==typeof r?this[t.$addListener](e,r,i):this[t.$addListener](e,void 0,r)},e.prototype.one=function(e,r,i){return"function"==typeof r?this[t.$addListener](e,r,i,!0):this[t.$addListener](e,void 0,r,!0)},e.prototype.off=function(e,r){if("*"==e){var i=this[t.$listeners];if(this[t.$listeners]={},this._onEventUnhandled)for(var a in i)this._onEventUnhandled(a);return this}if("function"==typeof r){var n=this[t.$listeners][e];if(n&&function(e,t){var r=null,i=e.first;for(;;)if(t(i))if(r){if(r.next=i.next,!i.next)break;i=i.next}else{if(!i.next)return null;e.first=i=i.next}else{if(r=i,!i.next)break;i=i.next}return e.last=r,e}(n,function(e){return e.fn==r}))return this}return delete this[t.$listeners][e],this._onEventUnhandled&&this._onEventUnhandled(e),this},e.prototype.emit=function(e){for(var t,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];for(var a=this.listeners(e);;){var n=a.next(),o=n.value;if(n.done)return t;var s=o.apply(void 0,r);void 0!==s&&(t=s)}},e.prototype.listeners=function(e){var i,a,n;return r(this,function(r){switch(r.label){case 0:if(!(i=this[t.$listeners][e]))return[2];a=null,n=i.first,r.label=1;case 1:return[4,n.fn];case 2:if(r.sent(),n.once){if(!a)return n.next?(i.first=n=n.next,[3,1]):(delete this[t.$listeners][e],this._onEventUnhandled&&this._onEventUnhandled(e),[2]);a.next=n.next}else a=n;return n.next?(n=n.next,[3,1]):(i.last=n,[2]);case 3:return[2]}})},e.prototype[t.$addListener]=function(e,r,i,n){var o=this;if(void 0===n&&(n=!1),"object"==typeof e){var s,c=function(){if("function"==typeof e[s]){var r=e[s],c=a(u[t.$listeners],s,{fn:r,once:n,next:null});i&&i.push({dispose:function(){return o.off(s,r)}}),r==c.first.fn&&u._onEventHandled&&u._onEventHandled(s)}},u=this;for(s in e)c();return this}if("function"==typeof r){var l=e,d=a(this[t.$listeners],l,{fn:r,once:n,next:null});i&&i.push({dispose:function(){return o.off(l,r)}}),r==d.first.fn&&this._onEventHandled&&this._onEventHandled(e)}return r},e.ev=t.$listeners,e}();function a(e,t,r){var i=e[t];return i?(i.last.next=r,i.last=r):e[t]=i={first:r,last:r},i}t.EventEmitter=i});unwrapExports(ee);var ee_1=ee.$listeners,ee_2=ee.$addListener,ee_3=ee.EventEmitter;class Session$1{constructor(e,t){this.client=e,this.callId=t,this.incoming=!1,this.instanceId="fixme"}get id(){return this.callId}getLocalMedia(){return[]}getPeerMedia(){return[]}answer(e){return new Promise(e=>{this.client.answer(this.id),e()})}}class ExternalClient extends ee_3{constructor(e){super(),this.config=e,this.type="external",this.schema="wtel://"}async callOption(e){return e}async register(e){}async unregister(){}async call(e){e.destination&&this.exec(e.destination)}answer(e){this.exec(e,"answer")}sipSessionByCallId(e){return new Session$1(this,e)}sipSessionBySipId(e){return null}open(e){this.exec(encodeURIComponent(JSON.stringify({token:e,...this.config})),"open")}exec(e,t){let r=`${this.schema}${e}`;t&&(r+=` ${t}`);const i=document.createElement("a");i.download="File name",i.href=r,i.click()}}export{AgentPauseCauseServiceApiAxiosParamCreator,AgentPauseCauseServiceApiFp,AgentPauseCauseServiceApiFactory,AgentPauseCauseServiceApi,AgentServiceApiAxiosParamCreator,AgentServiceApiFp,AgentServiceApiFactory,AgentServiceApi,AgentSkillServiceApiAxiosParamCreator,AgentSkillServiceApiFp,AgentSkillServiceApiFactory,AgentSkillServiceApi,AgentTeamServiceApiAxiosParamCreator,AgentTeamServiceApiFp,AgentTeamServiceApiFactory,AgentTeamServiceApi,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,TriggerServiceApiAxiosParamCreator,TriggerServiceApiFp,TriggerServiceApiFactory,TriggerServiceApi,UserHelperServiceApiAxiosParamCreator,UserHelperServiceApiFp,UserHelperServiceApiFactory,UserHelperServiceApi,Configuration,EngineBoolFilter,EngineRoutingSchemaType,EngineTriggerJobState,EngineTriggerType,HistoryFileJobHistoryFileJobAction,HistoryFileJobHistoryFileJobState,ProtobufNullValue,StorageImportSourceType,StorageProviderType,StorageServiceType,StorageUploadStatusCode,JobState,Response,Client,CallReportingStatus,CallActions,CallDirection,Call,AgentStatus,ChannelState,ChannelType,Agent,DeclineCause,ChatActions,ConversationState,Conversation,TypeErrors,DeviceNotFoundError,DeviceNotAllowPermissionError,RolePermissionError,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,r=globalAxios){this.basePath=t,this.axios=r,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}}class RequiredError extends Error{constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}const AgentPauseCauseServiceApiAxiosParamCreator=function(e){return{createAgentPauseCause:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgentPauseCause.");const i=parse("/call_center/pause_causes",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteAgentPauseCause:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteAgentPauseCause.");const i="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchAgentPauseCause:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchAgentPauseCause.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchAgentPauseCause.");const a="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readAgentPauseCause:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readAgentPauseCause.");const i="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchAgentPauseCause:async(t,r,i,a,n,s,o={})=>{const u=parse("/call_center/pause_causes",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateAgentPauseCause:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentPauseCause.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateAgentPauseCause.");const a="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},AgentPauseCauseServiceApiFp=function(e){return{async createAgentPauseCause(t,r){const i=await AgentPauseCauseServiceApiAxiosParamCreator(e).createAgentPauseCause(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteAgentPauseCause(t,r){const i=await AgentPauseCauseServiceApiAxiosParamCreator(e).deleteAgentPauseCause(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchAgentPauseCause(t,r,i){const a=await AgentPauseCauseServiceApiAxiosParamCreator(e).patchAgentPauseCause(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readAgentPauseCause(t,r){const i=await AgentPauseCauseServiceApiAxiosParamCreator(e).readAgentPauseCause(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchAgentPauseCause(t,r,i,a,n,s,o){const u=await AgentPauseCauseServiceApiAxiosParamCreator(e).searchAgentPauseCause(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateAgentPauseCause(t,r,i){const a=await AgentPauseCauseServiceApiAxiosParamCreator(e).updateAgentPauseCause(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},AgentPauseCauseServiceApiFactory=function(e,t,r){return{createAgentPauseCause:(i,a)=>AgentPauseCauseServiceApiFp(e).createAgentPauseCause(i,a).then(e=>e(r,t)),deleteAgentPauseCause:(i,a)=>AgentPauseCauseServiceApiFp(e).deleteAgentPauseCause(i,a).then(e=>e(r,t)),patchAgentPauseCause:(i,a,n)=>AgentPauseCauseServiceApiFp(e).patchAgentPauseCause(i,a,n).then(e=>e(r,t)),readAgentPauseCause:(i,a)=>AgentPauseCauseServiceApiFp(e).readAgentPauseCause(i,a).then(e=>e(r,t)),searchAgentPauseCause:(i,a,n,s,o,u,c)=>AgentPauseCauseServiceApiFp(e).searchAgentPauseCause(i,a,n,s,o,u,c).then(e=>e(r,t)),updateAgentPauseCause:(i,a,n)=>AgentPauseCauseServiceApiFp(e).updateAgentPauseCause(i,a,n).then(e=>e(r,t))}};class AgentPauseCauseServiceApi extends BaseAPI{createAgentPauseCause(e,t){return AgentPauseCauseServiceApiFp(this.configuration).createAgentPauseCause(e,t).then(e=>e(this.axios,this.basePath))}deleteAgentPauseCause(e,t){return AgentPauseCauseServiceApiFp(this.configuration).deleteAgentPauseCause(e,t).then(e=>e(this.axios,this.basePath))}patchAgentPauseCause(e,t,r){return AgentPauseCauseServiceApiFp(this.configuration).patchAgentPauseCause(e,t,r).then(e=>e(this.axios,this.basePath))}readAgentPauseCause(e,t){return AgentPauseCauseServiceApiFp(this.configuration).readAgentPauseCause(e,t).then(e=>e(this.axios,this.basePath))}searchAgentPauseCause(e,t,r,i,a,n,s){return AgentPauseCauseServiceApiFp(this.configuration).searchAgentPauseCause(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateAgentPauseCause(e,t,r){return AgentPauseCauseServiceApiFp(this.configuration).updateAgentPauseCause(e,t,r).then(e=>e(this.axios,this.basePath))}}const AgentServiceApiAxiosParamCreator=function(e){return{agentSetState:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentSetState.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling agentSetState.");const a="/call_center/agents/{agent_id}/states/waiting".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},agentStateHistory:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentStateHistory.");const c="/call_center/agents/{agent_id}/states/history".replace("{agent_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.time_from=a),void 0!==n&&(y.time_to=n),void 0!==s&&(y.q=s),void 0!==o&&(y.domain_id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},agentTodayStatistics:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling agentTodayStatistics.");const a="/call_center/agents/{agent_id}/statistics/today".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}r&&(c.fields=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},createAgent:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgent.");const i=parse("/call_center/agents",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteAgent.");const a="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},patchAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchAgent.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchAgent.");const a="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readAgent.");const a="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchAgent:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,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!==r&&(C.size=r),void 0!==i&&(C.q=i),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!==g&&(C.not_supervisor=g),A&&(C.user_id=A),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,r,i,a,n,s,o,u,c,l={})=>{const d=parse("/call_center/agents/reports/call",!0);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...l},y={},g={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;y["X-Webitel-Access"]=t}void 0!==t&&(g.page=t),void 0!==r&&(g.size=r),void 0!==i&&(g["time.from"]=i),void 0!==a&&(g["time.to"]=a),n&&(g.agent_id=n),void 0!==s&&(g.domain_id=s),void 0!==o&&(g.q=o),u&&(g.fields=u),void 0!==c&&(g.sort=c),d.query={...d.query,...g,...l.query},delete d.search;let A=p&&p.headers?p.headers:{};return h.headers={...y,...A,...l.headers},{url:format(d),options:h}},searchAgentInQueue:async(t,r,i,a,n,s,o={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling searchAgentInQueue.");const u="/call_center/agents/{id}/queues".replace("{id}",encodeURIComponent(String(t))),c=parse(u,!0);let l;e&&(l=e.baseOptions);const d={method:"GET",...l,...o},p={},h={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;p["X-Webitel-Access"]=t}void 0!==r&&(h.page=r),void 0!==i&&(h.size=i),void 0!==a&&(h.q=a),void 0!==n&&(h.sort=n),s&&(h.fields=s),c.query={...c.query,...h,...o.query},delete c.search;let y=l&&l.headers?l.headers:{};return d.headers={...p,...y,...o.headers},{url:format(c),options:d}},searchAgentInQueueStatistics:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling searchAgentInQueueStatistics.");const a="/call_center/agents/{agent_id}/statistics/queues".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchAgentInTeam:async(t,r,i,a,n,s={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling searchAgentInTeam.");const o="/call_center/agents/{id}/teams".replace("{id}",encodeURIComponent(String(t))),u=parse(o,!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...s},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==r&&(p.page=r),void 0!==i&&(p.size=i),void 0!==a&&(p.q=a),void 0!==n&&(p.domain_id=n),u.query={...u.query,...p,...s.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...s.headers},{url:format(u),options:l}},searchAgentStateHistory:async(t,r,i,a,n,s,o,u,c={})=>{const l=parse("/call_center/agents/states/history",!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==t&&(y.page=t),void 0!==r&&(y.size=r),void 0!==i&&(y["joined_at.from"]=i),void 0!==a&&(y["joined_at.to"]=a),n&&(y.agent_id=n),void 0!==s&&(y.sort=s),void 0!==o&&(y.domain_id=o),void 0!==u&&(y.from_id=u),l.query={...l.query,...y,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},searchAgentStatusStatistic:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,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!==r&&(C.size=r),void 0!==i&&(C.q=i),void 0!==a&&(C.sort=a),n&&(C.fields=n),s&&(C.agent_id=s),void 0!==o&&(C["time.from"]=o),void 0!==u&&(C["time.to"]=u),c&&(C.status=c),l&&(C.queue_id=l),d&&(C.team_id=d),void 0!==p&&(C["utilization.from"]=p),void 0!==h&&(C["utilization.to"]=h),void 0!==y&&(C.has_call=y),g&&(C.skill_id=g),A&&(C.region_id=A),m&&(C.supervisor_id=m),f&&(C.auditor_id=f),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,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling searchAgentStatusStatisticItem.");const n="/call_center/agents/reports/status/{agent_id}".replace("{agent_id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==r&&(l["time.from"]=r),void 0!==i&&(l["time.to"]=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchLookupUsersAgentNotExists:async(t,r,i,a,n={})=>{const s=parse("/call_center/lookups/agents/users",!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...n},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==t&&(l.page=t),void 0!==r&&(l.size=r),void 0!==i&&(l.q=i),void 0!==a&&(l.domain_id=a),s.query={...s.query,...l,...n.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...n.headers},{url:format(s),options:u}},searchPauseCauseForAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling searchPauseCauseForAgent.");const a="/call_center/agents/{agent_id}/pause_causes".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.allow_change=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},updateAgent:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgent.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateAgent.");const a="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},updateAgentStatus:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentStatus.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateAgentStatus.");const a="/call_center/agents/{id}/status".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},AgentServiceApiFp=function(e){return{async agentSetState(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).agentSetState(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async agentStateHistory(t,r,i,a,n,s,o,u){const c=await AgentServiceApiAxiosParamCreator(e).agentStateHistory(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async agentTodayStatistics(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).agentTodayStatistics(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async createAgent(t,r){const i=await AgentServiceApiAxiosParamCreator(e).createAgent(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).deleteAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).patchAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).readAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchAgent(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b){const S=await AgentServiceApiAxiosParamCreator(e).searchAgent(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b);return(e=globalAxios,t=BASE_PATH)=>{const r={...S.options,url:t+S.url};return e.request(r)}},async searchAgentCallStatistics(t,r,i,a,n,s,o,u,c,l){const d=await AgentServiceApiAxiosParamCreator(e).searchAgentCallStatistics(t,r,i,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async searchAgentInQueue(t,r,i,a,n,s,o){const u=await AgentServiceApiAxiosParamCreator(e).searchAgentInQueue(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async searchAgentInQueueStatistics(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).searchAgentInQueueStatistics(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchAgentInTeam(t,r,i,a,n,s){const o=await AgentServiceApiAxiosParamCreator(e).searchAgentInTeam(t,r,i,a,n,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...o.options,url:t+o.url};return e.request(r)}},async searchAgentStateHistory(t,r,i,a,n,s,o,u,c){const l=await AgentServiceApiAxiosParamCreator(e).searchAgentStateHistory(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async searchAgentStatusStatistic(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b){const S=await AgentServiceApiAxiosParamCreator(e).searchAgentStatusStatistic(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b);return(e=globalAxios,t=BASE_PATH)=>{const r={...S.options,url:t+S.url};return e.request(r)}},async searchAgentStatusStatisticItem(t,r,i,a){const n=await AgentServiceApiAxiosParamCreator(e).searchAgentStatusStatisticItem(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchLookupUsersAgentNotExists(t,r,i,a,n){const s=await AgentServiceApiAxiosParamCreator(e).searchLookupUsersAgentNotExists(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async searchPauseCauseForAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).searchPauseCauseForAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async updateAgent(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).updateAgent(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async updateAgentStatus(t,r,i){const a=await AgentServiceApiAxiosParamCreator(e).updateAgentStatus(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},AgentServiceApiFactory=function(e,t,r){return{agentSetState:(i,a,n)=>AgentServiceApiFp(e).agentSetState(i,a,n).then(e=>e(r,t)),agentStateHistory:(i,a,n,s,o,u,c,l)=>AgentServiceApiFp(e).agentStateHistory(i,a,n,s,o,u,c,l).then(e=>e(r,t)),agentTodayStatistics:(i,a,n)=>AgentServiceApiFp(e).agentTodayStatistics(i,a,n).then(e=>e(r,t)),createAgent:(i,a)=>AgentServiceApiFp(e).createAgent(i,a).then(e=>e(r,t)),deleteAgent:(i,a,n)=>AgentServiceApiFp(e).deleteAgent(i,a,n).then(e=>e(r,t)),patchAgent:(i,a,n)=>AgentServiceApiFp(e).patchAgent(i,a,n).then(e=>e(r,t)),readAgent:(i,a,n)=>AgentServiceApiFp(e).readAgent(i,a,n).then(e=>e(r,t)),searchAgent:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w)=>AgentServiceApiFp(e).searchAgent(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w).then(e=>e(r,t)),searchAgentCallStatistics:(i,a,n,s,o,u,c,l,d,p)=>AgentServiceApiFp(e).searchAgentCallStatistics(i,a,n,s,o,u,c,l,d,p).then(e=>e(r,t)),searchAgentInQueue:(i,a,n,s,o,u,c)=>AgentServiceApiFp(e).searchAgentInQueue(i,a,n,s,o,u,c).then(e=>e(r,t)),searchAgentInQueueStatistics:(i,a,n)=>AgentServiceApiFp(e).searchAgentInQueueStatistics(i,a,n).then(e=>e(r,t)),searchAgentInTeam:(i,a,n,s,o,u)=>AgentServiceApiFp(e).searchAgentInTeam(i,a,n,s,o,u).then(e=>e(r,t)),searchAgentStateHistory:(i,a,n,s,o,u,c,l,d)=>AgentServiceApiFp(e).searchAgentStateHistory(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),searchAgentStatusStatistic:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w)=>AgentServiceApiFp(e).searchAgentStatusStatistic(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w).then(e=>e(r,t)),searchAgentStatusStatisticItem:(i,a,n,s)=>AgentServiceApiFp(e).searchAgentStatusStatisticItem(i,a,n,s).then(e=>e(r,t)),searchLookupUsersAgentNotExists:(i,a,n,s,o)=>AgentServiceApiFp(e).searchLookupUsersAgentNotExists(i,a,n,s,o).then(e=>e(r,t)),searchPauseCauseForAgent:(i,a,n)=>AgentServiceApiFp(e).searchPauseCauseForAgent(i,a,n).then(e=>e(r,t)),updateAgent:(i,a,n)=>AgentServiceApiFp(e).updateAgent(i,a,n).then(e=>e(r,t)),updateAgentStatus:(i,a,n)=>AgentServiceApiFp(e).updateAgentStatus(i,a,n).then(e=>e(r,t))}};class AgentServiceApi extends BaseAPI{agentSetState(e,t,r){return AgentServiceApiFp(this.configuration).agentSetState(e,t,r).then(e=>e(this.axios,this.basePath))}agentStateHistory(e,t,r,i,a,n,s,o){return AgentServiceApiFp(this.configuration).agentStateHistory(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}agentTodayStatistics(e,t,r){return AgentServiceApiFp(this.configuration).agentTodayStatistics(e,t,r).then(e=>e(this.axios,this.basePath))}createAgent(e,t){return AgentServiceApiFp(this.configuration).createAgent(e,t).then(e=>e(this.axios,this.basePath))}deleteAgent(e,t,r){return AgentServiceApiFp(this.configuration).deleteAgent(e,t,r).then(e=>e(this.axios,this.basePath))}patchAgent(e,t,r){return AgentServiceApiFp(this.configuration).patchAgent(e,t,r).then(e=>e(this.axios,this.basePath))}readAgent(e,t,r){return AgentServiceApiFp(this.configuration).readAgent(e,t,r).then(e=>e(this.axios,this.basePath))}searchAgent(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f){return AgentServiceApiFp(this.configuration).searchAgent(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f).then(e=>e(this.axios,this.basePath))}searchAgentCallStatistics(e,t,r,i,a,n,s,o,u,c){return AgentServiceApiFp(this.configuration).searchAgentCallStatistics(e,t,r,i,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}searchAgentInQueue(e,t,r,i,a,n,s){return AgentServiceApiFp(this.configuration).searchAgentInQueue(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}searchAgentInQueueStatistics(e,t,r){return AgentServiceApiFp(this.configuration).searchAgentInQueueStatistics(e,t,r).then(e=>e(this.axios,this.basePath))}searchAgentInTeam(e,t,r,i,a,n){return AgentServiceApiFp(this.configuration).searchAgentInTeam(e,t,r,i,a,n).then(e=>e(this.axios,this.basePath))}searchAgentStateHistory(e,t,r,i,a,n,s,o,u){return AgentServiceApiFp(this.configuration).searchAgentStateHistory(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}searchAgentStatusStatistic(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f){return AgentServiceApiFp(this.configuration).searchAgentStatusStatistic(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f).then(e=>e(this.axios,this.basePath))}searchAgentStatusStatisticItem(e,t,r,i){return AgentServiceApiFp(this.configuration).searchAgentStatusStatisticItem(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchLookupUsersAgentNotExists(e,t,r,i,a){return AgentServiceApiFp(this.configuration).searchLookupUsersAgentNotExists(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}searchPauseCauseForAgent(e,t,r){return AgentServiceApiFp(this.configuration).searchPauseCauseForAgent(e,t,r).then(e=>e(this.axios,this.basePath))}updateAgent(e,t,r){return AgentServiceApiFp(this.configuration).updateAgent(e,t,r).then(e=>e(this.axios,this.basePath))}updateAgentStatus(e,t,r){return AgentServiceApiFp(this.configuration).updateAgentStatus(e,t,r).then(e=>e(this.axios,this.basePath))}}const AgentSkillServiceApiAxiosParamCreator=function(e){return{createAgentSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling createAgentSkill.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgentSkill.");const a="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteAgentSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling deleteAgentSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteAgentSkill.");const n="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},patchAgentSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling patchAgentSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling patchAgentSkill.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling patchAgentSkill.");const n="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},readAgentSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling readAgentSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readAgentSkill.");const n="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchAgentSkill:async(t,r,i,a,n,s,o,u={})=>{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!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.q=a),void 0!==n&&(y.sort=n),s&&(y.fields=s),o&&(y.id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},searchLookupAgentNotExistsSkill:async(t,r,i,a,n,s={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling searchLookupAgentNotExistsSkill.");const o="/call_center/lookups/agents/skills/{agent_id}".replace("{agent_id}",encodeURIComponent(String(t))),u=parse(o,!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...s},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==r&&(p.page=r),void 0!==i&&(p.size=i),void 0!==a&&(p.q=a),void 0!==n&&(p.domain_id=n),u.query={...u.query,...p,...s.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...s.headers},{url:format(u),options:l}},updateAgentSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("agentId","Required parameter agentId was null or undefined when calling updateAgentSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentSkill.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateAgentSkill.");const n="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},AgentSkillServiceApiFp=function(e){return{async createAgentSkill(t,r,i){const a=await AgentSkillServiceApiAxiosParamCreator(e).createAgentSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteAgentSkill(t,r,i,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).deleteAgentSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async patchAgentSkill(t,r,i,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).patchAgentSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readAgentSkill(t,r,i,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).readAgentSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchAgentSkill(t,r,i,a,n,s,o,u){const c=await AgentSkillServiceApiAxiosParamCreator(e).searchAgentSkill(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async searchLookupAgentNotExistsSkill(t,r,i,a,n,s){const o=await AgentSkillServiceApiAxiosParamCreator(e).searchLookupAgentNotExistsSkill(t,r,i,a,n,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...o.options,url:t+o.url};return e.request(r)}},async updateAgentSkill(t,r,i,a){const n=await AgentSkillServiceApiAxiosParamCreator(e).updateAgentSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},AgentSkillServiceApiFactory=function(e,t,r){return{createAgentSkill:(i,a,n)=>AgentSkillServiceApiFp(e).createAgentSkill(i,a,n).then(e=>e(r,t)),deleteAgentSkill:(i,a,n,s)=>AgentSkillServiceApiFp(e).deleteAgentSkill(i,a,n,s).then(e=>e(r,t)),patchAgentSkill:(i,a,n,s)=>AgentSkillServiceApiFp(e).patchAgentSkill(i,a,n,s).then(e=>e(r,t)),readAgentSkill:(i,a,n,s)=>AgentSkillServiceApiFp(e).readAgentSkill(i,a,n,s).then(e=>e(r,t)),searchAgentSkill:(i,a,n,s,o,u,c,l)=>AgentSkillServiceApiFp(e).searchAgentSkill(i,a,n,s,o,u,c,l).then(e=>e(r,t)),searchLookupAgentNotExistsSkill:(i,a,n,s,o,u)=>AgentSkillServiceApiFp(e).searchLookupAgentNotExistsSkill(i,a,n,s,o,u).then(e=>e(r,t)),updateAgentSkill:(i,a,n,s)=>AgentSkillServiceApiFp(e).updateAgentSkill(i,a,n,s).then(e=>e(r,t))}};class AgentSkillServiceApi extends BaseAPI{createAgentSkill(e,t,r){return AgentSkillServiceApiFp(this.configuration).createAgentSkill(e,t,r).then(e=>e(this.axios,this.basePath))}deleteAgentSkill(e,t,r,i){return AgentSkillServiceApiFp(this.configuration).deleteAgentSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}patchAgentSkill(e,t,r,i){return AgentSkillServiceApiFp(this.configuration).patchAgentSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}readAgentSkill(e,t,r,i){return AgentSkillServiceApiFp(this.configuration).readAgentSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchAgentSkill(e,t,r,i,a,n,s,o){return AgentSkillServiceApiFp(this.configuration).searchAgentSkill(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}searchLookupAgentNotExistsSkill(e,t,r,i,a,n){return AgentSkillServiceApiFp(this.configuration).searchLookupAgentNotExistsSkill(e,t,r,i,a,n).then(e=>e(this.axios,this.basePath))}updateAgentSkill(e,t,r,i){return AgentSkillServiceApiFp(this.configuration).updateAgentSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const AgentTeamServiceApiAxiosParamCreator=function(e){return{createAgentTeam:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createAgentTeam.");const i=parse("/call_center/teams",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteAgentTeam:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteAgentTeam.");const a="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readAgentTeam:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readAgentTeam.");const a="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchAgentTeam:async(t,r,i,a,n,s,o,u,c={})=>{const l=parse("/call_center/teams",!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==t&&(y.page=t),void 0!==r&&(y.size=r),void 0!==i&&(y.q=i),void 0!==a&&(y.sort=a),n&&(y.fields=n),s&&(y.id=s),o&&(y.strategy=o),u&&(y.admin_id=u),l.query={...l.query,...y,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},updateAgentTeam:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateAgentTeam.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateAgentTeam.");const a="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},AgentTeamServiceApiFp=function(e){return{async createAgentTeam(t,r){const i=await AgentTeamServiceApiAxiosParamCreator(e).createAgentTeam(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteAgentTeam(t,r,i){const a=await AgentTeamServiceApiAxiosParamCreator(e).deleteAgentTeam(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readAgentTeam(t,r,i){const a=await AgentTeamServiceApiAxiosParamCreator(e).readAgentTeam(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchAgentTeam(t,r,i,a,n,s,o,u,c){const l=await AgentTeamServiceApiAxiosParamCreator(e).searchAgentTeam(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async updateAgentTeam(t,r,i){const a=await AgentTeamServiceApiAxiosParamCreator(e).updateAgentTeam(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},AgentTeamServiceApiFactory=function(e,t,r){return{createAgentTeam:(i,a)=>AgentTeamServiceApiFp(e).createAgentTeam(i,a).then(e=>e(r,t)),deleteAgentTeam:(i,a,n)=>AgentTeamServiceApiFp(e).deleteAgentTeam(i,a,n).then(e=>e(r,t)),readAgentTeam:(i,a,n)=>AgentTeamServiceApiFp(e).readAgentTeam(i,a,n).then(e=>e(r,t)),searchAgentTeam:(i,a,n,s,o,u,c,l,d)=>AgentTeamServiceApiFp(e).searchAgentTeam(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),updateAgentTeam:(i,a,n)=>AgentTeamServiceApiFp(e).updateAgentTeam(i,a,n).then(e=>e(r,t))}};class AgentTeamServiceApi extends BaseAPI{createAgentTeam(e,t){return AgentTeamServiceApiFp(this.configuration).createAgentTeam(e,t).then(e=>e(this.axios,this.basePath))}deleteAgentTeam(e,t,r){return AgentTeamServiceApiFp(this.configuration).deleteAgentTeam(e,t,r).then(e=>e(this.axios,this.basePath))}readAgentTeam(e,t,r){return AgentTeamServiceApiFp(this.configuration).readAgentTeam(e,t,r).then(e=>e(this.axios,this.basePath))}searchAgentTeam(e,t,r,i,a,n,s,o,u){return AgentTeamServiceApiFp(this.configuration).searchAgentTeam(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateAgentTeam(e,t,r){return AgentTeamServiceApiFp(this.configuration).updateAgentTeam(e,t,r).then(e=>e(this.axios,this.basePath))}}const BackendProfileServiceApiAxiosParamCreator=function(e){return{createBackendProfile:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createBackendProfile.");const i=parse("/storage/backend_profiles",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteBackendProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteBackendProfile.");const a="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},patchBackendProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchBackendProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchBackendProfile.");const a="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readBackendProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readBackendProfile.");const a="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchBackendProfile:async(t,r,i,a,n,s,o={})=>{const u=parse("/storage/backend_profiles",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateBackendProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateBackendProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateBackendProfile.");const a="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},BackendProfileServiceApiFp=function(e){return{async createBackendProfile(t,r){const i=await BackendProfileServiceApiAxiosParamCreator(e).createBackendProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteBackendProfile(t,r,i){const a=await BackendProfileServiceApiAxiosParamCreator(e).deleteBackendProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchBackendProfile(t,r,i){const a=await BackendProfileServiceApiAxiosParamCreator(e).patchBackendProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readBackendProfile(t,r,i){const a=await BackendProfileServiceApiAxiosParamCreator(e).readBackendProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchBackendProfile(t,r,i,a,n,s,o){const u=await BackendProfileServiceApiAxiosParamCreator(e).searchBackendProfile(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateBackendProfile(t,r,i){const a=await BackendProfileServiceApiAxiosParamCreator(e).updateBackendProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},BackendProfileServiceApiFactory=function(e,t,r){return{createBackendProfile:(i,a)=>BackendProfileServiceApiFp(e).createBackendProfile(i,a).then(e=>e(r,t)),deleteBackendProfile:(i,a,n)=>BackendProfileServiceApiFp(e).deleteBackendProfile(i,a,n).then(e=>e(r,t)),patchBackendProfile:(i,a,n)=>BackendProfileServiceApiFp(e).patchBackendProfile(i,a,n).then(e=>e(r,t)),readBackendProfile:(i,a,n)=>BackendProfileServiceApiFp(e).readBackendProfile(i,a,n).then(e=>e(r,t)),searchBackendProfile:(i,a,n,s,o,u,c)=>BackendProfileServiceApiFp(e).searchBackendProfile(i,a,n,s,o,u,c).then(e=>e(r,t)),updateBackendProfile:(i,a,n)=>BackendProfileServiceApiFp(e).updateBackendProfile(i,a,n).then(e=>e(r,t))}};class BackendProfileServiceApi extends BaseAPI{createBackendProfile(e,t){return BackendProfileServiceApiFp(this.configuration).createBackendProfile(e,t).then(e=>e(this.axios,this.basePath))}deleteBackendProfile(e,t,r){return BackendProfileServiceApiFp(this.configuration).deleteBackendProfile(e,t,r).then(e=>e(this.axios,this.basePath))}patchBackendProfile(e,t,r){return BackendProfileServiceApiFp(this.configuration).patchBackendProfile(e,t,r).then(e=>e(this.axios,this.basePath))}readBackendProfile(e,t,r){return BackendProfileServiceApiFp(this.configuration).readBackendProfile(e,t,r).then(e=>e(this.axios,this.basePath))}searchBackendProfile(e,t,r,i,a,n,s){return BackendProfileServiceApiFp(this.configuration).searchBackendProfile(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateBackendProfile(e,t,r){return BackendProfileServiceApiFp(this.configuration).updateBackendProfile(e,t,r).then(e=>e(this.axios,this.basePath))}}const BucketServiceApiAxiosParamCreator=function(e){return{createBucket:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createBucket.");const i=parse("/call_center/buckets",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteBucket.");const a="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readBucket.");const a="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchBucket:async(t,r,i,a,n,s,o={})=>{const u=parse("/call_center/buckets",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateBucket.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateBucket.");const a="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},BucketServiceApiFp=function(e){return{async createBucket(t,r){const i=await BucketServiceApiAxiosParamCreator(e).createBucket(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteBucket(t,r,i){const a=await BucketServiceApiAxiosParamCreator(e).deleteBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readBucket(t,r,i){const a=await BucketServiceApiAxiosParamCreator(e).readBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchBucket(t,r,i,a,n,s,o){const u=await BucketServiceApiAxiosParamCreator(e).searchBucket(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateBucket(t,r,i){const a=await BucketServiceApiAxiosParamCreator(e).updateBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},BucketServiceApiFactory=function(e,t,r){return{createBucket:(i,a)=>BucketServiceApiFp(e).createBucket(i,a).then(e=>e(r,t)),deleteBucket:(i,a,n)=>BucketServiceApiFp(e).deleteBucket(i,a,n).then(e=>e(r,t)),readBucket:(i,a,n)=>BucketServiceApiFp(e).readBucket(i,a,n).then(e=>e(r,t)),searchBucket:(i,a,n,s,o,u,c)=>BucketServiceApiFp(e).searchBucket(i,a,n,s,o,u,c).then(e=>e(r,t)),updateBucket:(i,a,n)=>BucketServiceApiFp(e).updateBucket(i,a,n).then(e=>e(r,t))}};class BucketServiceApi extends BaseAPI{createBucket(e,t){return BucketServiceApiFp(this.configuration).createBucket(e,t).then(e=>e(this.axios,this.basePath))}deleteBucket(e,t,r){return BucketServiceApiFp(this.configuration).deleteBucket(e,t,r).then(e=>e(this.axios,this.basePath))}readBucket(e,t,r){return BucketServiceApiFp(this.configuration).readBucket(e,t,r).then(e=>e(this.axios,this.basePath))}searchBucket(e,t,r,i,a,n,s){return BucketServiceApiFp(this.configuration).searchBucket(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateBucket(e,t,r){return BucketServiceApiFp(this.configuration).updateBucket(e,t,r).then(e=>e(this.axios,this.basePath))}}const CalendarServiceApiAxiosParamCreator=function(e){return{createCalendar:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCalendar.");const i=parse("/calendars",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteCalendar:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteCalendar.");const a="/calendars/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readCalendar:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readCalendar.");const a="/calendars/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchCalendar:async(t,r,i,a,n,s,o={})=>{const u=parse("/calendars",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},searchTimezones:async(t,r,i,a={})=>{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!==r&&(c.size=r),void 0!==i&&(c.q=i),n.query={...n.query,...c,...a.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...a.headers},{url:format(n),options:o}},updateCalendar:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCalendar.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateCalendar.");const a="/calendars/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},CalendarServiceApiFp=function(e){return{async createCalendar(t,r){const i=await CalendarServiceApiAxiosParamCreator(e).createCalendar(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteCalendar(t,r,i){const a=await CalendarServiceApiAxiosParamCreator(e).deleteCalendar(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readCalendar(t,r,i){const a=await CalendarServiceApiAxiosParamCreator(e).readCalendar(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchCalendar(t,r,i,a,n,s,o){const u=await CalendarServiceApiAxiosParamCreator(e).searchCalendar(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async searchTimezones(t,r,i,a){const n=await CalendarServiceApiAxiosParamCreator(e).searchTimezones(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async updateCalendar(t,r,i){const a=await CalendarServiceApiAxiosParamCreator(e).updateCalendar(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},CalendarServiceApiFactory=function(e,t,r){return{createCalendar:(i,a)=>CalendarServiceApiFp(e).createCalendar(i,a).then(e=>e(r,t)),deleteCalendar:(i,a,n)=>CalendarServiceApiFp(e).deleteCalendar(i,a,n).then(e=>e(r,t)),readCalendar:(i,a,n)=>CalendarServiceApiFp(e).readCalendar(i,a,n).then(e=>e(r,t)),searchCalendar:(i,a,n,s,o,u,c)=>CalendarServiceApiFp(e).searchCalendar(i,a,n,s,o,u,c).then(e=>e(r,t)),searchTimezones:(i,a,n,s)=>CalendarServiceApiFp(e).searchTimezones(i,a,n,s).then(e=>e(r,t)),updateCalendar:(i,a,n)=>CalendarServiceApiFp(e).updateCalendar(i,a,n).then(e=>e(r,t))}};class CalendarServiceApi extends BaseAPI{createCalendar(e,t){return CalendarServiceApiFp(this.configuration).createCalendar(e,t).then(e=>e(this.axios,this.basePath))}deleteCalendar(e,t,r){return CalendarServiceApiFp(this.configuration).deleteCalendar(e,t,r).then(e=>e(this.axios,this.basePath))}readCalendar(e,t,r){return CalendarServiceApiFp(this.configuration).readCalendar(e,t,r).then(e=>e(this.axios,this.basePath))}searchCalendar(e,t,r,i,a,n,s){return CalendarServiceApiFp(this.configuration).searchCalendar(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}searchTimezones(e,t,r,i){return CalendarServiceApiFp(this.configuration).searchTimezones(e,t,r,i).then(e=>e(this.axios,this.basePath))}updateCalendar(e,t,r){return CalendarServiceApiFp(this.configuration).updateCalendar(e,t,r).then(e=>e(this.axios,this.basePath))}}const CallServiceApiAxiosParamCreator=function(e){return{aggregateHistoryCall:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling aggregateHistoryCall.");const i=parse("/calls/history/aggregate",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},blindTransferCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling blindTransferCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling blindTransferCall.");const a="/calls/active/{id}/transfer".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},confirmPush:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling confirmPush.");const i="/calls/active/{id}/confirm_push".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"PATCH",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},createCall:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCall.");const i=parse("/calls",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},createCallAnnotation:async(t,r,i={})=>{if(null==t)throw new RequiredError("callId","Required parameter callId was null or undefined when calling createCallAnnotation.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createCallAnnotation.");const a="/calls/history/{call_id}/annotation".replace("{call_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteCallAnnotation:async(t,r,i={})=>{if(null==t)throw new RequiredError("callId","Required parameter callId was null or undefined when calling deleteCallAnnotation.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteCallAnnotation.");const a="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},dtmfCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling dtmfCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling dtmfCall.");const a="/calls/active/{id}/dtmf".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},eavesdropCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling eavesdropCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling eavesdropCall.");const a="/calls/active/{id}/eavesdrop".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},hangupCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling hangupCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling hangupCall.");const a="/calls/active/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},holdCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling holdCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling holdCall.");const a="/calls/active/{id}/hold".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readCall.");const a="/calls/active/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchActiveCall:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v,q,C,R,P,T,_,E,K={})=>{const x=parse("/calls/active",!0);let k;e&&(k=e.baseOptions);const O={method:"GET",...k,...K},F={},I={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;F["X-Webitel-Access"]=t}void 0!==t&&(I.page=t),void 0!==r&&(I.size=r),void 0!==i&&(I.q=i),void 0!==a&&(I.sort=a),n&&(I.fields=n),void 0!==s&&(I["created_at.from"]=s),void 0!==o&&(I["created_at.to"]=o),u&&(I.user_id=u),c&&(I.agent_id=c),l&&(I.queue_id=l),d&&(I.team_id=d),p&&(I.member_id=p),h&&(I.gateway_id=h),void 0!==y&&(I["duration.from"]=y),void 0!==g&&(I["duration.to"]=g),void 0!==A&&(I.skip_parent=A),void 0!==m&&(I.parent_id=m),f&&(I.cause=f),void 0!==b&&(I.exists_file=b),void 0!==S&&(I.domain_id=S),void 0!==w&&(I.number=w),v&&(I.direction=v),void 0!==q&&(I["answered_at.from"]=q),void 0!==C&&(I["answered_at.to"]=C),void 0!==R&&(I.missed=R),void 0!==P&&(I["stored_at.from"]=P),void 0!==T&&(I["stored_at.to"]=T),_&&(I.supervisor_id=_),E&&(I.state=E),x.query={...x.query,...I,...K.query},delete x.search;let B=k&&k.headers?k.headers:{};return O.headers={...F,...B,...K.headers},{url:format(x),options:O}},searchHistoryCall:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v,q,C,R,P,T,_,E,K,x,k,O,F,I,B,W,H,X,Q={})=>{const U=parse("/calls/history",!0);let M;e&&(M=e.baseOptions);const G={method:"GET",...M,...Q},L={},j={};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&&(j.page=t),void 0!==r&&(j.size=r),void 0!==i&&(j.q=i),void 0!==a&&(j.sort=a),n&&(j.fields=n),void 0!==s&&(j["created_at.from"]=s),void 0!==o&&(j["created_at.to"]=o),u&&(j.user_id=u),c&&(j.agent_id=c),l&&(j.queue_id=l),d&&(j.team_id=d),p&&(j.member_id=p),h&&(j.gateway_id=h),void 0!==y&&(j["duration.from"]=y),void 0!==g&&(j["duration.to"]=g),void 0!==A&&(j.skip_parent=A),void 0!==m&&(j.parent_id=m),f&&(j.cause=f),void 0!==b&&(j.has_file=b),void 0!==S&&(j.domain_id=S),void 0!==w&&(j.number=w),void 0!==v&&(j.direction=v),void 0!==q&&(j["answered_at.from"]=q),void 0!==C&&(j["answered_at.to"]=C),void 0!==R&&(j.missed=R),void 0!==P&&(j["stored_at.from"]=P),void 0!==T&&(j["stored_at.to"]=T),_&&(j.id=_),E&&(j.transfer_from=E),K&&(j.transfer_to=K),x&&(j.dependency_id=x),k&&(j.tags=k),O&&(j.amd_result=O),void 0!==F&&(j.fts=F),I&&(j.directions=I),void 0!==B&&(j.has_transcript=B),void 0!==W&&(j.agent_description=W),H&&(j.owner_id=H),X&&(j.grantee_id=X),U.query={...U.query,...j,...Q.query},delete U.search;let N=M&&M.headers?M.headers:{};return G.headers={...L,...N,...Q.headers},{url:format(U),options:G}},unHoldCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling unHoldCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling unHoldCall.");const a="/calls/active/{id}/unhold".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},updateCallAnnotation:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("callId","Required parameter callId was null or undefined when calling updateCallAnnotation.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCallAnnotation.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateCallAnnotation.");const n="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},CallServiceApiFp=function(e){return{async aggregateHistoryCall(t,r){const i=await CallServiceApiAxiosParamCreator(e).aggregateHistoryCall(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async blindTransferCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).blindTransferCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async confirmPush(t,r){const i=await CallServiceApiAxiosParamCreator(e).confirmPush(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createCall(t,r){const i=await CallServiceApiAxiosParamCreator(e).createCall(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createCallAnnotation(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).createCallAnnotation(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteCallAnnotation(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).deleteCallAnnotation(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async dtmfCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).dtmfCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async eavesdropCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).eavesdropCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async hangupCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).hangupCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async holdCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).holdCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).readCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchActiveCall(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v,q,C,R,P,T,_,E,K){const x=await CallServiceApiAxiosParamCreator(e).searchActiveCall(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v,q,C,R,P,T,_,E,K);return(e=globalAxios,t=BASE_PATH)=>{const r={...x.options,url:t+x.url};return e.request(r)}},async searchHistoryCall(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v,q,C,R,P,T,_,E,K,x,k,O,F,I,B,W,H,X,Q){const U=await CallServiceApiAxiosParamCreator(e).searchHistoryCall(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v,q,C,R,P,T,_,E,K,x,k,O,F,I,B,W,H,X,Q);return(e=globalAxios,t=BASE_PATH)=>{const r={...U.options,url:t+U.url};return e.request(r)}},async unHoldCall(t,r,i){const a=await CallServiceApiAxiosParamCreator(e).unHoldCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async updateCallAnnotation(t,r,i,a){const n=await CallServiceApiAxiosParamCreator(e).updateCallAnnotation(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},CallServiceApiFactory=function(e,t,r){return{aggregateHistoryCall:(i,a)=>CallServiceApiFp(e).aggregateHistoryCall(i,a).then(e=>e(r,t)),blindTransferCall:(i,a,n)=>CallServiceApiFp(e).blindTransferCall(i,a,n).then(e=>e(r,t)),confirmPush:(i,a)=>CallServiceApiFp(e).confirmPush(i,a).then(e=>e(r,t)),createCall:(i,a)=>CallServiceApiFp(e).createCall(i,a).then(e=>e(r,t)),createCallAnnotation:(i,a,n)=>CallServiceApiFp(e).createCallAnnotation(i,a,n).then(e=>e(r,t)),deleteCallAnnotation:(i,a,n)=>CallServiceApiFp(e).deleteCallAnnotation(i,a,n).then(e=>e(r,t)),dtmfCall:(i,a,n)=>CallServiceApiFp(e).dtmfCall(i,a,n).then(e=>e(r,t)),eavesdropCall:(i,a,n)=>CallServiceApiFp(e).eavesdropCall(i,a,n).then(e=>e(r,t)),hangupCall:(i,a,n)=>CallServiceApiFp(e).hangupCall(i,a,n).then(e=>e(r,t)),holdCall:(i,a,n)=>CallServiceApiFp(e).holdCall(i,a,n).then(e=>e(r,t)),readCall:(i,a,n)=>CallServiceApiFp(e).readCall(i,a,n).then(e=>e(r,t)),searchActiveCall:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v,q,C,R,P,T,_,E,K,x,k)=>CallServiceApiFp(e).searchActiveCall(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v,q,C,R,P,T,_,E,K,x,k).then(e=>e(r,t)),searchHistoryCall:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v,q,C,R,P,T,_,E,K,x,k,O,F,I,B,W,H,X,Q,U,M)=>CallServiceApiFp(e).searchHistoryCall(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v,q,C,R,P,T,_,E,K,x,k,O,F,I,B,W,H,X,Q,U,M).then(e=>e(r,t)),unHoldCall:(i,a,n)=>CallServiceApiFp(e).unHoldCall(i,a,n).then(e=>e(r,t)),updateCallAnnotation:(i,a,n,s)=>CallServiceApiFp(e).updateCallAnnotation(i,a,n,s).then(e=>e(r,t))}};class CallServiceApi extends BaseAPI{aggregateHistoryCall(e,t){return CallServiceApiFp(this.configuration).aggregateHistoryCall(e,t).then(e=>e(this.axios,this.basePath))}blindTransferCall(e,t,r){return CallServiceApiFp(this.configuration).blindTransferCall(e,t,r).then(e=>e(this.axios,this.basePath))}confirmPush(e,t){return CallServiceApiFp(this.configuration).confirmPush(e,t).then(e=>e(this.axios,this.basePath))}createCall(e,t){return CallServiceApiFp(this.configuration).createCall(e,t).then(e=>e(this.axios,this.basePath))}createCallAnnotation(e,t,r){return CallServiceApiFp(this.configuration).createCallAnnotation(e,t,r).then(e=>e(this.axios,this.basePath))}deleteCallAnnotation(e,t,r){return CallServiceApiFp(this.configuration).deleteCallAnnotation(e,t,r).then(e=>e(this.axios,this.basePath))}dtmfCall(e,t,r){return CallServiceApiFp(this.configuration).dtmfCall(e,t,r).then(e=>e(this.axios,this.basePath))}eavesdropCall(e,t,r){return CallServiceApiFp(this.configuration).eavesdropCall(e,t,r).then(e=>e(this.axios,this.basePath))}hangupCall(e,t,r){return CallServiceApiFp(this.configuration).hangupCall(e,t,r).then(e=>e(this.axios,this.basePath))}holdCall(e,t,r){return CallServiceApiFp(this.configuration).holdCall(e,t,r).then(e=>e(this.axios,this.basePath))}readCall(e,t,r){return CallServiceApiFp(this.configuration).readCall(e,t,r).then(e=>e(this.axios,this.basePath))}searchActiveCall(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v,q,C,R,P,T,_,E){return CallServiceApiFp(this.configuration).searchActiveCall(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v,q,C,R,P,T,_,E).then(e=>e(this.axios,this.basePath))}searchHistoryCall(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v,q,C,R,P,T,_,E,K,x,k,O,F,I,B,W,H,X){return CallServiceApiFp(this.configuration).searchHistoryCall(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v,q,C,R,P,T,_,E,K,x,k,O,F,I,B,W,H,X).then(e=>e(this.axios,this.basePath))}unHoldCall(e,t,r){return CallServiceApiFp(this.configuration).unHoldCall(e,t,r).then(e=>e(this.axios,this.basePath))}updateCallAnnotation(e,t,r,i){return CallServiceApiFp(this.configuration).updateCallAnnotation(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const CognitiveProfileServiceApiAxiosParamCreator=function(e){return{createCognitiveProfile:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCognitiveProfile.");const i=parse("/storage/cognitive_profiles",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteCognitiveProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteCognitiveProfile.");const i="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchCognitiveProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchCognitiveProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchCognitiveProfile.");const a="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readCognitiveProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readCognitiveProfile.");const i="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchCognitiveProfile:async(t,r,i,a,n,s,o,u,c={})=>{const l=parse("/storage/cognitive_profiles",!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==t&&(y.page=t),void 0!==r&&(y.size=r),void 0!==i&&(y.q=i),void 0!==a&&(y.sort=a),n&&(y.fields=n),s&&(y.id=s),o&&(y.service=o),void 0!==u&&(y.enabled=u),l.query={...l.query,...y,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},updateCognitiveProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCognitiveProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateCognitiveProfile.");const a="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},CognitiveProfileServiceApiFp=function(e){return{async createCognitiveProfile(t,r){const i=await CognitiveProfileServiceApiAxiosParamCreator(e).createCognitiveProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteCognitiveProfile(t,r){const i=await CognitiveProfileServiceApiAxiosParamCreator(e).deleteCognitiveProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchCognitiveProfile(t,r,i){const a=await CognitiveProfileServiceApiAxiosParamCreator(e).patchCognitiveProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readCognitiveProfile(t,r){const i=await CognitiveProfileServiceApiAxiosParamCreator(e).readCognitiveProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchCognitiveProfile(t,r,i,a,n,s,o,u,c){const l=await CognitiveProfileServiceApiAxiosParamCreator(e).searchCognitiveProfile(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async updateCognitiveProfile(t,r,i){const a=await CognitiveProfileServiceApiAxiosParamCreator(e).updateCognitiveProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},CognitiveProfileServiceApiFactory=function(e,t,r){return{createCognitiveProfile:(i,a)=>CognitiveProfileServiceApiFp(e).createCognitiveProfile(i,a).then(e=>e(r,t)),deleteCognitiveProfile:(i,a)=>CognitiveProfileServiceApiFp(e).deleteCognitiveProfile(i,a).then(e=>e(r,t)),patchCognitiveProfile:(i,a,n)=>CognitiveProfileServiceApiFp(e).patchCognitiveProfile(i,a,n).then(e=>e(r,t)),readCognitiveProfile:(i,a)=>CognitiveProfileServiceApiFp(e).readCognitiveProfile(i,a).then(e=>e(r,t)),searchCognitiveProfile:(i,a,n,s,o,u,c,l,d)=>CognitiveProfileServiceApiFp(e).searchCognitiveProfile(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),updateCognitiveProfile:(i,a,n)=>CognitiveProfileServiceApiFp(e).updateCognitiveProfile(i,a,n).then(e=>e(r,t))}};class CognitiveProfileServiceApi extends BaseAPI{createCognitiveProfile(e,t){return CognitiveProfileServiceApiFp(this.configuration).createCognitiveProfile(e,t).then(e=>e(this.axios,this.basePath))}deleteCognitiveProfile(e,t){return CognitiveProfileServiceApiFp(this.configuration).deleteCognitiveProfile(e,t).then(e=>e(this.axios,this.basePath))}patchCognitiveProfile(e,t,r){return CognitiveProfileServiceApiFp(this.configuration).patchCognitiveProfile(e,t,r).then(e=>e(this.axios,this.basePath))}readCognitiveProfile(e,t){return CognitiveProfileServiceApiFp(this.configuration).readCognitiveProfile(e,t).then(e=>e(this.axios,this.basePath))}searchCognitiveProfile(e,t,r,i,a,n,s,o,u){return CognitiveProfileServiceApiFp(this.configuration).searchCognitiveProfile(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateCognitiveProfile(e,t,r){return CognitiveProfileServiceApiFp(this.configuration).updateCognitiveProfile(e,t,r).then(e=>e(this.axios,this.basePath))}}const CommunicationTypeServiceApiAxiosParamCreator=function(e){return{createCommunicationType:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createCommunicationType.");const i=parse("/call_center/communication_type",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteCommunicationType:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteCommunicationType.");const a="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readCommunicationType:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readCommunicationType.");const a="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchCommunicationType:async(t,r,i,a,n,s,o={})=>{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!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateCommunicationType:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateCommunicationType.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateCommunicationType.");const a="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},CommunicationTypeServiceApiFp=function(e){return{async createCommunicationType(t,r){const i=await CommunicationTypeServiceApiAxiosParamCreator(e).createCommunicationType(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteCommunicationType(t,r,i){const a=await CommunicationTypeServiceApiAxiosParamCreator(e).deleteCommunicationType(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readCommunicationType(t,r,i){const a=await CommunicationTypeServiceApiAxiosParamCreator(e).readCommunicationType(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchCommunicationType(t,r,i,a,n,s,o){const u=await CommunicationTypeServiceApiAxiosParamCreator(e).searchCommunicationType(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateCommunicationType(t,r,i){const a=await CommunicationTypeServiceApiAxiosParamCreator(e).updateCommunicationType(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},CommunicationTypeServiceApiFactory=function(e,t,r){return{createCommunicationType:(i,a)=>CommunicationTypeServiceApiFp(e).createCommunicationType(i,a).then(e=>e(r,t)),deleteCommunicationType:(i,a,n)=>CommunicationTypeServiceApiFp(e).deleteCommunicationType(i,a,n).then(e=>e(r,t)),readCommunicationType:(i,a,n)=>CommunicationTypeServiceApiFp(e).readCommunicationType(i,a,n).then(e=>e(r,t)),searchCommunicationType:(i,a,n,s,o,u,c)=>CommunicationTypeServiceApiFp(e).searchCommunicationType(i,a,n,s,o,u,c).then(e=>e(r,t)),updateCommunicationType:(i,a,n)=>CommunicationTypeServiceApiFp(e).updateCommunicationType(i,a,n).then(e=>e(r,t))}};class CommunicationTypeServiceApi extends BaseAPI{createCommunicationType(e,t){return CommunicationTypeServiceApiFp(this.configuration).createCommunicationType(e,t).then(e=>e(this.axios,this.basePath))}deleteCommunicationType(e,t,r){return CommunicationTypeServiceApiFp(this.configuration).deleteCommunicationType(e,t,r).then(e=>e(this.axios,this.basePath))}readCommunicationType(e,t,r){return CommunicationTypeServiceApiFp(this.configuration).readCommunicationType(e,t,r).then(e=>e(this.axios,this.basePath))}searchCommunicationType(e,t,r,i,a,n,s){return CommunicationTypeServiceApiFp(this.configuration).searchCommunicationType(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateCommunicationType(e,t,r){return CommunicationTypeServiceApiFp(this.configuration).updateCommunicationType(e,t,r).then(e=>e(this.axios,this.basePath))}}const EmailProfileServiceApiAxiosParamCreator=function(e){return{createEmailProfile:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createEmailProfile.");const i=parse("/email/profile",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteEmailProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteEmailProfile.");const i="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchEmailProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchEmailProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchEmailProfile.");const a="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readEmailProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readEmailProfile.");const i="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchEmailProfile:async(t,r,i,a,n,s={})=>{const o=parse("/email/profile",!0);let u;e&&(u=e.baseOptions);const c={method:"GET",...u,...s},l={},d={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}void 0!==t&&(d.page=t),void 0!==r&&(d.size=r),void 0!==i&&(d.q=i),void 0!==a&&(d.sort=a),n&&(d.fields=n),o.query={...o.query,...d,...s.query},delete o.search;let p=u&&u.headers?u.headers:{};return c.headers={...l,...p,...s.headers},{url:format(o),options:c}},testEmailProfile:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling testEmailProfile.");const i="/email/profile/{id}/test".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},updateEmailProfile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateEmailProfile.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateEmailProfile.");const a="/email/profile/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},EmailProfileServiceApiFp=function(e){return{async createEmailProfile(t,r){const i=await EmailProfileServiceApiAxiosParamCreator(e).createEmailProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteEmailProfile(t,r){const i=await EmailProfileServiceApiAxiosParamCreator(e).deleteEmailProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchEmailProfile(t,r,i){const a=await EmailProfileServiceApiAxiosParamCreator(e).patchEmailProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readEmailProfile(t,r){const i=await EmailProfileServiceApiAxiosParamCreator(e).readEmailProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchEmailProfile(t,r,i,a,n,s){const o=await EmailProfileServiceApiAxiosParamCreator(e).searchEmailProfile(t,r,i,a,n,s);return(e=globalAxios,t=BASE_PATH)=>{const r={...o.options,url:t+o.url};return e.request(r)}},async testEmailProfile(t,r){const i=await EmailProfileServiceApiAxiosParamCreator(e).testEmailProfile(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async updateEmailProfile(t,r,i){const a=await EmailProfileServiceApiAxiosParamCreator(e).updateEmailProfile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},EmailProfileServiceApiFactory=function(e,t,r){return{createEmailProfile:(i,a)=>EmailProfileServiceApiFp(e).createEmailProfile(i,a).then(e=>e(r,t)),deleteEmailProfile:(i,a)=>EmailProfileServiceApiFp(e).deleteEmailProfile(i,a).then(e=>e(r,t)),patchEmailProfile:(i,a,n)=>EmailProfileServiceApiFp(e).patchEmailProfile(i,a,n).then(e=>e(r,t)),readEmailProfile:(i,a)=>EmailProfileServiceApiFp(e).readEmailProfile(i,a).then(e=>e(r,t)),searchEmailProfile:(i,a,n,s,o,u)=>EmailProfileServiceApiFp(e).searchEmailProfile(i,a,n,s,o,u).then(e=>e(r,t)),testEmailProfile:(i,a)=>EmailProfileServiceApiFp(e).testEmailProfile(i,a).then(e=>e(r,t)),updateEmailProfile:(i,a,n)=>EmailProfileServiceApiFp(e).updateEmailProfile(i,a,n).then(e=>e(r,t))}};class EmailProfileServiceApi extends BaseAPI{createEmailProfile(e,t){return EmailProfileServiceApiFp(this.configuration).createEmailProfile(e,t).then(e=>e(this.axios,this.basePath))}deleteEmailProfile(e,t){return EmailProfileServiceApiFp(this.configuration).deleteEmailProfile(e,t).then(e=>e(this.axios,this.basePath))}patchEmailProfile(e,t,r){return EmailProfileServiceApiFp(this.configuration).patchEmailProfile(e,t,r).then(e=>e(this.axios,this.basePath))}readEmailProfile(e,t){return EmailProfileServiceApiFp(this.configuration).readEmailProfile(e,t).then(e=>e(this.axios,this.basePath))}searchEmailProfile(e,t,r,i,a,n){return EmailProfileServiceApiFp(this.configuration).searchEmailProfile(e,t,r,i,a,n).then(e=>e(this.axios,this.basePath))}testEmailProfile(e,t){return EmailProfileServiceApiFp(this.configuration).testEmailProfile(e,t).then(e=>e(this.axios,this.basePath))}updateEmailProfile(e,t,r){return EmailProfileServiceApiFp(this.configuration).updateEmailProfile(e,t,r).then(e=>e(this.axios,this.basePath))}}const FileServiceApiAxiosParamCreator=function(e){return{deleteFiles:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling deleteFiles.");const i=parse("/storage/file",!0);let a;e&&(a=e.baseOptions);const n={method:"DELETE",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}}}},FileServiceApiFp=function(e){return{async deleteFiles(t,r){const i=await FileServiceApiAxiosParamCreator(e).deleteFiles(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}}}},FileServiceApiFactory=function(e,t,r){return{deleteFiles:(i,a)=>FileServiceApiFp(e).deleteFiles(i,a).then(e=>e(r,t))}};class FileServiceApi extends BaseAPI{deleteFiles(e,t){return FileServiceApiFp(this.configuration).deleteFiles(e,t).then(e=>e(this.axios,this.basePath))}}const FileTranscriptServiceApiAxiosParamCreator=function(e){return{createFileTranscript:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createFileTranscript.");const i=parse("/storage/transcript_file",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteFileTranscript:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling deleteFileTranscript.");const i=parse("/storage/transcript_file",!0);let a;e&&(a=e.baseOptions);const n={method:"DELETE",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},getFileTranscriptPhrases:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling getFileTranscriptPhrases.");const n="/storage/transcript_file/{id}/phrases".replace("{id}",encodeURIComponent(String(t))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==r&&(l.page=r),void 0!==i&&(l.size=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}}}},FileTranscriptServiceApiFp=function(e){return{async createFileTranscript(t,r){const i=await FileTranscriptServiceApiAxiosParamCreator(e).createFileTranscript(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteFileTranscript(t,r){const i=await FileTranscriptServiceApiAxiosParamCreator(e).deleteFileTranscript(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async getFileTranscriptPhrases(t,r,i,a){const n=await FileTranscriptServiceApiAxiosParamCreator(e).getFileTranscriptPhrases(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},FileTranscriptServiceApiFactory=function(e,t,r){return{createFileTranscript:(i,a)=>FileTranscriptServiceApiFp(e).createFileTranscript(i,a).then(e=>e(r,t)),deleteFileTranscript:(i,a)=>FileTranscriptServiceApiFp(e).deleteFileTranscript(i,a).then(e=>e(r,t)),getFileTranscriptPhrases:(i,a,n,s)=>FileTranscriptServiceApiFp(e).getFileTranscriptPhrases(i,a,n,s).then(e=>e(r,t))}};class FileTranscriptServiceApi extends BaseAPI{createFileTranscript(e,t){return FileTranscriptServiceApiFp(this.configuration).createFileTranscript(e,t).then(e=>e(this.axios,this.basePath))}deleteFileTranscript(e,t){return FileTranscriptServiceApiFp(this.configuration).deleteFileTranscript(e,t).then(e=>e(this.axios,this.basePath))}getFileTranscriptPhrases(e,t,r,i){return FileTranscriptServiceApiFp(this.configuration).getFileTranscriptPhrases(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const ImportTemplateServiceApiAxiosParamCreator=function(e){return{createImportTemplate:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createImportTemplate.");const i=parse("/storage/import_templates",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteImportTemplate:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteImportTemplate.");const i="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchImportTemplate:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchImportTemplate.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchImportTemplate.");const a="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readImportTemplate:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readImportTemplate.");const i="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchImportTemplate:async(t,r,i,a,n,s,o={})=>{const u=parse("/storage/import_templates",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateImportTemplate:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateImportTemplate.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateImportTemplate.");const a="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},ImportTemplateServiceApiFp=function(e){return{async createImportTemplate(t,r){const i=await ImportTemplateServiceApiAxiosParamCreator(e).createImportTemplate(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteImportTemplate(t,r){const i=await ImportTemplateServiceApiAxiosParamCreator(e).deleteImportTemplate(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchImportTemplate(t,r,i){const a=await ImportTemplateServiceApiAxiosParamCreator(e).patchImportTemplate(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readImportTemplate(t,r){const i=await ImportTemplateServiceApiAxiosParamCreator(e).readImportTemplate(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchImportTemplate(t,r,i,a,n,s,o){const u=await ImportTemplateServiceApiAxiosParamCreator(e).searchImportTemplate(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateImportTemplate(t,r,i){const a=await ImportTemplateServiceApiAxiosParamCreator(e).updateImportTemplate(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},ImportTemplateServiceApiFactory=function(e,t,r){return{createImportTemplate:(i,a)=>ImportTemplateServiceApiFp(e).createImportTemplate(i,a).then(e=>e(r,t)),deleteImportTemplate:(i,a)=>ImportTemplateServiceApiFp(e).deleteImportTemplate(i,a).then(e=>e(r,t)),patchImportTemplate:(i,a,n)=>ImportTemplateServiceApiFp(e).patchImportTemplate(i,a,n).then(e=>e(r,t)),readImportTemplate:(i,a)=>ImportTemplateServiceApiFp(e).readImportTemplate(i,a).then(e=>e(r,t)),searchImportTemplate:(i,a,n,s,o,u,c)=>ImportTemplateServiceApiFp(e).searchImportTemplate(i,a,n,s,o,u,c).then(e=>e(r,t)),updateImportTemplate:(i,a,n)=>ImportTemplateServiceApiFp(e).updateImportTemplate(i,a,n).then(e=>e(r,t))}};class ImportTemplateServiceApi extends BaseAPI{createImportTemplate(e,t){return ImportTemplateServiceApiFp(this.configuration).createImportTemplate(e,t).then(e=>e(this.axios,this.basePath))}deleteImportTemplate(e,t){return ImportTemplateServiceApiFp(this.configuration).deleteImportTemplate(e,t).then(e=>e(this.axios,this.basePath))}patchImportTemplate(e,t,r){return ImportTemplateServiceApiFp(this.configuration).patchImportTemplate(e,t,r).then(e=>e(this.axios,this.basePath))}readImportTemplate(e,t){return ImportTemplateServiceApiFp(this.configuration).readImportTemplate(e,t).then(e=>e(this.axios,this.basePath))}searchImportTemplate(e,t,r,i,a,n,s){return ImportTemplateServiceApiFp(this.configuration).searchImportTemplate(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateImportTemplate(e,t,r){return ImportTemplateServiceApiFp(this.configuration).updateImportTemplate(e,t,r).then(e=>e(this.axios,this.basePath))}}const ListServiceApiAxiosParamCreator=function(e){return{createList:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createList.");const i=parse("/call_center/list",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},createListCommunication:async(t,r,i={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling createListCommunication.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createListCommunication.");const a="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteList:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteList.");const a="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},deleteListCommunication:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling deleteListCommunication.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteListCommunication.");const n="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},readList:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readList.");const a="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readListCommunication:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling readListCommunication.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readListCommunication.");const n="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchList:async(t,r,i,a,n,s,o={})=>{const u=parse("/call_center/list",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},searchListCommunication:async(t,r,i,a,n,s,o,u,c,l={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling searchListCommunication.");const d="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(t))),p=parse(d,!0);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...l},g={},A={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==r&&(A.page=r),void 0!==i&&(A.size=i),void 0!==a&&(A.q=a),void 0!==n&&(A.sort=n),s&&(A.fields=s),o&&(A.id=o),void 0!==u&&(A["expire_at.from"]=u),void 0!==c&&(A["expire_at.to"]=c),p.query={...p.query,...A,...l.query},delete p.search;let m=h&&h.headers?h.headers:{};return y.headers={...g,...m,...l.headers},{url:format(p),options:y}},updateList:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateList.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateList.");const a="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},updateListCommunication:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("listId","Required parameter listId was null or undefined when calling updateListCommunication.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateListCommunication.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateListCommunication.");const n="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},ListServiceApiFp=function(e){return{async createList(t,r){const i=await ListServiceApiAxiosParamCreator(e).createList(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createListCommunication(t,r,i){const a=await ListServiceApiAxiosParamCreator(e).createListCommunication(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteList(t,r,i){const a=await ListServiceApiAxiosParamCreator(e).deleteList(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteListCommunication(t,r,i,a){const n=await ListServiceApiAxiosParamCreator(e).deleteListCommunication(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readList(t,r,i){const a=await ListServiceApiAxiosParamCreator(e).readList(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readListCommunication(t,r,i,a){const n=await ListServiceApiAxiosParamCreator(e).readListCommunication(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchList(t,r,i,a,n,s,o){const u=await ListServiceApiAxiosParamCreator(e).searchList(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async searchListCommunication(t,r,i,a,n,s,o,u,c,l){const d=await ListServiceApiAxiosParamCreator(e).searchListCommunication(t,r,i,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async updateList(t,r,i){const a=await ListServiceApiAxiosParamCreator(e).updateList(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async updateListCommunication(t,r,i,a){const n=await ListServiceApiAxiosParamCreator(e).updateListCommunication(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},ListServiceApiFactory=function(e,t,r){return{createList:(i,a)=>ListServiceApiFp(e).createList(i,a).then(e=>e(r,t)),createListCommunication:(i,a,n)=>ListServiceApiFp(e).createListCommunication(i,a,n).then(e=>e(r,t)),deleteList:(i,a,n)=>ListServiceApiFp(e).deleteList(i,a,n).then(e=>e(r,t)),deleteListCommunication:(i,a,n,s)=>ListServiceApiFp(e).deleteListCommunication(i,a,n,s).then(e=>e(r,t)),readList:(i,a,n)=>ListServiceApiFp(e).readList(i,a,n).then(e=>e(r,t)),readListCommunication:(i,a,n,s)=>ListServiceApiFp(e).readListCommunication(i,a,n,s).then(e=>e(r,t)),searchList:(i,a,n,s,o,u,c)=>ListServiceApiFp(e).searchList(i,a,n,s,o,u,c).then(e=>e(r,t)),searchListCommunication:(i,a,n,s,o,u,c,l,d,p)=>ListServiceApiFp(e).searchListCommunication(i,a,n,s,o,u,c,l,d,p).then(e=>e(r,t)),updateList:(i,a,n)=>ListServiceApiFp(e).updateList(i,a,n).then(e=>e(r,t)),updateListCommunication:(i,a,n,s)=>ListServiceApiFp(e).updateListCommunication(i,a,n,s).then(e=>e(r,t))}};class ListServiceApi extends BaseAPI{createList(e,t){return ListServiceApiFp(this.configuration).createList(e,t).then(e=>e(this.axios,this.basePath))}createListCommunication(e,t,r){return ListServiceApiFp(this.configuration).createListCommunication(e,t,r).then(e=>e(this.axios,this.basePath))}deleteList(e,t,r){return ListServiceApiFp(this.configuration).deleteList(e,t,r).then(e=>e(this.axios,this.basePath))}deleteListCommunication(e,t,r,i){return ListServiceApiFp(this.configuration).deleteListCommunication(e,t,r,i).then(e=>e(this.axios,this.basePath))}readList(e,t,r){return ListServiceApiFp(this.configuration).readList(e,t,r).then(e=>e(this.axios,this.basePath))}readListCommunication(e,t,r,i){return ListServiceApiFp(this.configuration).readListCommunication(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchList(e,t,r,i,a,n,s){return ListServiceApiFp(this.configuration).searchList(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}searchListCommunication(e,t,r,i,a,n,s,o,u,c){return ListServiceApiFp(this.configuration).searchListCommunication(e,t,r,i,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}updateList(e,t,r){return ListServiceApiFp(this.configuration).updateList(e,t,r).then(e=>e(this.axios,this.basePath))}updateListCommunication(e,t,r,i){return ListServiceApiFp(this.configuration).updateListCommunication(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const MediaFileServiceApiAxiosParamCreator=function(e){return{deleteMediaFile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteMediaFile.");const a="/storage/media/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readMediaFile:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readMediaFile.");const a="/storage/media/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchMediaFile:async(t,r,i,a,n,s,o={})=>{const u=parse("/storage/media",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}}}},MediaFileServiceApiFp=function(e){return{async deleteMediaFile(t,r,i){const a=await MediaFileServiceApiAxiosParamCreator(e).deleteMediaFile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readMediaFile(t,r,i){const a=await MediaFileServiceApiAxiosParamCreator(e).readMediaFile(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchMediaFile(t,r,i,a,n,s,o){const u=await MediaFileServiceApiAxiosParamCreator(e).searchMediaFile(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}}}},MediaFileServiceApiFactory=function(e,t,r){return{deleteMediaFile:(i,a,n)=>MediaFileServiceApiFp(e).deleteMediaFile(i,a,n).then(e=>e(r,t)),readMediaFile:(i,a,n)=>MediaFileServiceApiFp(e).readMediaFile(i,a,n).then(e=>e(r,t)),searchMediaFile:(i,a,n,s,o,u,c)=>MediaFileServiceApiFp(e).searchMediaFile(i,a,n,s,o,u,c).then(e=>e(r,t))}};class MediaFileServiceApi extends BaseAPI{deleteMediaFile(e,t,r){return MediaFileServiceApiFp(this.configuration).deleteMediaFile(e,t,r).then(e=>e(this.axios,this.basePath))}readMediaFile(e,t,r){return MediaFileServiceApiFp(this.configuration).readMediaFile(e,t,r).then(e=>e(this.axios,this.basePath))}searchMediaFile(e,t,r,i,a,n,s){return MediaFileServiceApiFp(this.configuration).searchMediaFile(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}}const MemberServiceApiAxiosParamCreator=function(e){return{attemptCallback:async(t,r,i={})=>{if(null==t)throw new RequiredError("attemptId","Required parameter attemptId was null or undefined when calling attemptCallback.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling attemptCallback.");const a="/call_center/attempts/{attempt_id}".replace("{attempt_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},attemptResult:async(t,r,i,a,n={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling attemptResult.");if(null==r)throw new RequiredError("memberId","Required parameter memberId was null or undefined when calling attemptResult.");if(null==i)throw new RequiredError("attemptId","Required parameter attemptId was null or undefined when calling attemptResult.");if(null==a)throw new RequiredError("body","Required parameter body was null or undefined when calling attemptResult.");const s="/call_center/queues/{queue_id}/members/{member_id}/attempts/{attempt_id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{member_id}",encodeURIComponent(String(r))).replace("{attempt_id}",encodeURIComponent(String(i))),o=parse(s,!0);let u;e&&(u=e.baseOptions);const c={method:"PATCH",...u,...n},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;l["X-Webitel-Access"]=t}l["Content-Type"]="application/json",o.query={...o.query,...n.query},delete o.search;let d=u&&u.headers?u.headers:{};c.headers={...l,...d,...n.headers};const p="string"!=typeof a||"application/json"===c.headers["Content-Type"];return c.data=p?JSON.stringify(void 0!==a?a:{}):a||"",{url:format(o),options:c}},attemptsRenewalResult:async(t,r,i={})=>{if(null==t)throw new RequiredError("attemptId","Required parameter attemptId was null or undefined when calling attemptsRenewalResult.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling attemptsRenewalResult.");const a="/call_center/queues/attempts/{attempt_id}/renewal".replace("{attempt_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},createAttempt:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createAttempt.");if(null==r)throw new RequiredError("memberId","Required parameter memberId was null or undefined when calling createAttempt.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling createAttempt.");const n="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(t))).replace("{member_id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"POST",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},createMember:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createMember.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createMember.");const a="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},createMemberBulk:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createMemberBulk.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createMemberBulk.");const a="/call_center/queues/{queue_id}/members/bulk".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteMember:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteMember.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteMember.");const n="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},deleteMembers:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteMembers.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling deleteMembers.");const a="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},patchMember:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchMember.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling patchMember.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling patchMember.");const n="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},readMember:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readMember.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readMember.");const n="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},resetMembers:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling resetMembers.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling resetMembers.");const a="/call_center/queues/{queue_id}/members/reset".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},searchAttempts:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,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!==r&&(R.size=r),void 0!==i&&(R.q=i),void 0!==a&&(R.sort=a),n&&(R.fields=n),void 0!==s&&(R["joined_at.from"]=s),void 0!==o&&(R["joined_at.to"]=o),u&&(R.id=u),c&&(R.queue_id=c),l&&(R.bucket_id=l),d&&(R.member_id=d),p&&(R.agent_id=p),h&&(R.result=h),void 0!==y&&(R["leaving_at.from"]=y),void 0!==g&&(R["leaving_at.to"]=g),void 0!==A&&(R["offering_at.from"]=A),void 0!==m&&(R["offering_at.to"]=m),void 0!==f&&(R["duration.from"]=f),void 0!==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,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,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!==r&&(R.size=r),void 0!==i&&(R.q=i),void 0!==a&&(R.sort=a),n&&(R.fields=n),void 0!==s&&(R["joined_at.from"]=s),void 0!==o&&(R["joined_at.to"]=o),u&&(R.id=u),c&&(R.queue_id=c),l&&(R.bucket_id=l),d&&(R.member_id=d),p&&(R.agent_id=p),h&&(R.result=h),void 0!==y&&(R["leaving_at.from"]=y),void 0!==g&&(R["leaving_at.to"]=g),void 0!==A&&(R["offering_at.from"]=A),void 0!==m&&(R["offering_at.to"]=m),void 0!==f&&(R["duration.from"]=f),void 0!==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,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchMemberAttempts.");if(null==r)throw new RequiredError("memberId","Required parameter memberId was null or undefined when calling searchMemberAttempts.");const n="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(t))).replace("{member_id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchMemberInQueue:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,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={},T={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;P["X-Webitel-Access"]=t}void 0!==r&&(T.page=r),void 0!==i&&(T.size=i),void 0!==a&&(T.q=a),void 0!==n&&(T.sort=n),s&&(T.fields=s),o&&(T.id=o),u&&(T.bucket_id=u),void 0!==c&&(T.destination=c),void 0!==l&&(T["created_at.from"]=l),void 0!==d&&(T["created_at.to"]=d),void 0!==p&&(T["offering_at.from"]=p),void 0!==h&&(T["offering_at.to"]=h),y&&(T.stop_cause=y),void 0!==g&&(T["priority.from"]=g),void 0!==A&&(T["priority.to"]=A),void 0!==m&&(T.name=m),void 0!==f&&(T["attempts.from"]=f),void 0!==b&&(T["attempts.to"]=b),S&&(T.agent_id=S),q.query={...q.query,...T,...w.query},delete q.search;let _=C&&C.headers?C.headers:{};return R.headers={...P,..._,...w.headers},{url:format(q),options:R}},searchMembers:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,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!==r&&(P.size=r),void 0!==i&&(P.q=i),void 0!==a&&(P.sort=a),n&&(P.fields=n),s&&(P.id=s),o&&(P.queue_id=o),u&&(P.bucket_id=u),void 0!==c&&(P.destination=c),void 0!==l&&(P["created_at.from"]=l),void 0!==d&&(P["created_at.to"]=d),void 0!==p&&(P["offering_at.from"]=p),void 0!==h&&(P["offering_at.to"]=h),y&&(P.stop_cause=y),void 0!==g&&(P["priority.from"]=g),void 0!==A&&(P["priority.to"]=A),void 0!==m&&(P.name=m),void 0!==f&&(P["attempts.from"]=f),void 0!==b&&(P["attempts.to"]=b),S&&(P.agent_id=S),v.query={...v.query,...P,...w.query},delete v.search;let T=q&&q.headers?q.headers:{};return C.headers={...R,...T,...w.headers},{url:format(v),options:C}},updateMember:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateMember.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateMember.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateMember.");const n="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},MemberServiceApiFp=function(e){return{async attemptCallback(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).attemptCallback(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async attemptResult(t,r,i,a,n){const s=await MemberServiceApiAxiosParamCreator(e).attemptResult(t,r,i,a,n);return(e=globalAxios,t=BASE_PATH)=>{const r={...s.options,url:t+s.url};return e.request(r)}},async attemptsRenewalResult(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).attemptsRenewalResult(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async createAttempt(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).createAttempt(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async createMember(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).createMember(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async createMemberBulk(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).createMemberBulk(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteMember(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).deleteMember(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async deleteMembers(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).deleteMembers(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchMember(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).patchMember(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readMember(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).readMember(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async resetMembers(t,r,i){const a=await MemberServiceApiAxiosParamCreator(e).resetMembers(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchAttempts(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S){const w=await MemberServiceApiAxiosParamCreator(e).searchAttempts(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S);return(e=globalAxios,t=BASE_PATH)=>{const r={...w.options,url:t+w.url};return e.request(r)}},async searchAttemptsHistory(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S){const w=await MemberServiceApiAxiosParamCreator(e).searchAttemptsHistory(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S);return(e=globalAxios,t=BASE_PATH)=>{const r={...w.options,url:t+w.url};return e.request(r)}},async searchMemberAttempts(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).searchMemberAttempts(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchMemberInQueue(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w){const v=await MemberServiceApiAxiosParamCreator(e).searchMemberInQueue(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w);return(e=globalAxios,t=BASE_PATH)=>{const r={...v.options,url:t+v.url};return e.request(r)}},async searchMembers(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w){const v=await MemberServiceApiAxiosParamCreator(e).searchMembers(t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w);return(e=globalAxios,t=BASE_PATH)=>{const r={...v.options,url:t+v.url};return e.request(r)}},async updateMember(t,r,i,a){const n=await MemberServiceApiAxiosParamCreator(e).updateMember(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},MemberServiceApiFactory=function(e,t,r){return{attemptCallback:(i,a,n)=>MemberServiceApiFp(e).attemptCallback(i,a,n).then(e=>e(r,t)),attemptResult:(i,a,n,s,o)=>MemberServiceApiFp(e).attemptResult(i,a,n,s,o).then(e=>e(r,t)),attemptsRenewalResult:(i,a,n)=>MemberServiceApiFp(e).attemptsRenewalResult(i,a,n).then(e=>e(r,t)),createAttempt:(i,a,n,s)=>MemberServiceApiFp(e).createAttempt(i,a,n,s).then(e=>e(r,t)),createMember:(i,a,n)=>MemberServiceApiFp(e).createMember(i,a,n).then(e=>e(r,t)),createMemberBulk:(i,a,n)=>MemberServiceApiFp(e).createMemberBulk(i,a,n).then(e=>e(r,t)),deleteMember:(i,a,n,s)=>MemberServiceApiFp(e).deleteMember(i,a,n,s).then(e=>e(r,t)),deleteMembers:(i,a,n)=>MemberServiceApiFp(e).deleteMembers(i,a,n).then(e=>e(r,t)),patchMember:(i,a,n,s)=>MemberServiceApiFp(e).patchMember(i,a,n,s).then(e=>e(r,t)),readMember:(i,a,n,s)=>MemberServiceApiFp(e).readMember(i,a,n,s).then(e=>e(r,t)),resetMembers:(i,a,n)=>MemberServiceApiFp(e).resetMembers(i,a,n).then(e=>e(r,t)),searchAttempts:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v)=>MemberServiceApiFp(e).searchAttempts(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v).then(e=>e(r,t)),searchAttemptsHistory:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v)=>MemberServiceApiFp(e).searchAttemptsHistory(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v).then(e=>e(r,t)),searchMemberAttempts:(i,a,n,s)=>MemberServiceApiFp(e).searchMemberAttempts(i,a,n,s).then(e=>e(r,t)),searchMemberInQueue:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v,q)=>MemberServiceApiFp(e).searchMemberInQueue(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v,q).then(e=>e(r,t)),searchMembers:(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v,q)=>MemberServiceApiFp(e).searchMembers(i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S,w,v,q).then(e=>e(r,t)),updateMember:(i,a,n,s)=>MemberServiceApiFp(e).updateMember(i,a,n,s).then(e=>e(r,t))}};class MemberServiceApi extends BaseAPI{attemptCallback(e,t,r){return MemberServiceApiFp(this.configuration).attemptCallback(e,t,r).then(e=>e(this.axios,this.basePath))}attemptResult(e,t,r,i,a){return MemberServiceApiFp(this.configuration).attemptResult(e,t,r,i,a).then(e=>e(this.axios,this.basePath))}attemptsRenewalResult(e,t,r){return MemberServiceApiFp(this.configuration).attemptsRenewalResult(e,t,r).then(e=>e(this.axios,this.basePath))}createAttempt(e,t,r,i){return MemberServiceApiFp(this.configuration).createAttempt(e,t,r,i).then(e=>e(this.axios,this.basePath))}createMember(e,t,r){return MemberServiceApiFp(this.configuration).createMember(e,t,r).then(e=>e(this.axios,this.basePath))}createMemberBulk(e,t,r){return MemberServiceApiFp(this.configuration).createMemberBulk(e,t,r).then(e=>e(this.axios,this.basePath))}deleteMember(e,t,r,i){return MemberServiceApiFp(this.configuration).deleteMember(e,t,r,i).then(e=>e(this.axios,this.basePath))}deleteMembers(e,t,r){return MemberServiceApiFp(this.configuration).deleteMembers(e,t,r).then(e=>e(this.axios,this.basePath))}patchMember(e,t,r,i){return MemberServiceApiFp(this.configuration).patchMember(e,t,r,i).then(e=>e(this.axios,this.basePath))}readMember(e,t,r,i){return MemberServiceApiFp(this.configuration).readMember(e,t,r,i).then(e=>e(this.axios,this.basePath))}resetMembers(e,t,r){return MemberServiceApiFp(this.configuration).resetMembers(e,t,r).then(e=>e(this.axios,this.basePath))}searchAttempts(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b){return MemberServiceApiFp(this.configuration).searchAttempts(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b).then(e=>e(this.axios,this.basePath))}searchAttemptsHistory(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b){return MemberServiceApiFp(this.configuration).searchAttemptsHistory(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b).then(e=>e(this.axios,this.basePath))}searchMemberAttempts(e,t,r,i){return MemberServiceApiFp(this.configuration).searchMemberAttempts(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchMemberInQueue(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S){return MemberServiceApiFp(this.configuration).searchMemberInQueue(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S).then(e=>e(this.axios,this.basePath))}searchMembers(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S){return MemberServiceApiFp(this.configuration).searchMembers(e,t,r,i,a,n,s,o,u,c,l,d,p,h,y,g,A,m,f,b,S).then(e=>e(this.axios,this.basePath))}updateMember(e,t,r,i){return MemberServiceApiFp(this.configuration).updateMember(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const OutboundResourceGroupServiceApiAxiosParamCreator=function(e){return{createOutboundResourceGroup:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createOutboundResourceGroup.");const i=parse("/call_center/resource_group",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},createOutboundResourceInGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling createOutboundResourceInGroup.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createOutboundResourceInGroup.");const a="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteOutboundResourceGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteOutboundResourceGroup.");const a="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},deleteOutboundResourceInGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling deleteOutboundResourceInGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteOutboundResourceInGroup.");const n="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},readOutboundResourceGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readOutboundResourceGroup.");const a="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readOutboundResourceInGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling readOutboundResourceInGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readOutboundResourceInGroup.");const n="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchOutboundResourceGroup:async(t,r,i,a,n,s,o={})=>{const u=parse("/call_center/resource_group",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},searchOutboundResourceInGroup:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling searchOutboundResourceInGroup.");const c="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.q=a),void 0!==n&&(y.sort=n),s&&(y.fields=s),o&&(y.id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},updateOutboundResourceGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResourceGroup.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateOutboundResourceGroup.");const a="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},updateOutboundResourceInGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("groupId","Required parameter groupId was null or undefined when calling updateOutboundResourceInGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResourceInGroup.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateOutboundResourceInGroup.");const n="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},OutboundResourceGroupServiceApiFp=function(e){return{async createOutboundResourceGroup(t,r){const i=await OutboundResourceGroupServiceApiAxiosParamCreator(e).createOutboundResourceGroup(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createOutboundResourceInGroup(t,r,i){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).createOutboundResourceInGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteOutboundResourceGroup(t,r,i){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).deleteOutboundResourceGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteOutboundResourceInGroup(t,r,i,a){const n=await OutboundResourceGroupServiceApiAxiosParamCreator(e).deleteOutboundResourceInGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readOutboundResourceGroup(t,r,i){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).readOutboundResourceGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readOutboundResourceInGroup(t,r,i,a){const n=await OutboundResourceGroupServiceApiAxiosParamCreator(e).readOutboundResourceInGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchOutboundResourceGroup(t,r,i,a,n,s,o){const u=await OutboundResourceGroupServiceApiAxiosParamCreator(e).searchOutboundResourceGroup(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async searchOutboundResourceInGroup(t,r,i,a,n,s,o,u){const c=await OutboundResourceGroupServiceApiAxiosParamCreator(e).searchOutboundResourceInGroup(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async updateOutboundResourceGroup(t,r,i){const a=await OutboundResourceGroupServiceApiAxiosParamCreator(e).updateOutboundResourceGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async updateOutboundResourceInGroup(t,r,i,a){const n=await OutboundResourceGroupServiceApiAxiosParamCreator(e).updateOutboundResourceInGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},OutboundResourceGroupServiceApiFactory=function(e,t,r){return{createOutboundResourceGroup:(i,a)=>OutboundResourceGroupServiceApiFp(e).createOutboundResourceGroup(i,a).then(e=>e(r,t)),createOutboundResourceInGroup:(i,a,n)=>OutboundResourceGroupServiceApiFp(e).createOutboundResourceInGroup(i,a,n).then(e=>e(r,t)),deleteOutboundResourceGroup:(i,a,n)=>OutboundResourceGroupServiceApiFp(e).deleteOutboundResourceGroup(i,a,n).then(e=>e(r,t)),deleteOutboundResourceInGroup:(i,a,n,s)=>OutboundResourceGroupServiceApiFp(e).deleteOutboundResourceInGroup(i,a,n,s).then(e=>e(r,t)),readOutboundResourceGroup:(i,a,n)=>OutboundResourceGroupServiceApiFp(e).readOutboundResourceGroup(i,a,n).then(e=>e(r,t)),readOutboundResourceInGroup:(i,a,n,s)=>OutboundResourceGroupServiceApiFp(e).readOutboundResourceInGroup(i,a,n,s).then(e=>e(r,t)),searchOutboundResourceGroup:(i,a,n,s,o,u,c)=>OutboundResourceGroupServiceApiFp(e).searchOutboundResourceGroup(i,a,n,s,o,u,c).then(e=>e(r,t)),searchOutboundResourceInGroup:(i,a,n,s,o,u,c,l)=>OutboundResourceGroupServiceApiFp(e).searchOutboundResourceInGroup(i,a,n,s,o,u,c,l).then(e=>e(r,t)),updateOutboundResourceGroup:(i,a,n)=>OutboundResourceGroupServiceApiFp(e).updateOutboundResourceGroup(i,a,n).then(e=>e(r,t)),updateOutboundResourceInGroup:(i,a,n,s)=>OutboundResourceGroupServiceApiFp(e).updateOutboundResourceInGroup(i,a,n,s).then(e=>e(r,t))}};class OutboundResourceGroupServiceApi extends BaseAPI{createOutboundResourceGroup(e,t){return OutboundResourceGroupServiceApiFp(this.configuration).createOutboundResourceGroup(e,t).then(e=>e(this.axios,this.basePath))}createOutboundResourceInGroup(e,t,r){return OutboundResourceGroupServiceApiFp(this.configuration).createOutboundResourceInGroup(e,t,r).then(e=>e(this.axios,this.basePath))}deleteOutboundResourceGroup(e,t,r){return OutboundResourceGroupServiceApiFp(this.configuration).deleteOutboundResourceGroup(e,t,r).then(e=>e(this.axios,this.basePath))}deleteOutboundResourceInGroup(e,t,r,i){return OutboundResourceGroupServiceApiFp(this.configuration).deleteOutboundResourceInGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}readOutboundResourceGroup(e,t,r){return OutboundResourceGroupServiceApiFp(this.configuration).readOutboundResourceGroup(e,t,r).then(e=>e(this.axios,this.basePath))}readOutboundResourceInGroup(e,t,r,i){return OutboundResourceGroupServiceApiFp(this.configuration).readOutboundResourceInGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchOutboundResourceGroup(e,t,r,i,a,n,s){return OutboundResourceGroupServiceApiFp(this.configuration).searchOutboundResourceGroup(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}searchOutboundResourceInGroup(e,t,r,i,a,n,s,o){return OutboundResourceGroupServiceApiFp(this.configuration).searchOutboundResourceInGroup(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateOutboundResourceGroup(e,t,r){return OutboundResourceGroupServiceApiFp(this.configuration).updateOutboundResourceGroup(e,t,r).then(e=>e(this.axios,this.basePath))}updateOutboundResourceInGroup(e,t,r,i){return OutboundResourceGroupServiceApiFp(this.configuration).updateOutboundResourceInGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const OutboundResourceServiceApiAxiosParamCreator=function(e){return{createOutboundResource:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createOutboundResource.");const i=parse("/call_center/resources",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},createOutboundResourceDisplay:async(t,r,i={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling createOutboundResourceDisplay.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createOutboundResourceDisplay.");const a="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteOutboundResource:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteOutboundResource.");const a="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},deleteOutboundResourceDisplay:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling deleteOutboundResourceDisplay.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteOutboundResourceDisplay.");const n="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},patchOutboundResource:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchOutboundResource.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchOutboundResource.");const a="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readOutboundResource:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readOutboundResource.");const a="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readOutboundResourceDisplay:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling readOutboundResourceDisplay.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readOutboundResourceDisplay.");const n="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchOutboundResource:async(t,r,i,a,n,s,o={})=>{const u=parse("/call_center/resources",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},searchOutboundResourceDisplay:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling searchOutboundResourceDisplay.");const c="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.q=a),void 0!==n&&(y.sort=n),s&&(y.fields=s),o&&(y.id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},updateOutboundResource:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResource.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateOutboundResource.");const a="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},updateOutboundResourceDisplay:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("resourceId","Required parameter resourceId was null or undefined when calling updateOutboundResourceDisplay.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateOutboundResourceDisplay.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateOutboundResourceDisplay.");const n="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},OutboundResourceServiceApiFp=function(e){return{async createOutboundResource(t,r){const i=await OutboundResourceServiceApiAxiosParamCreator(e).createOutboundResource(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createOutboundResourceDisplay(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).createOutboundResourceDisplay(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteOutboundResource(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).deleteOutboundResource(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteOutboundResourceDisplay(t,r,i,a){const n=await OutboundResourceServiceApiAxiosParamCreator(e).deleteOutboundResourceDisplay(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async patchOutboundResource(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).patchOutboundResource(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readOutboundResource(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).readOutboundResource(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readOutboundResourceDisplay(t,r,i,a){const n=await OutboundResourceServiceApiAxiosParamCreator(e).readOutboundResourceDisplay(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchOutboundResource(t,r,i,a,n,s,o){const u=await OutboundResourceServiceApiAxiosParamCreator(e).searchOutboundResource(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async searchOutboundResourceDisplay(t,r,i,a,n,s,o,u){const c=await OutboundResourceServiceApiAxiosParamCreator(e).searchOutboundResourceDisplay(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async updateOutboundResource(t,r,i){const a=await OutboundResourceServiceApiAxiosParamCreator(e).updateOutboundResource(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async updateOutboundResourceDisplay(t,r,i,a){const n=await OutboundResourceServiceApiAxiosParamCreator(e).updateOutboundResourceDisplay(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},OutboundResourceServiceApiFactory=function(e,t,r){return{createOutboundResource:(i,a)=>OutboundResourceServiceApiFp(e).createOutboundResource(i,a).then(e=>e(r,t)),createOutboundResourceDisplay:(i,a,n)=>OutboundResourceServiceApiFp(e).createOutboundResourceDisplay(i,a,n).then(e=>e(r,t)),deleteOutboundResource:(i,a,n)=>OutboundResourceServiceApiFp(e).deleteOutboundResource(i,a,n).then(e=>e(r,t)),deleteOutboundResourceDisplay:(i,a,n,s)=>OutboundResourceServiceApiFp(e).deleteOutboundResourceDisplay(i,a,n,s).then(e=>e(r,t)),patchOutboundResource:(i,a,n)=>OutboundResourceServiceApiFp(e).patchOutboundResource(i,a,n).then(e=>e(r,t)),readOutboundResource:(i,a,n)=>OutboundResourceServiceApiFp(e).readOutboundResource(i,a,n).then(e=>e(r,t)),readOutboundResourceDisplay:(i,a,n,s)=>OutboundResourceServiceApiFp(e).readOutboundResourceDisplay(i,a,n,s).then(e=>e(r,t)),searchOutboundResource:(i,a,n,s,o,u,c)=>OutboundResourceServiceApiFp(e).searchOutboundResource(i,a,n,s,o,u,c).then(e=>e(r,t)),searchOutboundResourceDisplay:(i,a,n,s,o,u,c,l)=>OutboundResourceServiceApiFp(e).searchOutboundResourceDisplay(i,a,n,s,o,u,c,l).then(e=>e(r,t)),updateOutboundResource:(i,a,n)=>OutboundResourceServiceApiFp(e).updateOutboundResource(i,a,n).then(e=>e(r,t)),updateOutboundResourceDisplay:(i,a,n,s)=>OutboundResourceServiceApiFp(e).updateOutboundResourceDisplay(i,a,n,s).then(e=>e(r,t))}};class OutboundResourceServiceApi extends BaseAPI{createOutboundResource(e,t){return OutboundResourceServiceApiFp(this.configuration).createOutboundResource(e,t).then(e=>e(this.axios,this.basePath))}createOutboundResourceDisplay(e,t,r){return OutboundResourceServiceApiFp(this.configuration).createOutboundResourceDisplay(e,t,r).then(e=>e(this.axios,this.basePath))}deleteOutboundResource(e,t,r){return OutboundResourceServiceApiFp(this.configuration).deleteOutboundResource(e,t,r).then(e=>e(this.axios,this.basePath))}deleteOutboundResourceDisplay(e,t,r,i){return OutboundResourceServiceApiFp(this.configuration).deleteOutboundResourceDisplay(e,t,r,i).then(e=>e(this.axios,this.basePath))}patchOutboundResource(e,t,r){return OutboundResourceServiceApiFp(this.configuration).patchOutboundResource(e,t,r).then(e=>e(this.axios,this.basePath))}readOutboundResource(e,t,r){return OutboundResourceServiceApiFp(this.configuration).readOutboundResource(e,t,r).then(e=>e(this.axios,this.basePath))}readOutboundResourceDisplay(e,t,r,i){return OutboundResourceServiceApiFp(this.configuration).readOutboundResourceDisplay(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchOutboundResource(e,t,r,i,a,n,s){return OutboundResourceServiceApiFp(this.configuration).searchOutboundResource(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}searchOutboundResourceDisplay(e,t,r,i,a,n,s,o){return OutboundResourceServiceApiFp(this.configuration).searchOutboundResourceDisplay(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateOutboundResource(e,t,r){return OutboundResourceServiceApiFp(this.configuration).updateOutboundResource(e,t,r).then(e=>e(this.axios,this.basePath))}updateOutboundResourceDisplay(e,t,r,i){return OutboundResourceServiceApiFp(this.configuration).updateOutboundResourceDisplay(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const QueueBucketServiceApiAxiosParamCreator=function(e){return{createQueueBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueBucket.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createQueueBucket.");const a="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteQueueBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueBucket.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteQueueBucket.");const a="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},patchQueueBucket:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchQueueBucket.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueueBucket.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling patchQueueBucket.");const n="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},readQueueBucket:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueBucket.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readQueueBucket.");const a="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},searchQueueBucket:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchQueueBucket.");const c="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.q=a),void 0!==n&&(y.sort=n),s&&(y.fields=s),o&&(y.id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},updateQueueBucket:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueBucket.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueBucket.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateQueueBucket.");const n="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},QueueBucketServiceApiFp=function(e){return{async createQueueBucket(t,r,i){const a=await QueueBucketServiceApiAxiosParamCreator(e).createQueueBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteQueueBucket(t,r,i){const a=await QueueBucketServiceApiAxiosParamCreator(e).deleteQueueBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchQueueBucket(t,r,i,a){const n=await QueueBucketServiceApiAxiosParamCreator(e).patchQueueBucket(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readQueueBucket(t,r,i){const a=await QueueBucketServiceApiAxiosParamCreator(e).readQueueBucket(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchQueueBucket(t,r,i,a,n,s,o,u){const c=await QueueBucketServiceApiAxiosParamCreator(e).searchQueueBucket(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async updateQueueBucket(t,r,i,a){const n=await QueueBucketServiceApiAxiosParamCreator(e).updateQueueBucket(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},QueueBucketServiceApiFactory=function(e,t,r){return{createQueueBucket:(i,a,n)=>QueueBucketServiceApiFp(e).createQueueBucket(i,a,n).then(e=>e(r,t)),deleteQueueBucket:(i,a,n)=>QueueBucketServiceApiFp(e).deleteQueueBucket(i,a,n).then(e=>e(r,t)),patchQueueBucket:(i,a,n,s)=>QueueBucketServiceApiFp(e).patchQueueBucket(i,a,n,s).then(e=>e(r,t)),readQueueBucket:(i,a,n)=>QueueBucketServiceApiFp(e).readQueueBucket(i,a,n).then(e=>e(r,t)),searchQueueBucket:(i,a,n,s,o,u,c,l)=>QueueBucketServiceApiFp(e).searchQueueBucket(i,a,n,s,o,u,c,l).then(e=>e(r,t)),updateQueueBucket:(i,a,n,s)=>QueueBucketServiceApiFp(e).updateQueueBucket(i,a,n,s).then(e=>e(r,t))}};class QueueBucketServiceApi extends BaseAPI{createQueueBucket(e,t,r){return QueueBucketServiceApiFp(this.configuration).createQueueBucket(e,t,r).then(e=>e(this.axios,this.basePath))}deleteQueueBucket(e,t,r){return QueueBucketServiceApiFp(this.configuration).deleteQueueBucket(e,t,r).then(e=>e(this.axios,this.basePath))}patchQueueBucket(e,t,r,i){return QueueBucketServiceApiFp(this.configuration).patchQueueBucket(e,t,r,i).then(e=>e(this.axios,this.basePath))}readQueueBucket(e,t,r){return QueueBucketServiceApiFp(this.configuration).readQueueBucket(e,t,r).then(e=>e(this.axios,this.basePath))}searchQueueBucket(e,t,r,i,a,n,s,o){return QueueBucketServiceApiFp(this.configuration).searchQueueBucket(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateQueueBucket(e,t,r,i){return QueueBucketServiceApiFp(this.configuration).updateQueueBucket(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const QueueHookServiceApiAxiosParamCreator=function(e){return{createQueueHook:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueHook.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createQueueHook.");const a="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteQueueHook:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueHook.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteQueueHook.");const a="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},patchQueueHook:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchQueueHook.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueueHook.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling patchQueueHook.");const n="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},readQueueHook:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueHook.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readQueueHook.");const a="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},searchQueueHook:async(t,r,i,a,n,s,o,u,c,l={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchQueueHook.");const d="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(t))),p=parse(d,!0);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...l},g={},A={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==r&&(A.page=r),void 0!==i&&(A.size=i),void 0!==a&&(A.q=a),void 0!==n&&(A.sort=n),s&&(A.fields=s),o&&(A.id=o),u&&(A.schema_id=u),c&&(A.event=c),p.query={...p.query,...A,...l.query},delete p.search;let m=h&&h.headers?h.headers:{};return y.headers={...g,...m,...l.headers},{url:format(p),options:y}},updateQueueHook:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueHook.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueHook.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateQueueHook.");const n="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},QueueHookServiceApiFp=function(e){return{async createQueueHook(t,r,i){const a=await QueueHookServiceApiAxiosParamCreator(e).createQueueHook(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteQueueHook(t,r,i){const a=await QueueHookServiceApiAxiosParamCreator(e).deleteQueueHook(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchQueueHook(t,r,i,a){const n=await QueueHookServiceApiAxiosParamCreator(e).patchQueueHook(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readQueueHook(t,r,i){const a=await QueueHookServiceApiAxiosParamCreator(e).readQueueHook(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchQueueHook(t,r,i,a,n,s,o,u,c,l){const d=await QueueHookServiceApiAxiosParamCreator(e).searchQueueHook(t,r,i,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async updateQueueHook(t,r,i,a){const n=await QueueHookServiceApiAxiosParamCreator(e).updateQueueHook(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},QueueHookServiceApiFactory=function(e,t,r){return{createQueueHook:(i,a,n)=>QueueHookServiceApiFp(e).createQueueHook(i,a,n).then(e=>e(r,t)),deleteQueueHook:(i,a,n)=>QueueHookServiceApiFp(e).deleteQueueHook(i,a,n).then(e=>e(r,t)),patchQueueHook:(i,a,n,s)=>QueueHookServiceApiFp(e).patchQueueHook(i,a,n,s).then(e=>e(r,t)),readQueueHook:(i,a,n)=>QueueHookServiceApiFp(e).readQueueHook(i,a,n).then(e=>e(r,t)),searchQueueHook:(i,a,n,s,o,u,c,l,d,p)=>QueueHookServiceApiFp(e).searchQueueHook(i,a,n,s,o,u,c,l,d,p).then(e=>e(r,t)),updateQueueHook:(i,a,n,s)=>QueueHookServiceApiFp(e).updateQueueHook(i,a,n,s).then(e=>e(r,t))}};class QueueHookServiceApi extends BaseAPI{createQueueHook(e,t,r){return QueueHookServiceApiFp(this.configuration).createQueueHook(e,t,r).then(e=>e(this.axios,this.basePath))}deleteQueueHook(e,t,r){return QueueHookServiceApiFp(this.configuration).deleteQueueHook(e,t,r).then(e=>e(this.axios,this.basePath))}patchQueueHook(e,t,r,i){return QueueHookServiceApiFp(this.configuration).patchQueueHook(e,t,r,i).then(e=>e(this.axios,this.basePath))}readQueueHook(e,t,r){return QueueHookServiceApiFp(this.configuration).readQueueHook(e,t,r).then(e=>e(this.axios,this.basePath))}searchQueueHook(e,t,r,i,a,n,s,o,u,c){return QueueHookServiceApiFp(this.configuration).searchQueueHook(e,t,r,i,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}updateQueueHook(e,t,r,i){return QueueHookServiceApiFp(this.configuration).updateQueueHook(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const QueueResourcesServiceApiAxiosParamCreator=function(e){return{createQueueResourceGroup:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueResourceGroup.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createQueueResourceGroup.");const a="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteQueueResourceGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueResourceGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteQueueResourceGroup.");const n="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"DELETE",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},readQueueResourceGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueResourceGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readQueueResourceGroup.");const n="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"GET",...o,...a},c={},l={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}void 0!==i&&(l.domain_id=i),s.query={...s.query,...l,...a.query},delete s.search;let d=o&&o.headers?o.headers:{};return u.headers={...c,...d,...a.headers},{url:format(s),options:u}},searchQueueResourceGroup:async(t,r,i,a,n,s,o,u={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchQueueResourceGroup.");const c="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(t))),l=parse(c,!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...u},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==r&&(y.page=r),void 0!==i&&(y.size=i),void 0!==a&&(y.q=a),void 0!==n&&(y.sort=n),s&&(y.fields=s),o&&(y.id=o),l.query={...l.query,...y,...u.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...u.headers},{url:format(l),options:p}},updateQueueResourceGroup:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueResourceGroup.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueResourceGroup.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateQueueResourceGroup.");const n="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},QueueResourcesServiceApiFp=function(e){return{async createQueueResourceGroup(t,r,i){const a=await QueueResourcesServiceApiAxiosParamCreator(e).createQueueResourceGroup(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteQueueResourceGroup(t,r,i,a){const n=await QueueResourcesServiceApiAxiosParamCreator(e).deleteQueueResourceGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readQueueResourceGroup(t,r,i,a){const n=await QueueResourcesServiceApiAxiosParamCreator(e).readQueueResourceGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async searchQueueResourceGroup(t,r,i,a,n,s,o,u){const c=await QueueResourcesServiceApiAxiosParamCreator(e).searchQueueResourceGroup(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async updateQueueResourceGroup(t,r,i,a){const n=await QueueResourcesServiceApiAxiosParamCreator(e).updateQueueResourceGroup(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},QueueResourcesServiceApiFactory=function(e,t,r){return{createQueueResourceGroup:(i,a,n)=>QueueResourcesServiceApiFp(e).createQueueResourceGroup(i,a,n).then(e=>e(r,t)),deleteQueueResourceGroup:(i,a,n,s)=>QueueResourcesServiceApiFp(e).deleteQueueResourceGroup(i,a,n,s).then(e=>e(r,t)),readQueueResourceGroup:(i,a,n,s)=>QueueResourcesServiceApiFp(e).readQueueResourceGroup(i,a,n,s).then(e=>e(r,t)),searchQueueResourceGroup:(i,a,n,s,o,u,c,l)=>QueueResourcesServiceApiFp(e).searchQueueResourceGroup(i,a,n,s,o,u,c,l).then(e=>e(r,t)),updateQueueResourceGroup:(i,a,n,s)=>QueueResourcesServiceApiFp(e).updateQueueResourceGroup(i,a,n,s).then(e=>e(r,t))}};class QueueResourcesServiceApi extends BaseAPI{createQueueResourceGroup(e,t,r){return QueueResourcesServiceApiFp(this.configuration).createQueueResourceGroup(e,t,r).then(e=>e(this.axios,this.basePath))}deleteQueueResourceGroup(e,t,r,i){return QueueResourcesServiceApiFp(this.configuration).deleteQueueResourceGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}readQueueResourceGroup(e,t,r,i){return QueueResourcesServiceApiFp(this.configuration).readQueueResourceGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}searchQueueResourceGroup(e,t,r,i,a,n,s,o){return QueueResourcesServiceApiFp(this.configuration).searchQueueResourceGroup(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}updateQueueResourceGroup(e,t,r,i){return QueueResourcesServiceApiFp(this.configuration).updateQueueResourceGroup(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const QueueServiceApiAxiosParamCreator=function(e){return{createQueue:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createQueue.");const i=parse("/call_center/queues",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteQueue:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteQueue.");const a="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},patchQueue:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueue.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchQueue.");const a="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readQueue:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readQueue.");const a="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchQueue:async(t,r,i,a,n,s,o,u={})=>{const c=parse("/call_center/queues",!0);let l;e&&(l=e.baseOptions);const d={method:"GET",...l,...u},p={},h={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;p["X-Webitel-Access"]=t}void 0!==t&&(h.page=t),void 0!==r&&(h.size=r),void 0!==i&&(h.q=i),void 0!==a&&(h.sort=a),n&&(h.fields=n),s&&(h.id=s),o&&(h.type=o),c.query={...c.query,...h,...u.query},delete c.search;let y=l&&l.headers?l.headers:{};return d.headers={...p,...y,...u.headers},{url:format(c),options:d}},searchQueueReportGeneral:async(t,r,i,a,n,s,o,u,c,l,d,p={})=>{const h=parse("/call_center/queues/reports/general",!0);let y;e&&(y=e.baseOptions);const g={method:"GET",...y,...p},A={},m={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;A["X-Webitel-Access"]=t}void 0!==t&&(m.page=t),void 0!==r&&(m.size=r),void 0!==i&&(m["joined_at.from"]=i),void 0!==a&&(m["joined_at.to"]=a),void 0!==n&&(m.domain_id=n),s&&(m.fields=s),void 0!==o&&(m.sort=o),void 0!==u&&(m.q=u),c&&(m.queue_id=c),l&&(m.team_id=l),d&&(m.type=d),h.query={...h.query,...m,...p.query},delete h.search;let f=y&&y.headers?y.headers:{};return g.headers={...A,...f,...p.headers},{url:format(h),options:g}},updateQueue:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueue.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateQueue.");const a="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},QueueServiceApiFp=function(e){return{async createQueue(t,r){const i=await QueueServiceApiAxiosParamCreator(e).createQueue(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteQueue(t,r,i){const a=await QueueServiceApiAxiosParamCreator(e).deleteQueue(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchQueue(t,r,i){const a=await QueueServiceApiAxiosParamCreator(e).patchQueue(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readQueue(t,r,i){const a=await QueueServiceApiAxiosParamCreator(e).readQueue(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchQueue(t,r,i,a,n,s,o,u){const c=await QueueServiceApiAxiosParamCreator(e).searchQueue(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async searchQueueReportGeneral(t,r,i,a,n,s,o,u,c,l,d,p){const h=await QueueServiceApiAxiosParamCreator(e).searchQueueReportGeneral(t,r,i,a,n,s,o,u,c,l,d,p);return(e=globalAxios,t=BASE_PATH)=>{const r={...h.options,url:t+h.url};return e.request(r)}},async updateQueue(t,r,i){const a=await QueueServiceApiAxiosParamCreator(e).updateQueue(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},QueueServiceApiFactory=function(e,t,r){return{createQueue:(i,a)=>QueueServiceApiFp(e).createQueue(i,a).then(e=>e(r,t)),deleteQueue:(i,a,n)=>QueueServiceApiFp(e).deleteQueue(i,a,n).then(e=>e(r,t)),patchQueue:(i,a,n)=>QueueServiceApiFp(e).patchQueue(i,a,n).then(e=>e(r,t)),readQueue:(i,a,n)=>QueueServiceApiFp(e).readQueue(i,a,n).then(e=>e(r,t)),searchQueue:(i,a,n,s,o,u,c,l)=>QueueServiceApiFp(e).searchQueue(i,a,n,s,o,u,c,l).then(e=>e(r,t)),searchQueueReportGeneral:(i,a,n,s,o,u,c,l,d,p,h,y)=>QueueServiceApiFp(e).searchQueueReportGeneral(i,a,n,s,o,u,c,l,d,p,h,y).then(e=>e(r,t)),updateQueue:(i,a,n)=>QueueServiceApiFp(e).updateQueue(i,a,n).then(e=>e(r,t))}};class QueueServiceApi extends BaseAPI{createQueue(e,t){return QueueServiceApiFp(this.configuration).createQueue(e,t).then(e=>e(this.axios,this.basePath))}deleteQueue(e,t,r){return QueueServiceApiFp(this.configuration).deleteQueue(e,t,r).then(e=>e(this.axios,this.basePath))}patchQueue(e,t,r){return QueueServiceApiFp(this.configuration).patchQueue(e,t,r).then(e=>e(this.axios,this.basePath))}readQueue(e,t,r){return QueueServiceApiFp(this.configuration).readQueue(e,t,r).then(e=>e(this.axios,this.basePath))}searchQueue(e,t,r,i,a,n,s,o){return QueueServiceApiFp(this.configuration).searchQueue(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}searchQueueReportGeneral(e,t,r,i,a,n,s,o,u,c,l,d){return QueueServiceApiFp(this.configuration).searchQueueReportGeneral(e,t,r,i,a,n,s,o,u,c,l,d).then(e=>e(this.axios,this.basePath))}updateQueue(e,t,r){return QueueServiceApiFp(this.configuration).updateQueue(e,t,r).then(e=>e(this.axios,this.basePath))}}const QueueSkillServiceApiAxiosParamCreator=function(e){return{createQueueSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling createQueueSkill.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createQueueSkill.");const a="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteQueueSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling deleteQueueSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteQueueSkill.");const a="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},patchQueueSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling patchQueueSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling patchQueueSkill.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling patchQueueSkill.");const n="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},readQueueSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling readQueueSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling readQueueSkill.");const a="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};return o.headers={...u,...c,...i.headers},{url:format(n),options:o}},searchQueueSkill:async(t,r,i,a,n,s,o,u,c,l,d,p,h,y={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling searchQueueSkill.");const g="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(t))),A=parse(g,!0);let m;e&&(m=e.baseOptions);const f={method:"GET",...m,...y},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!==r&&(S.page=r),void 0!==i&&(S.size=i),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),A.query={...A.query,...S,...y.query},delete A.search;let w=m&&m.headers?m.headers:{};return f.headers={...b,...w,...y.headers},{url:format(A),options:f}},updateQueueSkill:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("queueId","Required parameter queueId was null or undefined when calling updateQueueSkill.");if(null==r)throw new RequiredError("id","Required parameter id was null or undefined when calling updateQueueSkill.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling updateQueueSkill.");const n="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PUT",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}}}},QueueSkillServiceApiFp=function(e){return{async createQueueSkill(t,r,i){const a=await QueueSkillServiceApiAxiosParamCreator(e).createQueueSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteQueueSkill(t,r,i){const a=await QueueSkillServiceApiAxiosParamCreator(e).deleteQueueSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchQueueSkill(t,r,i,a){const n=await QueueSkillServiceApiAxiosParamCreator(e).patchQueueSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async readQueueSkill(t,r,i){const a=await QueueSkillServiceApiAxiosParamCreator(e).readQueueSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchQueueSkill(t,r,i,a,n,s,o,u,c,l,d,p,h,y){const g=await QueueSkillServiceApiAxiosParamCreator(e).searchQueueSkill(t,r,i,a,n,s,o,u,c,l,d,p,h,y);return(e=globalAxios,t=BASE_PATH)=>{const r={...g.options,url:t+g.url};return e.request(r)}},async updateQueueSkill(t,r,i,a){const n=await QueueSkillServiceApiAxiosParamCreator(e).updateQueueSkill(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}}}},QueueSkillServiceApiFactory=function(e,t,r){return{createQueueSkill:(i,a,n)=>QueueSkillServiceApiFp(e).createQueueSkill(i,a,n).then(e=>e(r,t)),deleteQueueSkill:(i,a,n)=>QueueSkillServiceApiFp(e).deleteQueueSkill(i,a,n).then(e=>e(r,t)),patchQueueSkill:(i,a,n,s)=>QueueSkillServiceApiFp(e).patchQueueSkill(i,a,n,s).then(e=>e(r,t)),readQueueSkill:(i,a,n)=>QueueSkillServiceApiFp(e).readQueueSkill(i,a,n).then(e=>e(r,t)),searchQueueSkill:(i,a,n,s,o,u,c,l,d,p,h,y,g,A)=>QueueSkillServiceApiFp(e).searchQueueSkill(i,a,n,s,o,u,c,l,d,p,h,y,g,A).then(e=>e(r,t)),updateQueueSkill:(i,a,n,s)=>QueueSkillServiceApiFp(e).updateQueueSkill(i,a,n,s).then(e=>e(r,t))}};class QueueSkillServiceApi extends BaseAPI{createQueueSkill(e,t,r){return QueueSkillServiceApiFp(this.configuration).createQueueSkill(e,t,r).then(e=>e(this.axios,this.basePath))}deleteQueueSkill(e,t,r){return QueueSkillServiceApiFp(this.configuration).deleteQueueSkill(e,t,r).then(e=>e(this.axios,this.basePath))}patchQueueSkill(e,t,r,i){return QueueSkillServiceApiFp(this.configuration).patchQueueSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}readQueueSkill(e,t,r){return QueueSkillServiceApiFp(this.configuration).readQueueSkill(e,t,r).then(e=>e(this.axios,this.basePath))}searchQueueSkill(e,t,r,i,a,n,s,o,u,c,l,d,p,h){return QueueSkillServiceApiFp(this.configuration).searchQueueSkill(e,t,r,i,a,n,s,o,u,c,l,d,p,h).then(e=>e(this.axios,this.basePath))}updateQueueSkill(e,t,r,i){return QueueSkillServiceApiFp(this.configuration).updateQueueSkill(e,t,r,i).then(e=>e(this.axios,this.basePath))}}const RegionServiceApiAxiosParamCreator=function(e){return{createRegion:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRegion.");const i=parse("/regions",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteRegion:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteRegion.");const i="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchRegion:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchRegion.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchRegion.");const a="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readRegion:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readRegion.");const i="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchRegion:async(t,r,i,a,n,s,o,u,c,l={})=>{const d=parse("/regions",!0);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...l},y={},g={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;y["X-Webitel-Access"]=t}void 0!==t&&(g.page=t),void 0!==r&&(g.size=r),void 0!==i&&(g.q=i),void 0!==a&&(g.sort=a),n&&(g.fields=n),s&&(g.id=s),void 0!==o&&(g.name=o),void 0!==u&&(g.description=u),c&&(g.timezone_id=c),d.query={...d.query,...g,...l.query},delete d.search;let A=p&&p.headers?p.headers:{};return h.headers={...y,...A,...l.headers},{url:format(d),options:h}},updateRegion:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRegion.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateRegion.");const a="/regions/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},RegionServiceApiFp=function(e){return{async createRegion(t,r){const i=await RegionServiceApiAxiosParamCreator(e).createRegion(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteRegion(t,r){const i=await RegionServiceApiAxiosParamCreator(e).deleteRegion(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchRegion(t,r,i){const a=await RegionServiceApiAxiosParamCreator(e).patchRegion(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readRegion(t,r){const i=await RegionServiceApiAxiosParamCreator(e).readRegion(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchRegion(t,r,i,a,n,s,o,u,c,l){const d=await RegionServiceApiAxiosParamCreator(e).searchRegion(t,r,i,a,n,s,o,u,c,l);return(e=globalAxios,t=BASE_PATH)=>{const r={...d.options,url:t+d.url};return e.request(r)}},async updateRegion(t,r,i){const a=await RegionServiceApiAxiosParamCreator(e).updateRegion(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RegionServiceApiFactory=function(e,t,r){return{createRegion:(i,a)=>RegionServiceApiFp(e).createRegion(i,a).then(e=>e(r,t)),deleteRegion:(i,a)=>RegionServiceApiFp(e).deleteRegion(i,a).then(e=>e(r,t)),patchRegion:(i,a,n)=>RegionServiceApiFp(e).patchRegion(i,a,n).then(e=>e(r,t)),readRegion:(i,a)=>RegionServiceApiFp(e).readRegion(i,a).then(e=>e(r,t)),searchRegion:(i,a,n,s,o,u,c,l,d,p)=>RegionServiceApiFp(e).searchRegion(i,a,n,s,o,u,c,l,d,p).then(e=>e(r,t)),updateRegion:(i,a,n)=>RegionServiceApiFp(e).updateRegion(i,a,n).then(e=>e(r,t))}};class RegionServiceApi extends BaseAPI{createRegion(e,t){return RegionServiceApiFp(this.configuration).createRegion(e,t).then(e=>e(this.axios,this.basePath))}deleteRegion(e,t){return RegionServiceApiFp(this.configuration).deleteRegion(e,t).then(e=>e(this.axios,this.basePath))}patchRegion(e,t,r){return RegionServiceApiFp(this.configuration).patchRegion(e,t,r).then(e=>e(this.axios,this.basePath))}readRegion(e,t){return RegionServiceApiFp(this.configuration).readRegion(e,t).then(e=>e(this.axios,this.basePath))}searchRegion(e,t,r,i,a,n,s,o,u,c){return RegionServiceApiFp(this.configuration).searchRegion(e,t,r,i,a,n,s,o,u,c).then(e=>e(this.axios,this.basePath))}updateRegion(e,t,r){return RegionServiceApiFp(this.configuration).updateRegion(e,t,r).then(e=>e(this.axios,this.basePath))}}const RoutingChatPlanServiceApiAxiosParamCreator=function(e){return{createChatPlan:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createChatPlan.");const i=parse("/routing/outbound/chat",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteChatPlan:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteChatPlan.");const i="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchChatPlan:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchChatPlan.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchChatPlan.");const a="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readChatPlan:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readChatPlan.");const i="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchChatPlan:async(t,r,i,a,n,s,o,u,c={})=>{const l=parse("/routing/outbound/chat",!0);let d;e&&(d=e.baseOptions);const p={method:"GET",...d,...c},h={},y={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;h["X-Webitel-Access"]=t}void 0!==t&&(y.page=t),void 0!==r&&(y.size=r),void 0!==i&&(y.q=i),void 0!==a&&(y.sort=a),n&&(y.fields=n),s&&(y.id=s),void 0!==o&&(y.name=o),void 0!==u&&(y.enabled=u),l.query={...l.query,...y,...c.query},delete l.search;let g=d&&d.headers?d.headers:{};return p.headers={...h,...g,...c.headers},{url:format(l),options:p}},updateChatPlan:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateChatPlan.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateChatPlan.");const a="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},RoutingChatPlanServiceApiFp=function(e){return{async createChatPlan(t,r){const i=await RoutingChatPlanServiceApiAxiosParamCreator(e).createChatPlan(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteChatPlan(t,r){const i=await RoutingChatPlanServiceApiAxiosParamCreator(e).deleteChatPlan(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchChatPlan(t,r,i){const a=await RoutingChatPlanServiceApiAxiosParamCreator(e).patchChatPlan(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readChatPlan(t,r){const i=await RoutingChatPlanServiceApiAxiosParamCreator(e).readChatPlan(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchChatPlan(t,r,i,a,n,s,o,u,c){const l=await RoutingChatPlanServiceApiAxiosParamCreator(e).searchChatPlan(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async updateChatPlan(t,r,i){const a=await RoutingChatPlanServiceApiAxiosParamCreator(e).updateChatPlan(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RoutingChatPlanServiceApiFactory=function(e,t,r){return{createChatPlan:(i,a)=>RoutingChatPlanServiceApiFp(e).createChatPlan(i,a).then(e=>e(r,t)),deleteChatPlan:(i,a)=>RoutingChatPlanServiceApiFp(e).deleteChatPlan(i,a).then(e=>e(r,t)),patchChatPlan:(i,a,n)=>RoutingChatPlanServiceApiFp(e).patchChatPlan(i,a,n).then(e=>e(r,t)),readChatPlan:(i,a)=>RoutingChatPlanServiceApiFp(e).readChatPlan(i,a).then(e=>e(r,t)),searchChatPlan:(i,a,n,s,o,u,c,l,d)=>RoutingChatPlanServiceApiFp(e).searchChatPlan(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),updateChatPlan:(i,a,n)=>RoutingChatPlanServiceApiFp(e).updateChatPlan(i,a,n).then(e=>e(r,t))}};class RoutingChatPlanServiceApi extends BaseAPI{createChatPlan(e,t){return RoutingChatPlanServiceApiFp(this.configuration).createChatPlan(e,t).then(e=>e(this.axios,this.basePath))}deleteChatPlan(e,t){return RoutingChatPlanServiceApiFp(this.configuration).deleteChatPlan(e,t).then(e=>e(this.axios,this.basePath))}patchChatPlan(e,t,r){return RoutingChatPlanServiceApiFp(this.configuration).patchChatPlan(e,t,r).then(e=>e(this.axios,this.basePath))}readChatPlan(e,t){return RoutingChatPlanServiceApiFp(this.configuration).readChatPlan(e,t).then(e=>e(this.axios,this.basePath))}searchChatPlan(e,t,r,i,a,n,s,o,u){return RoutingChatPlanServiceApiFp(this.configuration).searchChatPlan(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateChatPlan(e,t,r){return RoutingChatPlanServiceApiFp(this.configuration).updateChatPlan(e,t,r).then(e=>e(this.axios,this.basePath))}}const RoutingOutboundCallServiceApiAxiosParamCreator=function(e){return{createRoutingOutboundCall:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRoutingOutboundCall.");const i=parse("/routing/outbound/calls",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteRoutingOutboundCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteRoutingOutboundCall.");const a="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},movePositionRoutingOutboundCall:async(t,r,i,a={})=>{if(null==t)throw new RequiredError("fromId","Required parameter fromId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==r)throw new RequiredError("toId","Required parameter toId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==i)throw new RequiredError("body","Required parameter body was null or undefined when calling movePositionRoutingOutboundCall.");const n="/routing/outbound/calls/{from_id}/to/{to_id}".replace("{from_id}",encodeURIComponent(String(t))).replace("{to_id}",encodeURIComponent(String(r))),s=parse(n,!0);let o;e&&(o=e.baseOptions);const u={method:"PATCH",...o,...a},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;c["X-Webitel-Access"]=t}c["Content-Type"]="application/json",s.query={...s.query,...a.query},delete s.search;let l=o&&o.headers?o.headers:{};u.headers={...c,...l,...a.headers};const d="string"!=typeof i||"application/json"===u.headers["Content-Type"];return u.data=d?JSON.stringify(void 0!==i?i:{}):i||"",{url:format(s),options:u}},patchRoutingOutboundCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchRoutingOutboundCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchRoutingOutboundCall.");const a="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readRoutingOutboundCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readRoutingOutboundCall.");const a="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchRoutingOutboundCall:async(t,r,i,a,n,s,o,u,c,l,d={})=>{const p=parse("/routing/outbound/calls",!0);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...d},g={},A={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==t&&(A.page=t),void 0!==r&&(A.size=r),void 0!==i&&(A.q=i),void 0!==a&&(A.sort=a),n&&(A.fields=n),s&&(A.id=s),void 0!==o&&(A.name=o),u&&(A.schema_id=u),void 0!==c&&(A.pattern=c),void 0!==l&&(A.description=l),p.query={...p.query,...A,...d.query},delete p.search;let m=h&&h.headers?h.headers:{};return y.headers={...g,...m,...d.headers},{url:format(p),options:y}},updateRoutingOutboundCall:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRoutingOutboundCall.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateRoutingOutboundCall.");const a="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},RoutingOutboundCallServiceApiFp=function(e){return{async createRoutingOutboundCall(t,r){const i=await RoutingOutboundCallServiceApiAxiosParamCreator(e).createRoutingOutboundCall(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteRoutingOutboundCall(t,r,i){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).deleteRoutingOutboundCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async movePositionRoutingOutboundCall(t,r,i,a){const n=await RoutingOutboundCallServiceApiAxiosParamCreator(e).movePositionRoutingOutboundCall(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async patchRoutingOutboundCall(t,r,i){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).patchRoutingOutboundCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readRoutingOutboundCall(t,r,i){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).readRoutingOutboundCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchRoutingOutboundCall(t,r,i,a,n,s,o,u,c,l,d){const p=await RoutingOutboundCallServiceApiAxiosParamCreator(e).searchRoutingOutboundCall(t,r,i,a,n,s,o,u,c,l,d);return(e=globalAxios,t=BASE_PATH)=>{const r={...p.options,url:t+p.url};return e.request(r)}},async updateRoutingOutboundCall(t,r,i){const a=await RoutingOutboundCallServiceApiAxiosParamCreator(e).updateRoutingOutboundCall(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RoutingOutboundCallServiceApiFactory=function(e,t,r){return{createRoutingOutboundCall:(i,a)=>RoutingOutboundCallServiceApiFp(e).createRoutingOutboundCall(i,a).then(e=>e(r,t)),deleteRoutingOutboundCall:(i,a,n)=>RoutingOutboundCallServiceApiFp(e).deleteRoutingOutboundCall(i,a,n).then(e=>e(r,t)),movePositionRoutingOutboundCall:(i,a,n,s)=>RoutingOutboundCallServiceApiFp(e).movePositionRoutingOutboundCall(i,a,n,s).then(e=>e(r,t)),patchRoutingOutboundCall:(i,a,n)=>RoutingOutboundCallServiceApiFp(e).patchRoutingOutboundCall(i,a,n).then(e=>e(r,t)),readRoutingOutboundCall:(i,a,n)=>RoutingOutboundCallServiceApiFp(e).readRoutingOutboundCall(i,a,n).then(e=>e(r,t)),searchRoutingOutboundCall:(i,a,n,s,o,u,c,l,d,p,h)=>RoutingOutboundCallServiceApiFp(e).searchRoutingOutboundCall(i,a,n,s,o,u,c,l,d,p,h).then(e=>e(r,t)),updateRoutingOutboundCall:(i,a,n)=>RoutingOutboundCallServiceApiFp(e).updateRoutingOutboundCall(i,a,n).then(e=>e(r,t))}};class RoutingOutboundCallServiceApi extends BaseAPI{createRoutingOutboundCall(e,t){return RoutingOutboundCallServiceApiFp(this.configuration).createRoutingOutboundCall(e,t).then(e=>e(this.axios,this.basePath))}deleteRoutingOutboundCall(e,t,r){return RoutingOutboundCallServiceApiFp(this.configuration).deleteRoutingOutboundCall(e,t,r).then(e=>e(this.axios,this.basePath))}movePositionRoutingOutboundCall(e,t,r,i){return RoutingOutboundCallServiceApiFp(this.configuration).movePositionRoutingOutboundCall(e,t,r,i).then(e=>e(this.axios,this.basePath))}patchRoutingOutboundCall(e,t,r){return RoutingOutboundCallServiceApiFp(this.configuration).patchRoutingOutboundCall(e,t,r).then(e=>e(this.axios,this.basePath))}readRoutingOutboundCall(e,t,r){return RoutingOutboundCallServiceApiFp(this.configuration).readRoutingOutboundCall(e,t,r).then(e=>e(this.axios,this.basePath))}searchRoutingOutboundCall(e,t,r,i,a,n,s,o,u,c,l){return RoutingOutboundCallServiceApiFp(this.configuration).searchRoutingOutboundCall(e,t,r,i,a,n,s,o,u,c,l).then(e=>e(this.axios,this.basePath))}updateRoutingOutboundCall(e,t,r){return RoutingOutboundCallServiceApiFp(this.configuration).updateRoutingOutboundCall(e,t,r).then(e=>e(this.axios,this.basePath))}}const RoutingSchemaServiceApiAxiosParamCreator=function(e){return{createRoutingSchema:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRoutingSchema.");const i=parse("/routing/schema",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteRoutingSchema:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteRoutingSchema.");const a="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},patchRoutingSchema:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchRoutingSchema.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchRoutingSchema.");const a="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readRoutingSchema:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readRoutingSchema.");const a="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchRoutingSchema:async(t,r,i,a,n,s,o,u,c,l,d={})=>{const p=parse("/routing/schema",!0);let h;e&&(h=e.baseOptions);const y={method:"GET",...h,...d},g={},A={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;g["X-Webitel-Access"]=t}void 0!==t&&(A.page=t),void 0!==r&&(A.size=r),void 0!==i&&(A.q=i),void 0!==a&&(A.sort=a),n&&(A.fields=n),s&&(A.id=s),void 0!==o&&(A.name=o),u&&(A.type=u),void 0!==c&&(A.editor=c),l&&(A.tags=l),p.query={...p.query,...A,...d.query},delete p.search;let m=h&&h.headers?h.headers:{};return y.headers={...g,...m,...d.headers},{url:format(p),options:y}},searchRoutingSchemaTags:async(t,r,i,a,n,s,o={})=>{const u=parse("/routing/schema/tags",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.type=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateRoutingSchema:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRoutingSchema.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateRoutingSchema.");const a="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},RoutingSchemaServiceApiFp=function(e){return{async createRoutingSchema(t,r){const i=await RoutingSchemaServiceApiAxiosParamCreator(e).createRoutingSchema(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteRoutingSchema(t,r,i){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).deleteRoutingSchema(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async patchRoutingSchema(t,r,i){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).patchRoutingSchema(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readRoutingSchema(t,r,i){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).readRoutingSchema(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchRoutingSchema(t,r,i,a,n,s,o,u,c,l,d){const p=await RoutingSchemaServiceApiAxiosParamCreator(e).searchRoutingSchema(t,r,i,a,n,s,o,u,c,l,d);return(e=globalAxios,t=BASE_PATH)=>{const r={...p.options,url:t+p.url};return e.request(r)}},async searchRoutingSchemaTags(t,r,i,a,n,s,o){const u=await RoutingSchemaServiceApiAxiosParamCreator(e).searchRoutingSchemaTags(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateRoutingSchema(t,r,i){const a=await RoutingSchemaServiceApiAxiosParamCreator(e).updateRoutingSchema(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RoutingSchemaServiceApiFactory=function(e,t,r){return{createRoutingSchema:(i,a)=>RoutingSchemaServiceApiFp(e).createRoutingSchema(i,a).then(e=>e(r,t)),deleteRoutingSchema:(i,a,n)=>RoutingSchemaServiceApiFp(e).deleteRoutingSchema(i,a,n).then(e=>e(r,t)),patchRoutingSchema:(i,a,n)=>RoutingSchemaServiceApiFp(e).patchRoutingSchema(i,a,n).then(e=>e(r,t)),readRoutingSchema:(i,a,n)=>RoutingSchemaServiceApiFp(e).readRoutingSchema(i,a,n).then(e=>e(r,t)),searchRoutingSchema:(i,a,n,s,o,u,c,l,d,p,h)=>RoutingSchemaServiceApiFp(e).searchRoutingSchema(i,a,n,s,o,u,c,l,d,p,h).then(e=>e(r,t)),searchRoutingSchemaTags:(i,a,n,s,o,u,c)=>RoutingSchemaServiceApiFp(e).searchRoutingSchemaTags(i,a,n,s,o,u,c).then(e=>e(r,t)),updateRoutingSchema:(i,a,n)=>RoutingSchemaServiceApiFp(e).updateRoutingSchema(i,a,n).then(e=>e(r,t))}};class RoutingSchemaServiceApi extends BaseAPI{createRoutingSchema(e,t){return RoutingSchemaServiceApiFp(this.configuration).createRoutingSchema(e,t).then(e=>e(this.axios,this.basePath))}deleteRoutingSchema(e,t,r){return RoutingSchemaServiceApiFp(this.configuration).deleteRoutingSchema(e,t,r).then(e=>e(this.axios,this.basePath))}patchRoutingSchema(e,t,r){return RoutingSchemaServiceApiFp(this.configuration).patchRoutingSchema(e,t,r).then(e=>e(this.axios,this.basePath))}readRoutingSchema(e,t,r){return RoutingSchemaServiceApiFp(this.configuration).readRoutingSchema(e,t,r).then(e=>e(this.axios,this.basePath))}searchRoutingSchema(e,t,r,i,a,n,s,o,u,c,l){return RoutingSchemaServiceApiFp(this.configuration).searchRoutingSchema(e,t,r,i,a,n,s,o,u,c,l).then(e=>e(this.axios,this.basePath))}searchRoutingSchemaTags(e,t,r,i,a,n,s){return RoutingSchemaServiceApiFp(this.configuration).searchRoutingSchemaTags(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateRoutingSchema(e,t,r){return RoutingSchemaServiceApiFp(this.configuration).updateRoutingSchema(e,t,r).then(e=>e(this.axios,this.basePath))}}const RoutingVariableServiceApiAxiosParamCreator=function(e){return{createRoutingVariable:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createRoutingVariable.");const i=parse("/routing/variables",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteRoutingVariable:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteRoutingVariable.");const a="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readRoutingVariable:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readRoutingVariable.");const a="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchRoutingVariable:async(t,r,i,a={})=>{const n=parse("/routing/variables",!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...a},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==t&&(c.page=t),void 0!==r&&(c.size=r),void 0!==i&&(c.domain_id=i),n.query={...n.query,...c,...a.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...a.headers},{url:format(n),options:o}},updateRoutingVariable:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateRoutingVariable.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateRoutingVariable.");const a="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},RoutingVariableServiceApiFp=function(e){return{async createRoutingVariable(t,r){const i=await RoutingVariableServiceApiAxiosParamCreator(e).createRoutingVariable(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteRoutingVariable(t,r,i){const a=await RoutingVariableServiceApiAxiosParamCreator(e).deleteRoutingVariable(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readRoutingVariable(t,r,i){const a=await RoutingVariableServiceApiAxiosParamCreator(e).readRoutingVariable(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchRoutingVariable(t,r,i,a){const n=await RoutingVariableServiceApiAxiosParamCreator(e).searchRoutingVariable(t,r,i,a);return(e=globalAxios,t=BASE_PATH)=>{const r={...n.options,url:t+n.url};return e.request(r)}},async updateRoutingVariable(t,r,i){const a=await RoutingVariableServiceApiAxiosParamCreator(e).updateRoutingVariable(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},RoutingVariableServiceApiFactory=function(e,t,r){return{createRoutingVariable:(i,a)=>RoutingVariableServiceApiFp(e).createRoutingVariable(i,a).then(e=>e(r,t)),deleteRoutingVariable:(i,a,n)=>RoutingVariableServiceApiFp(e).deleteRoutingVariable(i,a,n).then(e=>e(r,t)),readRoutingVariable:(i,a,n)=>RoutingVariableServiceApiFp(e).readRoutingVariable(i,a,n).then(e=>e(r,t)),searchRoutingVariable:(i,a,n,s)=>RoutingVariableServiceApiFp(e).searchRoutingVariable(i,a,n,s).then(e=>e(r,t)),updateRoutingVariable:(i,a,n)=>RoutingVariableServiceApiFp(e).updateRoutingVariable(i,a,n).then(e=>e(r,t))}};class RoutingVariableServiceApi extends BaseAPI{createRoutingVariable(e,t){return RoutingVariableServiceApiFp(this.configuration).createRoutingVariable(e,t).then(e=>e(this.axios,this.basePath))}deleteRoutingVariable(e,t,r){return RoutingVariableServiceApiFp(this.configuration).deleteRoutingVariable(e,t,r).then(e=>e(this.axios,this.basePath))}readRoutingVariable(e,t,r){return RoutingVariableServiceApiFp(this.configuration).readRoutingVariable(e,t,r).then(e=>e(this.axios,this.basePath))}searchRoutingVariable(e,t,r,i){return RoutingVariableServiceApiFp(this.configuration).searchRoutingVariable(e,t,r,i).then(e=>e(this.axios,this.basePath))}updateRoutingVariable(e,t,r){return RoutingVariableServiceApiFp(this.configuration).updateRoutingVariable(e,t,r).then(e=>e(this.axios,this.basePath))}}const SkillServiceApiAxiosParamCreator=function(e){return{createSkill:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createSkill.");const i=parse("/call_center/skills",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},deleteSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteSkill.");const a="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},readSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readSkill.");const a="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...i},u={},c={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}void 0!==r&&(c.domain_id=r),n.query={...n.query,...c,...i.query},delete n.search;let l=s&&s.headers?s.headers:{};return o.headers={...u,...l,...i.headers},{url:format(n),options:o}},searchSkill:async(t,r,i,a,n,s,o={})=>{const u=parse("/call_center/skills",!0);let c;e&&(c=e.baseOptions);const l={method:"GET",...c,...o},d={},p={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;d["X-Webitel-Access"]=t}void 0!==t&&(p.page=t),void 0!==r&&(p.size=r),void 0!==i&&(p.q=i),void 0!==a&&(p.sort=a),n&&(p.fields=n),s&&(p.id=s),u.query={...u.query,...p,...o.query},delete u.search;let h=c&&c.headers?c.headers:{};return l.headers={...d,...h,...o.headers},{url:format(u),options:l}},updateSkill:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateSkill.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateSkill.");const a="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},SkillServiceApiFp=function(e){return{async createSkill(t,r){const i=await SkillServiceApiAxiosParamCreator(e).createSkill(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async deleteSkill(t,r,i){const a=await SkillServiceApiAxiosParamCreator(e).deleteSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readSkill(t,r,i){const a=await SkillServiceApiAxiosParamCreator(e).readSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async searchSkill(t,r,i,a,n,s,o){const u=await SkillServiceApiAxiosParamCreator(e).searchSkill(t,r,i,a,n,s,o);return(e=globalAxios,t=BASE_PATH)=>{const r={...u.options,url:t+u.url};return e.request(r)}},async updateSkill(t,r,i){const a=await SkillServiceApiAxiosParamCreator(e).updateSkill(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},SkillServiceApiFactory=function(e,t,r){return{createSkill:(i,a)=>SkillServiceApiFp(e).createSkill(i,a).then(e=>e(r,t)),deleteSkill:(i,a,n)=>SkillServiceApiFp(e).deleteSkill(i,a,n).then(e=>e(r,t)),readSkill:(i,a,n)=>SkillServiceApiFp(e).readSkill(i,a,n).then(e=>e(r,t)),searchSkill:(i,a,n,s,o,u,c)=>SkillServiceApiFp(e).searchSkill(i,a,n,s,o,u,c).then(e=>e(r,t)),updateSkill:(i,a,n)=>SkillServiceApiFp(e).updateSkill(i,a,n).then(e=>e(r,t))}};class SkillServiceApi extends BaseAPI{createSkill(e,t){return SkillServiceApiFp(this.configuration).createSkill(e,t).then(e=>e(this.axios,this.basePath))}deleteSkill(e,t,r){return SkillServiceApiFp(this.configuration).deleteSkill(e,t,r).then(e=>e(this.axios,this.basePath))}readSkill(e,t,r){return SkillServiceApiFp(this.configuration).readSkill(e,t,r).then(e=>e(this.axios,this.basePath))}searchSkill(e,t,r,i,a,n,s){return SkillServiceApiFp(this.configuration).searchSkill(e,t,r,i,a,n,s).then(e=>e(this.axios,this.basePath))}updateSkill(e,t,r){return SkillServiceApiFp(this.configuration).updateSkill(e,t,r).then(e=>e(this.axios,this.basePath))}}const TriggerServiceApiAxiosParamCreator=function(e){return{createTrigger:async(t,r={})=>{if(null==t)throw new RequiredError("body","Required parameter body was null or undefined when calling createTrigger.");const i=parse("/trigger",!0);let a;e&&(a=e.baseOptions);const n={method:"POST",...a,...r},s={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;s["X-Webitel-Access"]=t}s["Content-Type"]="application/json",i.query={...i.query,...r.query},delete i.search;let o=a&&a.headers?a.headers:{};n.headers={...s,...o,...r.headers};const u="string"!=typeof t||"application/json"===n.headers["Content-Type"];return n.data=u?JSON.stringify(void 0!==t?t:{}):t||"",{url:format(i),options:n}},createTriggerJob:async(t,r,i={})=>{if(null==t)throw new RequiredError("triggerId","Required parameter triggerId was null or undefined when calling createTriggerJob.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling createTriggerJob.");const a="/trigger/{trigger_id}/job".replace("{trigger_id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},deleteTrigger:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling deleteTrigger.");const i="/trigger/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"DELETE",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},patchTrigger:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling patchTrigger.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling patchTrigger.");const a="/trigger/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PATCH",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}},readTrigger:async(t,r={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling readTrigger.");const i="/trigger/{id}".replace("{id}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}},searchTrigger:async(t,r,i,a,n,s,o,u={})=>{const c=parse("/trigger",!0);let l;e&&(l=e.baseOptions);const d={method:"GET",...l,...u},p={},h={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;p["X-Webitel-Access"]=t}void 0!==t&&(h.page=t),void 0!==r&&(h.size=r),void 0!==i&&(h.q=i),void 0!==a&&(h.sort=a),n&&(h.fields=n),s&&(h.id=s),o&&(h.schema_id=o),c.query={...c.query,...h,...u.query},delete c.search;let y=l&&l.headers?l.headers:{};return d.headers={...p,...y,...u.headers},{url:format(c),options:d}},searchTriggerJob:async(t,r,i,a,n,s,o,u,c={})=>{if(null==t)throw new RequiredError("triggerId","Required parameter triggerId was null or undefined when calling searchTriggerJob.");const l="/trigger/{trigger_id}/job".replace("{trigger_id}",encodeURIComponent(String(t))),d=parse(l,!0);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...c},y={},g={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;y["X-Webitel-Access"]=t}void 0!==r&&(g.page=r),void 0!==i&&(g.size=i),void 0!==a&&(g.q=a),void 0!==n&&(g.sort=n),s&&(g.fields=s),void 0!==o&&(g["created_at.from"]=o),void 0!==u&&(g["created_at.to"]=u),d.query={...d.query,...g,...c.query},delete d.search;let A=p&&p.headers?p.headers:{};return h.headers={...y,...A,...c.headers},{url:format(d),options:h}},updateTrigger:async(t,r,i={})=>{if(null==t)throw new RequiredError("id","Required parameter id was null or undefined when calling updateTrigger.");if(null==r)throw new RequiredError("body","Required parameter body was null or undefined when calling updateTrigger.");const a="/trigger/{id}".replace("{id}",encodeURIComponent(String(t))),n=parse(a,!0);let s;e&&(s=e.baseOptions);const o={method:"PUT",...s,...i},u={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;u["X-Webitel-Access"]=t}u["Content-Type"]="application/json",n.query={...n.query,...i.query},delete n.search;let c=s&&s.headers?s.headers:{};o.headers={...u,...c,...i.headers};const l="string"!=typeof r||"application/json"===o.headers["Content-Type"];return o.data=l?JSON.stringify(void 0!==r?r:{}):r||"",{url:format(n),options:o}}}},TriggerServiceApiFp=function(e){return{async createTrigger(t,r){const i=await TriggerServiceApiAxiosParamCreator(e).createTrigger(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async createTriggerJob(t,r,i){const a=await TriggerServiceApiAxiosParamCreator(e).createTriggerJob(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async deleteTrigger(t,r){const i=await TriggerServiceApiAxiosParamCreator(e).deleteTrigger(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async patchTrigger(t,r,i){const a=await TriggerServiceApiAxiosParamCreator(e).patchTrigger(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}},async readTrigger(t,r){const i=await TriggerServiceApiAxiosParamCreator(e).readTrigger(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}},async searchTrigger(t,r,i,a,n,s,o,u){const c=await TriggerServiceApiAxiosParamCreator(e).searchTrigger(t,r,i,a,n,s,o,u);return(e=globalAxios,t=BASE_PATH)=>{const r={...c.options,url:t+c.url};return e.request(r)}},async searchTriggerJob(t,r,i,a,n,s,o,u,c){const l=await TriggerServiceApiAxiosParamCreator(e).searchTriggerJob(t,r,i,a,n,s,o,u,c);return(e=globalAxios,t=BASE_PATH)=>{const r={...l.options,url:t+l.url};return e.request(r)}},async updateTrigger(t,r,i){const a=await TriggerServiceApiAxiosParamCreator(e).updateTrigger(t,r,i);return(e=globalAxios,t=BASE_PATH)=>{const r={...a.options,url:t+a.url};return e.request(r)}}}},TriggerServiceApiFactory=function(e,t,r){return{createTrigger:(i,a)=>TriggerServiceApiFp(e).createTrigger(i,a).then(e=>e(r,t)),createTriggerJob:(i,a,n)=>TriggerServiceApiFp(e).createTriggerJob(i,a,n).then(e=>e(r,t)),deleteTrigger:(i,a)=>TriggerServiceApiFp(e).deleteTrigger(i,a).then(e=>e(r,t)),patchTrigger:(i,a,n)=>TriggerServiceApiFp(e).patchTrigger(i,a,n).then(e=>e(r,t)),readTrigger:(i,a)=>TriggerServiceApiFp(e).readTrigger(i,a).then(e=>e(r,t)),searchTrigger:(i,a,n,s,o,u,c,l)=>TriggerServiceApiFp(e).searchTrigger(i,a,n,s,o,u,c,l).then(e=>e(r,t)),searchTriggerJob:(i,a,n,s,o,u,c,l,d)=>TriggerServiceApiFp(e).searchTriggerJob(i,a,n,s,o,u,c,l,d).then(e=>e(r,t)),updateTrigger:(i,a,n)=>TriggerServiceApiFp(e).updateTrigger(i,a,n).then(e=>e(r,t))}};class TriggerServiceApi extends BaseAPI{createTrigger(e,t){return TriggerServiceApiFp(this.configuration).createTrigger(e,t).then(e=>e(this.axios,this.basePath))}createTriggerJob(e,t,r){return TriggerServiceApiFp(this.configuration).createTriggerJob(e,t,r).then(e=>e(this.axios,this.basePath))}deleteTrigger(e,t){return TriggerServiceApiFp(this.configuration).deleteTrigger(e,t).then(e=>e(this.axios,this.basePath))}patchTrigger(e,t,r){return TriggerServiceApiFp(this.configuration).patchTrigger(e,t,r).then(e=>e(this.axios,this.basePath))}readTrigger(e,t){return TriggerServiceApiFp(this.configuration).readTrigger(e,t).then(e=>e(this.axios,this.basePath))}searchTrigger(e,t,r,i,a,n,s,o){return TriggerServiceApiFp(this.configuration).searchTrigger(e,t,r,i,a,n,s,o).then(e=>e(this.axios,this.basePath))}searchTriggerJob(e,t,r,i,a,n,s,o,u){return TriggerServiceApiFp(this.configuration).searchTriggerJob(e,t,r,i,a,n,s,o,u).then(e=>e(this.axios,this.basePath))}updateTrigger(e,t,r){return TriggerServiceApiFp(this.configuration).updateTrigger(e,t,r).then(e=>e(this.axios,this.basePath))}}const UserHelperServiceApiAxiosParamCreator=function(e){return{defaultDeviceConfig:async(t,r={})=>{if(null==t)throw new RequiredError("type","Required parameter type was null or undefined when calling defaultDeviceConfig.");const i="/user/device/config/{type}".replace("{type}",encodeURIComponent(String(t))),a=parse(i,!0);let n;e&&(n=e.baseOptions);const s={method:"GET",...n,...r},o={};if(e&&e.apiKey){const t="function"==typeof e.apiKey?await e.apiKey("X-Webitel-Access"):await e.apiKey;o["X-Webitel-Access"]=t}a.query={...a.query,...r.query},delete a.search;let u=n&&n.headers?n.headers:{};return s.headers={...o,...u,...r.headers},{url:format(a),options:s}}}},UserHelperServiceApiFp=function(e){return{async defaultDeviceConfig(t,r){const i=await UserHelperServiceApiAxiosParamCreator(e).defaultDeviceConfig(t,r);return(e=globalAxios,t=BASE_PATH)=>{const r={...i.options,url:t+i.url};return e.request(r)}}}},UserHelperServiceApiFactory=function(e,t,r){return{defaultDeviceConfig:(i,a)=>UserHelperServiceApiFp(e).defaultDeviceConfig(i,a).then(e=>e(r,t))}};class UserHelperServiceApi extends BaseAPI{defaultDeviceConfig(e,t){return UserHelperServiceApiFp(this.configuration).defaultDeviceConfig(e,t).then(e=>e(this.axios,this.basePath))}}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 EngineBoolFilter,EngineRoutingSchemaType,EngineTriggerJobState,EngineTriggerType,HistoryFileJobHistoryFileJobAction,HistoryFileJobHistoryFileJobState,ProtobufNullValue,StorageImportSourceType,StorageProviderType,StorageServiceType,StorageUploadStatusCode;!function(e){e.Undefined="undefined",e.True="true",e.False="false"}(EngineBoolFilter||(EngineBoolFilter={})),function(e){e.Default="default",e.Voice="voice",e.Chat="chat",e.Processing="processing",e.Service="service"}(EngineRoutingSchemaType||(EngineRoutingSchemaType={})),function(e){e.Idle="idle",e.Active="active",e.Done="done",e.Error="error"}(EngineTriggerJobState||(EngineTriggerJobState={})),function(e){e.DefaultTriggerType="default_trigger_type",e.Cron="cron"}(EngineTriggerType||(EngineTriggerType={})),function(e){e.Undefined="undefined",e.STT="STT",e.Delete="delete"}(HistoryFileJobHistoryFileJobAction||(HistoryFileJobHistoryFileJobAction={})),function(e){e.Idle="idle",e.Active="active",e.Finished="finished",e.Error="error"}(HistoryFileJobHistoryFileJobState||(HistoryFileJobHistoryFileJobState={})),function(e){e.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,r){r.length>0?console[e](t,...r):console[e](t)}}class Session{constructor(e){this.session=e.session,this.callId=e.request.getHeader("X-Webitel-Uuid"),this.incoming="incoming"===e.session.direction,this.instanceId=e.request.getHeader("X-Webitel-Sock-Id")}get id(){return this.session.id}getLocalMedia(){if(this.session.connection){const e=this.session.connection.getLocalStreams();if(e.length)return e}return[]}getPeerMedia(){if(this.session.connection){const e=this.session.connection.getRemoteStreams();if(e.length)return e}return[]}answer(e){return new Promise(()=>{this.session.answer(e)})}}class SipPhone extends EventEmitter{constructor(e,t){super(),this.instanceId=e,this.type="webrtc",this.sessionCache=new Map,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 r=this.sessionCache.get(e),i=await this.callOption(t);return r.answer(i)}return!1}async call(e){const t={};let r=null;if(e.params&&(t.audio=e.params.audio,t.video=e.params.video||!1,t.screen=e.params.screen||!1,t.disableStun=e.params.disableStun||!1),"string"!=typeof e.destination)throw new Error("bad destination type");const i=await this.callOption(t);e.params&&e.params.display&&(r={extraHeaders:[`X-Webitel-Display: ${e.params.display}`]}),await this.ua.call(e.destination,{...i,...r})}async register(e){const t=new WebSocketInterface(e.server),r={realm:e.realm,uri:e.uri,authorization_user:e.authorization_user,ha1:e.ha1,user_agent:SipPhone.userAgent,sockets:[t],session_timers:!0,display_name:e.display_name,register_expires:e.register_expires||90,connection_recovery_min_interval:5,connection_recovery_max_interval:60},i=this.ua=new UA(r);i.on("newRTCSession",e=>{const t=e.session,r=t.id,i=new Session(e);this.storeSession(r,i),t.on("connecting",()=>{this.emit("localStreams",i,t.connection.getLocalStreams())}),t.connection&&t.connection.addEventListener("addstream",e=>{this.emit("peerStreams",i,new Array(e.stream))}),t.on("peerconnection",e=>{e.peerconnection.addEventListener("addstream",async e=>{this.emit("peerStreams",i,new Array(e.stream))})}),t.on("ended",()=>{this.removeSession(r,t.connection)}),t.on("failed",()=>{this.removeSession(r,t.connection)}),t.on("accepted",()=>{i.incoming||this.emit("peerStreams",i,t.connection.getRemoteStreams())}),t.on("confirmed",()=>{}),this.emit("newSession",i)}),i.on("disconnected",e=>{this.emit("unregistered")}),i.on("unregistered",e=>{this.emit("unregistered")}),i.on("registrationFailed",e=>{this.log.error("registrationFailed",e)}),i.on("registered",e=>{this.emit("registered")}),i.start()}async unregister(){this.ua&&(this.ua.terminateSessions(),this.ua.removeAllListeners(),await this.ua.stop(),delete this.ua)}sipSessionByCallId(e){for(const t of this.allSession)if(t.callId===e)return t;return null}sipSessionBySipId(e){for(const t of this.allSession)if(t.id.startsWith(e))return t;return null}removeSession(e,t){if(t){const e=t.getLocalStreams(),r=t.getRemoteStreams();e&&e.forEach(e=>{e.getTracks().forEach(e=>{e.stop()})}),r&&r.forEach(e=>{e.getTracks().forEach(e=>{e.stop()})})}return!!this.sessionCache.has(e)&&(this.sessionCache.delete(e),!0)}storeSession(e,t){if(this.sessionCache.has(e))throw new Error("Session already store");this.sessionCache.set(e,t)}get allSession(){return Array.from(this.sessionCache.values())}getMediaConstraints(e){return e.screen?{video:!1,audio:!1,screen:!0}:{video:e.video||!1,audio:!0}}getSession(e){return this.sessionCache.has(e)?this.sessionCache.get(e):null}hasSession(e){return this.sessionCache.has(e)}async getUserScreen(){return new Promise(async(e,t)=>{try{e(await navigator.mediaDevices.getDisplayMedia())}catch(e){t(e)}})}async getUserCallStream(e){let t;if(!0===e.screen&&(t=await this.getUserScreen()),!1!==e.audio||e.video){const r=await this.getUserMedia(e.audio,e.video);t?r.getTracks().forEach(e=>{t.addTrack(e)}):t=r}if(!t)throw new Error("bad stream request");return t}async getUserMedia(e,t){return new Promise(async(r,i)=>{const a={audio:!(!1===e),video:void 0};return t&&(a.video={width:{min:10,ideal:1280,max:1920},height:{min:10,ideal:720,max:1080},frameRate:{ideal:10,max:15}}),getMediaStream(a).then(r).catch(i)})}}async function getMediaStream(e){return new Promise((t,r)=>{if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)navigator.mediaDevices.getUserMedia(e).then(e=>t(e)).catch(e=>r(e));else{(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)(e,e=>t(e),e=>r(e))}})}SipPhone.userAgent="Webitel-Phone/0.0.1";const getVersion=()=>'"0.1.166"';var JobState,ChannelName,AgentStatus,ChannelState,ChannelType,CallReportingStatus,CallActions,CallDirection,version='"0.1.166"';!function(e){e.Distribute="distribute",e.Offering="offering",e.Bridged="bridged",e.Missed="missed",e.Processing="processing",e.Closed="closed",e.Destroy="destroy"}(JobState||(JobState={})),function(e){e.Call="call",e.Chat="chat",e.Task="task"}(ChannelName||(ChannelName={}));class Task{constructor(e,t,r){this.client=e,this.distribute=r,this.id=t.attempt_id,this.state=JobState.Offering,this.setState(t.status),this.lastStatusChange=t.timestamp,this.createdAt=t.timestamp,this._processing=null,this.offeringAt=0,this.answeredAt=0,this.bridgedAt=0,this.reportedAt=0,this.startProcessingAt=0,this.stopAt=0,this.closedAt=0,this.form=null,this.communication=r.communication,this.history=[r]}get queue(){return{id:this.distribute.queue_id,name:this.distribute.queue_name}}get duration(){return Math.round((Date.now()-this.lastStatusChange)/1e3)}get hasForm(){return this.distribute.has_form||!1}get channel(){return this.distribute.channel}get allowAccept(){return this.channel===ChannelName.Task&&0===this.bridgedAt&&0===this.closedAt}get allowDecline(){return this.allowAccept}get allowClose(){return this.channel===ChannelName.Task&&0===this.closedAt&&this.bridgedAt>0}get memberId(){return this.distribute.member_id}get queueId(){return this.distribute.queue_id}get hasReporting(){return this.distribute.has_reporting}get allowReporting(){return this.hasReporting&&this.bridgedAt>0}get agentChannelId(){return this.distribute.agent_channel_id}setState(e){this.state=e}setAnswered(e){this.answeredAt=e,this.lastStatusChange=Date.now()}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._listOfflineMembers=null,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 r=e;if(!r)throw new Error("bad event");if(t=new Task(this.client,e,r.distribute),this.task.set(t.id,t),t.agentChannelId)switch(t.channel){case ChannelType.Call:const e=this.client.callById(t.agentChannelId);e&&!e.task&&(e.task=t);break;case ChannelType.Chat:const r=this.client.conversationById(t.agentChannelId);r&&!r.task&&(r.task=t)}break;case ChannelState.Offering:const i=e;(t=this.task.get(e.attempt_id))&&(t.setOffering(i),i.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 r=e;if(!r)throw new Error("bad event");return t.setMissed(),this.setChannelStateTimeout(e.channel,e,r.missed.timeout),this.task.delete(e.attempt_id),this.client.reportingChannelTask(t),t}break;case ChannelState.WrapTime:if(e.attempt_id){if(!e)throw new Error("bad event");t=this.task.get(e.attempt_id),this.task.delete(e.attempt_id),this.client.reportingChannelTask(t)}break;case ChannelState.Processing:if(e.attempt_id){const r=e;if(!r)throw new Error("bad event");if(t=this.task.get(e.attempt_id))return t.setProcessing(e.timestamp,r.processing),this.setChannelStateTimeout(e.channel,e,r.processing.timeout||0),t}break;case ChannelState.Waiting:e.attempt_id&&(t=this.task.get(e.attempt_id))&&(t.setClosed(e.timestamp),this.task.delete(e.attempt_id),this.client.reportingChannelTask(t))}return this.setChannelState(e.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,r){return this._listOfflineMembers=await this.client.request("cc_fetch_offline_members",{agent_id:this.agentId,page:t,q:e,per_page:r}),this._listOfflineMembers}hasTask(e){return this.task.has(e.id)}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,r){this._channel.channel=e||null,this._channel.state=t.status,this._channel.timeout=r,this._channel.joined_at=t.timestamp}}!function(e){e.Abandoned="abandoned",e.Cancel="cancel",e.Success="success",e.Failed="failed",e.Missed="missed",e.Timeout="timeout",e.Endless="endless",e.Transferred="transferred"}(CallReportingStatus||(CallReportingStatus={})),function(e){e.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 r=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&&(r.sip_id?this.setSip(e.phone.sipSessionBySipId(r.sip_id)):this.setSip(e.phone.sipSessionByCallId(t.id))),this.params={},this.id=t.id,this.digits=[],this.applications=[],this.appId=t.app_id,this.setState(t),this.setInfo(r),this.queue&&this.client.agent&&(this.task=this.client.agent.task.get(+this.queue.attempt_id)||null)}setState(e){this.state=e.event}setSip(e){e&&!this.sip&&(this.sip=e,this.localStreams=e.getLocalMedia(),this.peerStreams=e.getPeerMedia())}get duration(){return 0===this.hangupAt?Math.round((Date.now()-this.createdAt)/1e3):Math.round((this.hangupAt-this.createdAt)/1e3)}get allowDtmf(){return this.answeredAt>0&&this.allowHangup}get allowHangup(){return 0===this.hangupAt}get allowHold(){return 0===this.hangupAt&&("active"===this.state||"bridge"===this.state)}get allowAnswer(){return this.client.phone&&0===this.hangupAt&&0===this.answeredAt&&(this.queue||this.direction===CallDirection.Inbound||this.params&&!this.params.autoAnswer)}get allowUnHold(){return 0===this.hangupAt&&"hold"===this.state}get memberCommunication(){return this.task?this.task.communication:null}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 r=Math.ceil(e.length/t),i=new Array(r);let a=0;for(let n=0;n<r;n++)i[n]=e.substr(a,t),a+=t;return i}const maxSizeMessage=4096;var DeclineCause,ChatActions,ConversationState,TypeErrors,NotificationActions;!function(e){e.Timeout="TIMEOUT",e.Busy="BUSY",e.Cancel="CANCEL"}(DeclineCause||(DeclineCause={})),function(e){e.Message="message",e.UserInvite="user_invite",e.Invite="invite_conversation",e.Joined="join_conversation",e.Close="close_conversation",e.Leave="leave_conversation",e.Decline="decline_invite",e.Update="update_channel",e.Destroy="destroy"}(ChatActions||(ChatActions={})),function(e){e.Init="init",e.Invite="invite",e.Active="active",e.Pending="pending",e.Closed="closed"}(ConversationState||(ConversationState={}));class Conversation{constructor(e,t,r,i,a,n){this.client=e,this.conversationId=t,this.title=r,this.channelId=null,this.createdAt=Date.now(),this.answeredAt=0,this.updatedAt=0,this.invitedAt=0,this.closedAt=0,this.task=null,this.data=null,this.queue=null,this.members=(i||[]).map(e=>wrapChannelMember(e)),this._messages=a||[],this.state=ConversationState.Invite,this.variables={},this._hasReporting=!(!n||"true"!==n.cc_reporting),this._autoAnswer=!1,this._cause=null,this.lastAction=null;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.queue={id:+n.cc_queue_id||null,name:n.cc_queue_name||""},this.task=this.client.agent.task.get(+n.cc_attempt_id)||null)}setInvite(e,t){this.inviteId=e,this.invitedAt=t,this._autoAnswer&&this.join().catch(e=>{this.client.emit("error",e)})}setAnswered(e,t,r){this.state=ConversationState.Active,this.answeredAt=t,this.channelId=e,this.member=wrapChannelMember(r),this.inviteId=null}setClosed(e){this.state=ConversationState.Closed,this.closedAt=e}setDecline(e){this.setClosed(e.timestamp),this._cause=e.cause||null}setLeave(e){this.setClosed(e.timestamp)}get id(){return this.channelId||this.inviteId||this.conversationId}get cause(){return this._cause}get messages(){return this.getMessages()}getMessages(){return this._messages.map(e=>{const t={id:e.id,type:e.type,member:this.messageMember(e),channelId:e.channel_id,createdAt:e.created_at,updatedAt:e.updated_at,contact:null};return e.hasOwnProperty("file")&&(e.file.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&&this.hasReporting)}get allowReporting(){return this.answeredAt>0&&this.hasReporting}get hasReporting(){return this._hasReporting}get membersId(){const e=[this.id];for(const t of this.members)e.push(t.id);return e}get attempt(){return this.task}async decline(e){if(!this.inviteId)throw new Error("This conversation is joined");let t=e;return e||0!==this.answeredAt||(t=DeclineCause.Busy),this.client.request("decline_chat",{invite_id:this.inviteId,cause:t})}async join(){if(!this.inviteId)throw new Error("This conversation is joined");return this.client.request("join_chat",{invite_id:this.inviteId})}async close(e){if(!this.channelId)throw new Error("This conversation not active");return this.client.request("close_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:e})}async leave(e){if(!this.channelId)throw new Error("This conversation not active");return 0===this.closedAt||this.hasReporting||this.cause===DeclineCause.Busy?this.client.request("leave_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:e}):this.client.destroyConversation(this)}async sendText(e){if(!this.channelId)throw new Error("conversation not active");if(!e.length)throw new Error("empty message");const t=chunkString(e,maxSizeMessage);for(let e=0;e<t.length;e++){if(e+1>=t.length)return this.sendMessageTextChunk(t[e]);await this.sendMessageTextChunk(t[e])}}async sendFile(e,t){const r=(await this.client.storeFile(this.conversationId,[e],t))[0];return this.client.request("send_file_chat",{channel_id:this.channelId,conversation_id:this.conversationId,id:r.id,name:e.name,mime:r.mime,url:r.shared,size:r.size})}async send(e,t){if("string"==typeof e)return this.sendText(e);if(e instanceof File)return this.sendFile(e,t);throw new Error("unknown send data")}async addToChat(e,t){return this.client.request("add_to_chat",{channel_id:this.channelId,conversation_id:this.conversationId,user_id:e,title:t})}async startChat(e){return this.client.request("start_chat",{user_id:e})}async updateChannel(){return this.client.request("update_channel_chat",{channel_id:this.channelId})}async reporting(e){if(!this.task)throw new Error("this conversation not in queue");return this.task.reporting(e)}async renew(e){if(!this.task)throw new Error("this conversation not in queue");return this.task.renew(e)}async transferToPlan(e){return this.client.request("blind_transfer_chat",{conversation_id:this.conversationId,channel_id:this.channelId,plan_id:e})}async transferToUser(e){return this.client.request("transfer_user_chat",{conversation_id:this.conversationId,channel_id:this.channelId,user_id:e})}sendMessageTextChunk(e){return this.client.request("send_text_chat",{channel_id:this.channelId,conversation_id:this.conversationId,text:e})}messageMember(e){if(this.member&&e.channel_id===this.channelId)return{self:!0};for(const t of this.members)if(t.id===e.channel_id)return t;return null}}function wrapChannelMember(e){return e.messenger=e.type,e}!function(e){e.RolePermission="api.context.permissions.app_error"}(TypeErrors||(TypeErrors={}));class DeviceNotFoundError extends Error{constructor(e){super(e),this.id=DeviceNotFoundError.id}}DeviceNotFoundError.id="device_not_found";class DeviceNotAllowPermissionError extends Error{constructor(e){super(e),this.id=DeviceNotAllowPermissionError.id}}DeviceNotAllowPermissionError.id="device_not_allow";class RolePermissionError extends Error{constructor(e){super(e),this.id=RolePermissionError.id}}RolePermissionError.id="api.context.permissions.app_error",function(e){e.HideMember="hide_member"}(NotificationActions||(NotificationActions={}));const SOCKET_URL_SUFFIX="websocket",spamData="\0\0\0\0";class Socket extends EventEmitter{constructor(e){super(),this.host=e}connect(e){this.socket=new WebSocket(`${formatWebSocketUri(this.host)}/${SOCKET_URL_SUFFIX}`),this.socket.onclose=(e=>this.onClose(e.code)),this.socket.onmessage=(e=>this.onMessage(e.data)),this.socket.onopen=(()=>this.onOpen())}send(e){return this.socket.send(JSON.stringify(e)),null}close(e){this.socket.close(e||1e3),delete this.socket}onOpen(){this.emit("open")}onClose(e){this.emit("close",e),this.off("*")}onMessage(e){if(e!==spamData){const t=JSON.parse(e);this.emit("message",t)}}}const API_HEADER_TOKEN="X-Webitel-Access",WEBSOCKET_AUTHENTICATION_CHALLENGE="authentication_challenge",WEBSOCKET_DEFAULT_DEVICE_CONFIG="user_default_device",WEBSOCKET_AGENT_SESSION="cc_agent_session",WEBSOCKET_PING="ping",WEBSOCKET_MAKE_OUTBOUND_CALL="call_invite",WEBSOCKET_MAKE_USER_CALL="call_user",WEBSOCKET_EVENT_HELLO="hello",WEBSOCKET_EVENT_CALL="call",WEBSOCKET_EVENT_CHAT="chat",WEBSOCKET_EVENT_USER_STATE="user_state",WEBSOCKET_EVENT_AGENT_STATUS="agent_status",WEBSOCKET_EVENT_CHANNEL_STATUS="channel",WEBSOCKET_EVENT_ERROR="error",WEBSOCKET_EVENT_NOTIFICATION="notification",TASK_EVENT="task",JOB_EVENT="job",WEBSOCKET_EVENT_SIP="sip";var HandleError,Response;!function(e){e.NotFoundError="NotFoundError",e.NotAllowedError="NotAllowedError"}(HandleError||(HandleError={})),function(e){e.STATUS_FAIL="FAIL",e.STATUS_OK="OK"}(Response||(Response={}));class Client extends EventEmitter{constructor(e){super(),this._config=e,this.reqSeq=0,this.queueRequest=new Map,this.log=new Log,this.eventHandler=new EventEmitter,this.callStore=new Map,this.conversationStore=new Map,this.pingTimer=null,this.basePath=`${formatBaseUri(e.storageEndpoint||e.endpoint)}`,this.lastError=null}async connect(){await this.connectToSocket()}async disconnect(){this.socket.close()}async subscribeCall(e,t){const r=await this.request("subscribe_call",t);if(this.eventHandler.on(WEBSOCKET_EVENT_CALL,e),r.items&&r.items.length)for(const e of r.items){if(e.hangup_at&&e.hangup_at>0&&!e.task)continue;const t={cc_app_id:"",app_id:e.app_id,event:e.state,id:e.id,timestamp:Date.now(),data:{app_id:e.app_id,event:e.state,id:e.id,timestamp:Date.now(),cc_app_id:"",sip_id:"",parent_id:e.parent_id,direction:e.direction,destination:e.destination,queue:e.queue,from:e.from,to:e.to,payload:e.variables}},r=new Call(this,t);r.createdAt=e.created_at,r.answeredAt=e.answered_at||0,r.bridgedAt=e.bridged_at||0,r.hangupAt=e.hangup_at||0,e.task&&(r.task=new Task(this,{attempt_id:e.task.attempt_id,channel:e.task.channel,status:e.task.status,timestamp:Date.now()},e.task),r.queue.reporting="true",r.task.form=e.task.form||null,e.leaving_at&&e.task.processing_sec&&(r.task.startProcessingAt=e.leaving_at,r.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(r.id,r)}return r}async subscribeChat(e,t){const r=await this.request("subscribe_chat",t);if(this.eventHandler.on(WEBSOCKET_EVENT_CHAT,e),r&&r.items)for(const e of r.items){const t=e.messages.reverse(),r=new Conversation(this,e.id,e.title,e.members,t,e.variables);if(r.createdAt=e.created_at,r.closedAt=e.closed_at,e.task&&(r.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&&(r.task.startProcessingAt=e.leaving_at,r.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})),r.task.form=e.task.form||null),e.invite_id)r.setInvite(e.invite_id,e.created_at);else{if(!e.channel_id){this.log.error(`conversation ${e.id} not valid`);continue}r.setAnswered(e.channel_id,e.joined_at,{id:e.channel_id,name:"TODO",type:"webitel"})}this.conversationStore.set(r.id,r)}return r}async subscribeUsersStatus(e,t){const r=await this.request("subscribe_users_status",t);return this.eventHandler.on(WEBSOCKET_EVENT_USER_STATE,e),r}async subscribeAgentsStatus(e,t){const r=await this.request("cc_agent_subscribe_status",t);return this.eventHandler.on(WEBSOCKET_EVENT_AGENT_STATUS,e),r}subscribeTask(e){this.eventHandler.on(TASK_EVENT,e)}subscribeJob(e){this.eventHandler.on(JOB_EVENT,e)}async unSubscribe(e,t,r){return this.request(`un_subscribe_${e}`,r)}async destroy(){await this.disconnect(),this.phone&&(await this.phone.unregister(),this.phone.off("*"),delete this.phone),this.eventHandler.off("*")}allCall(){return Array.from(this.callStore.values())}allConversations(){return Array.from(this.conversationStore.values())}allTask(){return this.agent?Array.from(this.agent.task.values()):[]}allJob(){return this.allTask().filter(isJobTask)}callById(e){if(this.callStore.has(e))return this.callStore.get(e)}conversationById(e){if(this.conversationStore.has(e))return this.conversationStore.get(e)}callBySipId(e){for(const t of this.allCall())if(t.sipId&&e.startsWith(t.sipId))return t}async reportingTask(e,t){return this.request("cc_reporting",{attempt_id:e,...t})}async agentActiveTasks(e){return this.request("cc_agent_tasks",{agent_id:e})}async auth(){try{return await this.request(WEBSOCKET_AUTHENTICATION_CHALLENGE,{token:this._config.token})}catch(e){throw this.handleError(e),await this.disconnect(),e}}async ping(){return this.request(WEBSOCKET_PING,{ping:1})}sessionInfo(){return this.connectionInfo.session}get version(){return this.connectionInfo.server_version}get buildVersion(){return version}get instanceId(){return this.connectionInfo.sock_id}get autoAnswerDelayTime(){return this._config.autoAnswerDelayTime||400}async agentSession(){if(this.agent)return this.agent;const e=await this.request(WEBSOCKET_AGENT_SESSION);this.agent=new Agent(this,e);const t=await this.agentActiveTasks(this.agent.agentId);for(const e of t.items){const t=new Task(this,{status:e.status,timestamp:Date.now(),channel:e.channel,attempt_id:e.attempt_id},e);t.postProcessData={},t.setState(e.state),e.bridged_at&&(t.bridgedAt=e.bridged_at,t.answeredAt=e.bridged_at),e.leaving_at&&(t.closedAt=e.leaving_at),e.leaving_at&&e.processing_sec&&(t.startProcessingAt=e.leaving_at,t.setProcessing(e.leaving_at,{sec:e.processing_sec||0,timeout:e.processing_timeout_at||null,renewal_sec:e.processing_renewal_sec||0})),t.form=e.form||null,this.agent.task.set(t.id,t)}for(const e of this.allCall())e.task&&this.agent.task.set(e.task.id,e.task);for(const e of this.allConversations())e.task&&this.agent.task.set(e.task.id,e.task);return this.agent}async invite(e){return this.request(WEBSOCKET_MAKE_OUTBOUND_CALL,e)}async call(e){if(this.phone)try{await this.phone.call(e)}catch(e){this.handleError(e)}else await this.invite(e)}async callRecordId(e){return this.request("call_recordings",{id:e})}async eavesdrop(e){return this.request("call_eavesdrop",e)}async agentSetOnline(e,t,r){return this.request("cc_agent_online",{agent_id:e,channels:t,on_demand:r})}async agentSetWaiting(e,t){return this.request("cc_agent_waiting",{agent_id:e,channel:t})}async agentSetPause(e,t){return this.request("cc_agent_pause",{agent_id:e,payload:t})}async agentSetOffline(e){return this.request("cc_agent_offline",{agent_id:e})}inviteToUser(e){return this.request(WEBSOCKET_MAKE_USER_CALL,e)}async answer(e,t){const r=this.callById(e);if(r)return r.answer(t)}request(e,t){return new Promise((r,i)=>{this.queueRequest.set(++this.reqSeq,{resolve:r,reject:i}),this.socket.send({seq:this.reqSeq,action:e,data:t})})}useWebPhone(){return this._config.registerWebDevice||!1}callDestroyed(e){return e.hangupAt>0&&!this.hasAgentTask(e.task)}conversationDestroyed(e){return e.closedAt>0&&(!this.hasAgentTask(e.task)||!e.hasReporting)&&(e.hasReporting||!(e.lastAction===ChatActions.Close&&e.answeredAt>0))}reportingChannelTask(e){switch(e.channel){case ChannelName.Call:for(const e of this.allCall())if(this.callDestroyed(e))return void this.destroyCall(e);break;case ChannelName.Chat:if(e.agentChannelId){const t=this.conversationById(e.agentChannelId);if(t&&this.conversationDestroyed(t))return void this.destroyConversation(t)}}}async registerCallClient(e){this.phone=e,this.subscribePhone(e);try{const e=await this.deviceConfig(this.phone.type);await this.phone.register(e)}catch(e){this.log.error(e)}}subscribePhone(e){e.on("peerStreams",(e,t)=>{const r=this.callBySession(e);r&&!r.peerStreams.length&&(r.setPeerStreams(t),this.eventHandler.emit(WEBSOCKET_EVENT_CALL,CallActions.PeerStream,r))}),e.on("localStreams",(e,t)=>{const r=this.callBySession(e);r&&!r.localStreams.length&&(r.setLocalStreams(t),this.eventHandler.emit(WEBSOCKET_EVENT_CALL,CallActions.LocalStream,r))}),e.on("newSession",this.onNewCallSession.bind(this)),e.on("registered",()=>this.emit("phone_registered",!0)),e.on("unregistered",()=>this.emit("phone_registered",!1))}async deviceConfig(e){return this.request(WEBSOCKET_DEFAULT_DEVICE_CONFIG,{name:e})}async storeFile(e,t,r){if(!t||t.length<1)throw new Error("no files");const i=new FormData;for(const e of t)i.append(e.name,e);const a=(await globalAxios.post(`${this.basePath}/api/storage/file/${e}/upload`,i,{headers:{[API_HEADER_TOKEN]:this._config.token},onUploadProgress:r})).data;for(const e of a)e.shared=this.basePath+e.shared;return a}fileUrlDownload(e){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)}}destroyConversation(e){this.conversationStore.delete(e.id),this.eventHandler.emit(WEBSOCKET_EVENT_CHAT,ChatActions.Destroy,e)}async onMessage(e){if(this.log.debug("receive message: ",e),e.seq_reply>0){if(this.queueRequest.has(e.seq_reply)){const t=this.queueRequest.get(e.seq_reply);if(this.queueRequest.delete(e.seq_reply),e.status===Response.STATUS_OK)t.resolve(e.data);else{const r=e.error;r&&r.id===TypeErrors.RolePermission?t.reject(new RolePermissionError(r.detail)):t.reject(e.error)}}}else switch(e.event){case WEBSOCKET_EVENT_HELLO:await this.connected(e.data),this.log.debug(`opened session ${this.connectionInfo.sock_id} for userId=${this.connectionInfo.session.user_id}`);break;case WEBSOCKET_EVENT_CALL:await this.handleCallEvents(e.data.call);break;case WEBSOCKET_EVENT_CHAT:await this.handleChatEvents(e.data);break;case WEBSOCKET_EVENT_USER_STATE:this.handleUserStateEvent(e.data.state);break;case WEBSOCKET_EVENT_SIP:this.eventHandler.emit(WEBSOCKET_EVENT_SIP,e.data);break;case WEBSOCKET_EVENT_AGENT_STATUS:this.handleAgentStatus(e.data);break;case WEBSOCKET_EVENT_CHANNEL_STATUS:this.handleChannelEvents(e.data);break;case WEBSOCKET_EVENT_ERROR:this.lastError=e.data.error;break;case WEBSOCKET_EVENT_NOTIFICATION:this.handleNotification(e.data.notification);break;default:this.log.error(`event ${e.event} not handler`)}}handleNotification(e){switch(e.action){case NotificationActions.HideMember:if(this.agent&&this.agent._listOfflineMembers){const t=this.agent._listOfflineMembers;if(t.items)for(let r=0;r<t.items.length;r++)if(t.items[r].id===e.body.member_id){t.items.splice(r,1);break}}break;default:this.log.error(`notification "${e.action}" not handled`)}}handleAgentStatus(e){this.agent&&e.agent_id===this.agent.agentId&&this.agent.setStatus(e),this.eventHandler.emit(WEBSOCKET_EVENT_AGENT_STATUS,e,this.agent)}handleChannelEvents(e){if(this.agent){e.timestamp=Date.now();const t=this.agent.onChannelEvent(e)||void 0;this.eventHandler.emit(TASK_EVENT,e.status,t),t&&isJobTask(t)&&(this.eventHandler.emit(JOB_EVENT,t.state,t),isDestroyJob(t.state)&&this.eventHandler.emit(JOB_EVENT,JobState.Destroy,t))}}async pingServer(){if(this.pingTimer&&this.connectionInfo.ping_interval){const e=setTimeout(async()=>{this.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},this.autoAnswerDelayTime)}connectToSocket(){return new Promise((e,t)=>{try{this.socket=new Socket(this._config.endpoint),this.socket.connect(this._config.token)}catch(e){return void t(e)}this.socket.on("message",this.onMessage.bind(this)),this.socket.on("close",e=>{this.pingTimer&&clearTimeout(this.pingTimer),this.log.error("socket close code: ",e),1e3!==e&&(this.emit("disconnected",e,this.lastError),t(new Error(`close socket code: ${e}`))),this.eventHandler.off("*")}),this.socket.on("open",()=>{e(null),this.emit("connected")})})}handleUserStateEvent(e){this.eventHandler.emit(WEBSOCKET_EVENT_USER_STATE,e)}async handleCallEvents(e){let t;switch(e.timestamp=Date.now(),e.event){case CallActions.Ringing:t=new Call(this,e),this.callStore.set(t.id,t),this.checkAutoAnswer(t);break;case CallActions.Active:(t=this.callById(e.id))&&t.setActive(e);break;case CallActions.Bridge:(t=this.callById(e.id))&&t.setBridged(e);break;case CallActions.Execute:(t=this.callById(e.id))&&t.setExecute(e.data);break;case CallActions.DTMF:(t=this.callById(e.id))&&t.addDigit(e.data);break;case CallActions.Voice:(t=this.callById(e.id))&&t.setVoice();break;case CallActions.Silence:(t=this.callById(e.id))&&t.setSilence();break;case CallActions.Hold:(t=this.callById(e.id))&&t.setHold(e);break;case CallActions.Hangup:(t=this.callById(e.id))&&t.setHangup(e);break;default:throw new Error("Unhandled action")}t&&(this.eventHandler.emit(WEBSOCKET_EVENT_CALL,e.event,t),this.callDestroyed(t)&&this.destroyCall(t))}async handleChatEvents(e){let t;const r=Date.now();switch(e.action){case ChatActions.UserInvite:const i=e.data;(t=new Conversation(this,i.conversation_id,i.title,i.members,i.messages,i.variables)).setInvite(i.invite_id,r),this.conversationStore.set(t.id,t);break;case ChatActions.Joined:const a=e.data;(t=this.conversationById(a.member.id))&&t.setAnswered(a.member.id,r,a.member);break;case ChatActions.Message:const n=e.data;n.timestamp=r;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(r);break;case ChatActions.Leave:const o=e.data;(t=this.conversationById(o.leaved_channel_id))&&t.setLeave(o);break;case ChatActions.Decline:const u=e.data;(t=this.conversationById(u.invite_id))&&t.setDecline(u)}t&&(t.lastAction=e.action,this.eventHandler.emit(WEBSOCKET_EVENT_CHAT,e.action,t),this.conversationDestroyed(t)&&this.destroyConversation(t))}hasAgentTask(e){return!(!this.agent||!e)&&this.agent.hasTask(e)}destroyCall(e){this.callStore.delete(e.id),this.eventHandler.emit(WEBSOCKET_EVENT_CALL,CallActions.Destroy,e)}}function isJobTask(e){return e.channel===ChannelName.Task}function isDestroyJob(e){return[ChannelState.Missed.toString(),ChannelState.Waiting,ChannelState.WrapTime,JobState.Closed].indexOf(e)>-1}class SipClient extends EventEmitter{}var commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var ee=createCommonjsModule(function(e,t){var r=commonjsGlobal&&commonjsGlobal.__generator||function(e,t){var r,i,a,n,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return n={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function o(n){return function(o){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,i&&(a=2&n[0]?i.return:n[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,n[1])).done)return a;switch(i=0,a&&(n=[2&n[0],a.value]),n[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,i=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(!(a=(a=s.trys).length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=t.call(e,s)}catch(e){n=[6,e],i=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,o])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.$listeners=Symbol("EventEmitter.listeners"),t.$addListener=Symbol("EventEmitter.addListener");var i=function(){function e(){this[t.$listeners]={}}return e.count=function(e,r){var i=0,a=e[t.$listeners][r];if(a)for(var n=a.first;++i&&n.next;)n=n.next;return i},e.has=function(e,r){if("*"==r){for(r in e[t.$listeners])return!0;return!1}return void 0!==e[t.$listeners][r]},e.keys=function(e){return Object.keys(e[t.$listeners])},e.unhandle=function(e,r,i,a){return e.on(r,function(){for(var a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];if(!e[t.$listeners][r].first.next)return i.apply(void 0,a)},a)},e.prototype.on=function(e,r,i){return"function"==typeof r?this[t.$addListener](e,r,i):this[t.$addListener](e,void 0,r)},e.prototype.one=function(e,r,i){return"function"==typeof r?this[t.$addListener](e,r,i,!0):this[t.$addListener](e,void 0,r,!0)},e.prototype.off=function(e,r){if("*"==e){var i=this[t.$listeners];if(this[t.$listeners]={},this._onEventUnhandled)for(var a in i)this._onEventUnhandled(a);return this}if("function"==typeof r){var n=this[t.$listeners][e];if(n&&function(e,t){var r=null,i=e.first;for(;;)if(t(i))if(r){if(r.next=i.next,!i.next)break;i=i.next}else{if(!i.next)return null;e.first=i=i.next}else{if(r=i,!i.next)break;i=i.next}return e.last=r,e}(n,function(e){return e.fn==r}))return this}return delete this[t.$listeners][e],this._onEventUnhandled&&this._onEventUnhandled(e),this},e.prototype.emit=function(e){for(var t,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];for(var a=this.listeners(e);;){var n=a.next(),s=n.value;if(n.done)return t;var o=s.apply(void 0,r);void 0!==o&&(t=o)}},e.prototype.listeners=function(e){var i,a,n;return r(this,function(r){switch(r.label){case 0:if(!(i=this[t.$listeners][e]))return[2];a=null,n=i.first,r.label=1;case 1:return[4,n.fn];case 2:if(r.sent(),n.once){if(!a)return n.next?(i.first=n=n.next,[3,1]):(delete this[t.$listeners][e],this._onEventUnhandled&&this._onEventUnhandled(e),[2]);a.next=n.next}else a=n;return n.next?(n=n.next,[3,1]):(i.last=n,[2]);case 3:return[2]}})},e.prototype[t.$addListener]=function(e,r,i,n){var s=this;if(void 0===n&&(n=!1),"object"==typeof e){var o,u=function(){if("function"==typeof e[o]){var r=e[o],u=a(c[t.$listeners],o,{fn:r,once:n,next:null});i&&i.push({dispose:function(){return s.off(o,r)}}),r==u.first.fn&&c._onEventHandled&&c._onEventHandled(o)}},c=this;for(o in e)u();return this}if("function"==typeof r){var l=e,d=a(this[t.$listeners],l,{fn:r,once:n,next:null});i&&i.push({dispose:function(){return s.off(l,r)}}),r==d.first.fn&&this._onEventHandled&&this._onEventHandled(e)}return r},e.ev=t.$listeners,e}();function a(e,t,r){var i=e[t];return i?(i.last.next=r,i.last=r):e[t]=i={first:r,last:r},i}t.EventEmitter=i});unwrapExports(ee);var ee_1=ee.$listeners,ee_2=ee.$addListener,ee_3=ee.EventEmitter;class Session$1{constructor(e,t){this.client=e,this.callId=t,this.incoming=!1,this.instanceId="fixme"}get id(){return this.callId}getLocalMedia(){return[]}getPeerMedia(){return[]}answer(e){return new Promise(e=>{this.client.answer(this.id),e()})}}class ExternalClient extends ee_3{constructor(e){super(),this.config=e,this.type="external",this.schema="wtel://"}async callOption(e){return e}async register(e){}async unregister(){}async call(e){e.destination&&this.exec(e.destination)}answer(e){this.exec(e,"answer")}sipSessionByCallId(e){return new Session$1(this,e)}sipSessionBySipId(e){return null}open(e){this.exec(encodeURIComponent(JSON.stringify({token:e,...this.config})),"open")}exec(e,t){let r=`${this.schema}${e}`;t&&(r+=` ${t}`);const i=document.createElement("a");i.download="File name",i.href=r,i.click()}}export{AgentPauseCauseServiceApiAxiosParamCreator,AgentPauseCauseServiceApiFp,AgentPauseCauseServiceApiFactory,AgentPauseCauseServiceApi,AgentServiceApiAxiosParamCreator,AgentServiceApiFp,AgentServiceApiFactory,AgentServiceApi,AgentSkillServiceApiAxiosParamCreator,AgentSkillServiceApiFp,AgentSkillServiceApiFactory,AgentSkillServiceApi,AgentTeamServiceApiAxiosParamCreator,AgentTeamServiceApiFp,AgentTeamServiceApiFactory,AgentTeamServiceApi,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,TriggerServiceApiAxiosParamCreator,TriggerServiceApiFp,TriggerServiceApiFactory,TriggerServiceApi,UserHelperServiceApiAxiosParamCreator,UserHelperServiceApiFp,UserHelperServiceApiFactory,UserHelperServiceApi,Configuration,EngineBoolFilter,EngineRoutingSchemaType,EngineTriggerJobState,EngineTriggerType,HistoryFileJobHistoryFileJobAction,HistoryFileJobHistoryFileJobState,ProtobufNullValue,StorageImportSourceType,StorageProviderType,StorageServiceType,StorageUploadStatusCode,JobState,Response,Client,CallReportingStatus,CallActions,CallDirection,Call,AgentStatus,ChannelState,ChannelType,Agent,DeclineCause,ChatActions,ConversationState,Conversation,TypeErrors,DeviceNotFoundError,DeviceNotAllowPermissionError,RolePermissionError,SipClient,ExternalClient,SipPhone,Log};
2
2
  //# sourceMappingURL=index.esm.min.js.map