webitel-sdk 23.7.7 → 23.7.8

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 (53) hide show
  1. package/bundles/index.esm.js +1123 -129
  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 +1413 -305
  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/contacts-api.js +15 -15
  10. package/esm2015/api/contacts-api.js.map +1 -1
  11. package/esm2015/api/index.js +2 -0
  12. package/esm2015/api/index.js.map +1 -1
  13. package/esm2015/api/logger-action.js +8 -8
  14. package/esm2015/api/logger-service-api.js +8 -8
  15. package/esm2015/api/managers-api.js +984 -0
  16. package/esm2015/api/managers-api.js.map +1 -0
  17. package/esm2015/api/newupdate-of-the-manager-link.js +13 -0
  18. package/esm2015/api/newupdate-of-the-manager-link.js.map +1 -0
  19. package/esm2015/api/newupdate-of-the-manager-link1.js +13 -0
  20. package/esm2015/api/newupdate-of-the-manager-link1.js.map +1 -0
  21. package/esm2015/api.js +1 -0
  22. package/esm2015/api.js.map +1 -1
  23. package/esm5/api/contacts-api.js +15 -15
  24. package/esm5/api/contacts-api.js.map +1 -1
  25. package/esm5/api/index.js +2 -0
  26. package/esm5/api/index.js.map +1 -1
  27. package/esm5/api/logger-action.js +8 -8
  28. package/esm5/api/logger-service-api.js +8 -8
  29. package/esm5/api/managers-api.js +1096 -0
  30. package/esm5/api/managers-api.js.map +1 -0
  31. package/esm5/api/newupdate-of-the-manager-link.js +13 -0
  32. package/esm5/api/newupdate-of-the-manager-link.js.map +1 -0
  33. package/esm5/api/newupdate-of-the-manager-link1.js +13 -0
  34. package/esm5/api/newupdate-of-the-manager-link1.js.map +1 -0
  35. package/esm5/api.js +1 -0
  36. package/esm5/api.js.map +1 -1
  37. package/package.json +1 -1
  38. package/types/api/contacts-api.d.ts +8 -8
  39. package/types/api/contacts-api.d.ts.map +1 -1
  40. package/types/api/engine-agent-today-statistics-response.d.ts +12 -0
  41. package/types/api/engine-agent-today-statistics-response.d.ts.map +1 -1
  42. package/types/api/index.d.ts +2 -0
  43. package/types/api/index.d.ts.map +1 -1
  44. package/types/api/logger-action.d.ts +6 -6
  45. package/types/api/logger-service-api.d.ts +16 -16
  46. package/types/api/managers-api.d.ts +398 -0
  47. package/types/api/managers-api.d.ts.map +1 -0
  48. package/types/api/newupdate-of-the-manager-link.d.ts +32 -0
  49. package/types/api/newupdate-of-the-manager-link.d.ts.map +1 -0
  50. package/types/api/newupdate-of-the-manager-link1.d.ts +32 -0
  51. package/types/api/newupdate-of-the-manager-link1.d.ts.map +1 -0
  52. package/types/api.d.ts +1 -0
  53. package/types/api.d.ts.map +1 -1
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("tslib"),require("url"),require("axios"),require("ee-ts"),require("jssip")):"function"==typeof define&&define.amd?define(["exports","tslib","url","axios","ee-ts","jssip"],t):t((e=e||self).WebitelSdk={},e.tslib,e.globalImportUrl,e.globalAxios,e.eeTs,e.JsSip)}(this,function(g,ae,se,Z,T,I){"use strict";Z=Z&&Z.hasOwnProperty("default")?Z.default:Z;function e(e,t,n){void 0===n&&(n=Z),this.basePath=t=void 0===t?ee:t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}var k,ee="https://dev.webitel.com/api".replace(/\/+$/,""),O=(k=Error,ae.__extends(W,k),W);function W(e,t){t=k.call(this,t)||this;return t.field=e,t.name="RequiredError",t}function E(f){var e=this;return{createAgentPauseCause:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createAgentPauseCause.");return(t=se.parse("/call_center/pause_causes",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteAgentPauseCause:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},patchAgentPauseCause:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchAgentPauseCause.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readAgentPauseCause:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentPauseCause:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/pause_causes",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},updateAgentPauseCause:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateAgentPauseCause.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function X(c){return{createAgentPauseCause:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,E(c).createAgentPauseCause(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgentPauseCause:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,E(c).deleteAgentPauseCause(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchAgentPauseCause:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,E(c).patchAgentPauseCause(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgentPauseCause:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,E(c).readAgentPauseCause(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentPauseCause:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,E(c).searchAgentPauseCause(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentPauseCause:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,E(c).updateAgentPauseCause(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}x=e,ae.__extends(U,x),U.prototype.createAgentPauseCause=function(e,t){var n=this;return X(this.configuration).createAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},U.prototype.deleteAgentPauseCause=function(e,t){var n=this;return X(this.configuration).deleteAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},U.prototype.patchAgentPauseCause=function(e,t,n){var r=this;return X(this.configuration).patchAgentPauseCause(e,t,n).then(function(e){return e(r.axios,r.basePath)})},U.prototype.readAgentPauseCause=function(e,t){var n=this;return X(this.configuration).readAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},U.prototype.searchAgentPauseCause=function(e,t,n,r,i,a,s){var o=this;return X(this.configuration).searchAgentPauseCause(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},U.prototype.updateAgentPauseCause=function(e,t,n){var r=this;return X(this.configuration).updateAgentPauseCause(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var x,j=U;function U(){return null!==x&&x.apply(this,arguments)||this}function A(P){var e=this;return{agentSetState:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("agentId","Required parameter agentId was null or undefined when calling agentSetState.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling agentSetState.");return(t="/call_center/agents/{agent_id}/states/waiting".replace("{agent_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},agentStateHistory:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling agentStateHistory.");return(t="/call_center/agents/{agent_id}/states/history".replace("{agent_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.time_from=d),void 0!==_&&(a.time_to=_),void 0!==h&&(a.q=h),void 0!==p&&(a.domain_id=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},agentTodayStatistics:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling agentTodayStatistics.");return(t="/call_center/agents/{agent_id}/statistics/today".replace("{agent_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return c&&(a.fields=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},createAgent:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createAgent.");return(t=se.parse("/call_center/agents",!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteAgent:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},patchAgent:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchAgent.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readAgent:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchAgent:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K){return void 0===K&&(K={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/agents",!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),K),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.allow_channels=p),f&&(a.supervisor_id=f),g&&(a.team_id=g),v&&(a.region_id=v),y&&(a.auditor_id=y),void 0!==b&&(a.is_supervisor=b),w&&(a.skill_id=w),m&&(a.queue_id=m),void 0!==q&&(a.not_supervisor=q),A&&(a.user_id=A),C&&(a.extension=C),R&&(a.not_team_id=R),S&&(a.not_skill_id=S),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),K.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),K.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentCallStatistics:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/agents/reports/call",!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),v),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a["time.from"]=l),void 0!==d&&(a["time.to"]=d),_&&(a.agent_id=_),void 0!==h&&(a.domain_id=h),void 0!==p&&(a.q=p),f&&(a.fields=f),void 0!==g&&(a.sort=g),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),v.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentInQueue:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling searchAgentInQueue.");return(t="/call_center/agents/{id}/queues".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentInQueueStatistics:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling searchAgentInQueueStatistics.");return(t="/call_center/agents/{agent_id}/statistics/queues".replace("{agent_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentInTeam:function(u,c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling searchAgentInTeam.");return(t="/call_center/agents/{id}/teams".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),h),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.domain_id=_),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentStateHistory:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/agents/states/history",!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),g),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a["joined_at.from"]=l),void 0!==d&&(a["joined_at.to"]=d),_&&(a.agent_id=_),void 0!==h&&(a.sort=h),void 0!==p&&(a.domain_id=p),void 0!==f&&(a.from_id=f),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),g.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentStatusStatistic:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S){return void 0===S&&(S={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/agents/reports/status",!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),S),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.agent_id=h),void 0!==p&&(a["time.from"]=p),void 0!==f&&(a["time.to"]=f),g&&(a.status=g),v&&(a.queue_id=v),y&&(a.team_id=y),void 0!==b&&(a["utilization.from"]=b),void 0!==w&&(a["utilization.to"]=w),void 0!==m&&(a.has_call=m),q&&(a.skill_id=q),A&&(a.region_id=A),C&&(a.supervisor_id=C),R&&(a.auditor_id=R),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),S.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),S.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentStatusStatisticItem:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling searchAgentStatusStatisticItem.");return(t="/call_center/agents/reports/status/{agent_id}".replace("{agent_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a["time.from"]=c),void 0!==l&&(a["time.to"]=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},searchLookupUsersAgentNotExists:function(u,c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/lookups/agents/users",!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),_),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.domain_id=d),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),[2,{url:se.format(t),options:r}]}})})},searchPauseCauseForAgent:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling searchPauseCauseForAgent.");return(t="/call_center/agents/{agent_id}/pause_causes".replace("{agent_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.allow_change=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},updateAgent:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateAgent.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},updateAgentStatus:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateAgentStatus.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateAgentStatus.");return(t="/call_center/agents/{id}/status".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function C(q){return{agentSetState:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).agentSetState(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentStateHistory:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).agentStateHistory(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentTodayStatistics:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).agentTodayStatistics(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createAgent:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).createAgent(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgent:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).deleteAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchAgent:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).patchAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgent:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).readAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgent:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchAgent(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentCallStatistics:function(t,r,i,a,s,o,u,c,l,d){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchAgentCallStatistics(t,r,i,a,s,o,u,c,l,d)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentInQueue:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchAgentInQueue(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentInQueueStatistics:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchAgentInQueueStatistics(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentInTeam:function(t,r,i,a,s,o){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchAgentInTeam(t,r,i,a,s,o)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentStateHistory:function(t,r,i,a,s,o,u,c,l){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchAgentStateHistory(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentStatusStatistic:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchAgentStatusStatistic(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentStatusStatisticItem:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchAgentStatusStatisticItem(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchLookupUsersAgentNotExists:function(t,r,i,a,s){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchLookupUsersAgentNotExists(t,r,i,a,s)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchPauseCauseForAgent:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchPauseCauseForAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgent:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).updateAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentStatus:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).updateAgentStatus(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Q=e,ae.__extends(t,Q),t.prototype.agentSetState=function(e,t,n){var r=this;return C(this.configuration).agentSetState(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.agentStateHistory=function(e,t,n,r,i,a,s,o){var u=this;return C(this.configuration).agentStateHistory(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},t.prototype.agentTodayStatistics=function(e,t,n){var r=this;return C(this.configuration).agentTodayStatistics(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.createAgent=function(e,t){var n=this;return C(this.configuration).createAgent(e,t).then(function(e){return e(n.axios,n.basePath)})},t.prototype.deleteAgent=function(e,t,n){var r=this;return C(this.configuration).deleteAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.patchAgent=function(e,t,n){var r=this;return C(this.configuration).patchAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.readAgent=function(e,t,n){var r=this;return C(this.configuration).readAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.searchAgent=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b){var w=this;return C(this.configuration).searchAgent(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b).then(function(e){return e(w.axios,w.basePath)})},t.prototype.searchAgentCallStatistics=function(e,t,n,r,i,a,s,o,u,c){var l=this;return C(this.configuration).searchAgentCallStatistics(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},t.prototype.searchAgentInQueue=function(e,t,n,r,i,a,s){var o=this;return C(this.configuration).searchAgentInQueue(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},t.prototype.searchAgentInQueueStatistics=function(e,t,n){var r=this;return C(this.configuration).searchAgentInQueueStatistics(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.searchAgentInTeam=function(e,t,n,r,i,a){var s=this;return C(this.configuration).searchAgentInTeam(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},t.prototype.searchAgentStateHistory=function(e,t,n,r,i,a,s,o,u){var c=this;return C(this.configuration).searchAgentStateHistory(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},t.prototype.searchAgentStatusStatistic=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y){var b=this;return C(this.configuration).searchAgentStatusStatistic(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y).then(function(e){return e(b.axios,b.basePath)})},t.prototype.searchAgentStatusStatisticItem=function(e,t,n,r){var i=this;return C(this.configuration).searchAgentStatusStatisticItem(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},t.prototype.searchLookupUsersAgentNotExists=function(e,t,n,r,i){var a=this;return C(this.configuration).searchLookupUsersAgentNotExists(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},t.prototype.searchPauseCauseForAgent=function(e,t,n){var r=this;return C(this.configuration).searchPauseCauseForAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.updateAgent=function(e,t,n){var r=this;return C(this.configuration).updateAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.updateAgentStatus=function(e,t,n){var r=this;return C(this.configuration).updateAgentStatus(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Q,L=t;function t(){return null!==Q&&Q.apply(this,arguments)||this}function F(v){var e=this;return{createAgentSkill:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("agentId","Required parameter agentId was null or undefined when calling createAgentSkill.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createAgentSkill.");return(t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},createAgentSkills:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("agentId","Required parameter agentId was null or undefined when calling createAgentSkills.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createAgentSkills.");return(t="/call_center/agents/{agent_id}/skills/bulk".replace("{agent_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteAgentSkill:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling deleteAgentSkill.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},deleteAgentSkills:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling deleteAgentSkills.");return(t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return c&&(a.id=c),l&&(a.skill_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},patchAgentSkill:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("agentId","Required parameter agentId was null or undefined when calling patchAgentSkill.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling patchAgentSkill.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling patchAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),_),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})},patchAgentSkills:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("agentId","Required parameter agentId was null or undefined when calling patchAgentSkills.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchAgentSkills.");return(t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readAgentSkill:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling readAgentSkill.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentSkill:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling searchAgentSkill.");return(t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),f&&(a.skill_id=f),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),g.headers),[2,{url:se.format(t),options:r}]}})})},searchLookupAgentNotExistsSkill:function(u,c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling searchLookupAgentNotExistsSkill.");return(t="/call_center/lookups/agents/skills/{agent_id}".replace("{agent_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),h),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.domain_id=_),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),[2,{url:se.format(t),options:r}]}})})},updateAgentSkill:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("agentId","Required parameter agentId was null or undefined when calling updateAgentSkill.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateAgentSkill.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function _(d){return{createAgentSkill:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,F(d).createAgentSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createAgentSkills:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,F(d).createAgentSkills(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgentSkill:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,F(d).deleteAgentSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgentSkills:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,F(d).deleteAgentSkills(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchAgentSkill:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,F(d).patchAgentSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchAgentSkills:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,F(d).patchAgentSkills(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgentSkill:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,F(d).readAgentSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentSkill:function(t,r,i,a,s,o,u,c,l){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,F(d).searchAgentSkill(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchLookupAgentNotExistsSkill:function(t,r,i,a,s,o){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,F(d).searchLookupAgentNotExistsSkill(t,r,i,a,s,o)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentSkill:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,F(d).updateAgentSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}G=e,ae.__extends(D,G),D.prototype.createAgentSkill=function(e,t,n){var r=this;return _(this.configuration).createAgentSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},D.prototype.createAgentSkills=function(e,t,n){var r=this;return _(this.configuration).createAgentSkills(e,t,n).then(function(e){return e(r.axios,r.basePath)})},D.prototype.deleteAgentSkill=function(e,t,n,r){var i=this;return _(this.configuration).deleteAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},D.prototype.deleteAgentSkills=function(e,t,n,r){var i=this;return _(this.configuration).deleteAgentSkills(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},D.prototype.patchAgentSkill=function(e,t,n,r){var i=this;return _(this.configuration).patchAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},D.prototype.patchAgentSkills=function(e,t,n){var r=this;return _(this.configuration).patchAgentSkills(e,t,n).then(function(e){return e(r.axios,r.basePath)})},D.prototype.readAgentSkill=function(e,t,n,r){var i=this;return _(this.configuration).readAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},D.prototype.searchAgentSkill=function(e,t,n,r,i,a,s,o,u){var c=this;return _(this.configuration).searchAgentSkill(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},D.prototype.searchLookupAgentNotExistsSkill=function(e,t,n,r,i,a){var s=this;return _(this.configuration).searchLookupAgentNotExistsSkill(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},D.prototype.updateAgentSkill=function(e,t,n,r){var i=this;return _(this.configuration).updateAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var G,B=D;function D(){return null!==G&&G.apply(this,arguments)||this}function H(v){var e=this;return{createAgentTeam:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createAgentTeam.");return(t=se.parse("/call_center/teams",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteAgentTeam:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteAgentTeam.");return(t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},readAgentTeam:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readAgentTeam.");return(t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentTeam:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/teams",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.strategy=p),f&&(a.admin_id=f),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),g.headers),[2,{url:se.format(t),options:r}]}})})},updateAgentTeam:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateAgentTeam.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateAgentTeam.");return(t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function M(d){return{createAgentTeam:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,H(d).createAgentTeam(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgentTeam:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,H(d).deleteAgentTeam(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgentTeam:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,H(d).readAgentTeam(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentTeam:function(t,r,i,a,s,o,u,c,l){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,H(d).searchAgentTeam(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentTeam:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,H(d).updateAgentTeam(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}N=e,ae.__extends(V,N),V.prototype.createAgentTeam=function(e,t){var n=this;return M(this.configuration).createAgentTeam(e,t).then(function(e){return e(n.axios,n.basePath)})},V.prototype.deleteAgentTeam=function(e,t,n){var r=this;return M(this.configuration).deleteAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.readAgentTeam=function(e,t,n){var r=this;return M(this.configuration).readAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.searchAgentTeam=function(e,t,n,r,i,a,s,o,u){var c=this;return M(this.configuration).searchAgentTeam(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},V.prototype.updateAgentTeam=function(e,t,n){var r=this;return M(this.configuration).updateAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var N,J=V;function V(){return null!==N&&N.apply(this,arguments)||this}function z(m){var e=this;return{createAuditForm:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createAuditForm.");return(t=se.parse("/call_center/audit/forms",!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},createAuditFormRate:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createAuditFormRate.");return(t=se.parse("/call_center/audit/rate",!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteAuditForm:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteAuditForm.");return(t="/call_center/audit/forms/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},patchAuditForm:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchAuditForm.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchAuditForm.");return(t="/call_center/audit/forms/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readAuditForm:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readAuditForm.");return(t="/call_center/audit/forms/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},readAuditRate:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readAuditRate.");return(t="/call_center/audit/rate/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchAuditForm:function(u,c,l,d,_,h,p,f,g,v,y,b,w){return void 0===w&&(w={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/audit/forms",!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),w),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.team_id=p),void 0!==f&&(a.enabled=f),void 0!==g&&(a.archive=g),void 0!==v&&(a.editable=v),void 0!==y&&(a.active=y),void 0!==b&&(a.question=b),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),w.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),w.headers),[2,{url:se.format(t),options:r}]}})})},searchAuditRate:function(u,c,l,d,_,h,p,f,g,v,y,b){return void 0===b&&(b={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("formId","Required parameter formId was null or undefined when calling searchAuditRate.");return(t="/call_center/audit/forms/{form_id}/rate".replace("{form_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),b),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),void 0!==p&&(a["created_at.from"]=p),void 0!==f&&(a["created_at.to"]=f),g&&(a.id=g),v&&(a.call_id=v),y&&(a.rated_user=y),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),b.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),b.headers),[2,{url:se.format(t),options:r}]}})})},updateAuditForm:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateAuditForm.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateAuditForm.");return(t="/call_center/audit/forms/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function v(f){return{createAuditForm:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,z(f).createAuditForm(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createAuditFormRate:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,z(f).createAuditFormRate(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAuditForm:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,z(f).deleteAuditForm(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchAuditForm:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,z(f).patchAuditForm(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAuditForm:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,z(f).readAuditForm(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAuditRate:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,z(f).readAuditRate(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAuditForm:function(t,r,i,a,s,o,u,c,l,d,_,h,p){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,z(f).searchAuditForm(t,r,i,a,s,o,u,c,l,d,_,h,p)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAuditRate:function(t,r,i,a,s,o,u,c,l,d,_,h){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,z(f).searchAuditRate(t,r,i,a,s,o,u,c,l,d,_,h)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAuditForm:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,z(f).updateAuditForm(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}$=e,ae.__extends(re,$),re.prototype.createAuditForm=function(e,t){var n=this;return v(this.configuration).createAuditForm(e,t).then(function(e){return e(n.axios,n.basePath)})},re.prototype.createAuditFormRate=function(e,t){var n=this;return v(this.configuration).createAuditFormRate(e,t).then(function(e){return e(n.axios,n.basePath)})},re.prototype.deleteAuditForm=function(e,t){var n=this;return v(this.configuration).deleteAuditForm(e,t).then(function(e){return e(n.axios,n.basePath)})},re.prototype.patchAuditForm=function(e,t,n){var r=this;return v(this.configuration).patchAuditForm(e,t,n).then(function(e){return e(r.axios,r.basePath)})},re.prototype.readAuditForm=function(e,t){var n=this;return v(this.configuration).readAuditForm(e,t).then(function(e){return e(n.axios,n.basePath)})},re.prototype.readAuditRate=function(e,t){var n=this;return v(this.configuration).readAuditRate(e,t).then(function(e){return e(n.axios,n.basePath)})},re.prototype.searchAuditForm=function(e,t,n,r,i,a,s,o,u,c,l,d,_){var h=this;return v(this.configuration).searchAuditForm(e,t,n,r,i,a,s,o,u,c,l,d,_).then(function(e){return e(h.axios,h.basePath)})},re.prototype.searchAuditRate=function(e,t,n,r,i,a,s,o,u,c,l,d){var _=this;return v(this.configuration).searchAuditRate(e,t,n,r,i,a,s,o,u,c,l,d).then(function(e){return e(_.axios,_.basePath)})},re.prototype.updateAuditForm=function(e,t,n){var r=this;return v(this.configuration).updateAuditForm(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var $,Y=re;function re(){return null!==$&&$.apply(this,arguments)||this}function ie(f){var e=this;return{createBackendProfile:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createBackendProfile.");return(t=se.parse("/storage/backend_profiles",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteBackendProfile:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},patchBackendProfile:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchBackendProfile.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readBackendProfile:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchBackendProfile:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/storage/backend_profiles",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},updateBackendProfile:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateBackendProfile.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function oe(c){return{createBackendProfile:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ie(c).createBackendProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteBackendProfile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ie(c).deleteBackendProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchBackendProfile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ie(c).patchBackendProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readBackendProfile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ie(c).readBackendProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchBackendProfile:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ie(c).searchBackendProfile(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateBackendProfile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ie(c).updateBackendProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ue=e,ae.__extends(le,ue),le.prototype.createBackendProfile=function(e,t){var n=this;return oe(this.configuration).createBackendProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},le.prototype.deleteBackendProfile=function(e,t,n){var r=this;return oe(this.configuration).deleteBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},le.prototype.patchBackendProfile=function(e,t,n){var r=this;return oe(this.configuration).patchBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},le.prototype.readBackendProfile=function(e,t,n){var r=this;return oe(this.configuration).readBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},le.prototype.searchBackendProfile=function(e,t,n,r,i,a,s){var o=this;return oe(this.configuration).searchBackendProfile(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},le.prototype.updateBackendProfile=function(e,t,n){var r=this;return oe(this.configuration).updateBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var ue,ce=le;function le(){return null!==ue&&ue.apply(this,arguments)||this}function de(f){var e=this;return{createBucket:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createBucket.");return(t=se.parse("/call_center/buckets",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteBucket:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteBucket.");return(t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},readBucket:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readBucket.");return(t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchBucket:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/buckets",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},updateBucket:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateBucket.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateBucket.");return(t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function _e(c){return{createBucket:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,de(c).createBucket(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteBucket:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,de(c).deleteBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readBucket:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,de(c).readBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchBucket:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,de(c).searchBucket(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateBucket:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,de(c).updateBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}he=e,ae.__extends(fe,he),fe.prototype.createBucket=function(e,t){var n=this;return _e(this.configuration).createBucket(e,t).then(function(e){return e(n.axios,n.basePath)})},fe.prototype.deleteBucket=function(e,t,n){var r=this;return _e(this.configuration).deleteBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},fe.prototype.readBucket=function(e,t,n){var r=this;return _e(this.configuration).readBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},fe.prototype.searchBucket=function(e,t,n,r,i,a,s){var o=this;return _e(this.configuration).searchBucket(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},fe.prototype.updateBucket=function(e,t,n){var r=this;return _e(this.configuration).updateBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var he,pe=fe;function fe(){return null!==he&&he.apply(this,arguments)||this}function ge(f){var e=this;return{createCalendar:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createCalendar.");return(t=se.parse("/calendars",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteCalendar:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteCalendar.");return(t="/calendars/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},readCalendar:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readCalendar.");return(t="/calendars/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchCalendar:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/calendars",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},searchTimezones:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/calendars/timezones",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},updateCalendar:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateCalendar.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateCalendar.");return(t="/calendars/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function ve(c){return{createCalendar:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ge(c).createCalendar(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCalendar:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ge(c).deleteCalendar(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCalendar:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ge(c).readCalendar(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchCalendar:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ge(c).searchCalendar(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchTimezones:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ge(c).searchTimezones(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCalendar:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ge(c).updateCalendar(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ye=e,ae.__extends(we,ye),we.prototype.createCalendar=function(e,t){var n=this;return ve(this.configuration).createCalendar(e,t).then(function(e){return e(n.axios,n.basePath)})},we.prototype.deleteCalendar=function(e,t,n){var r=this;return ve(this.configuration).deleteCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})},we.prototype.readCalendar=function(e,t,n){var r=this;return ve(this.configuration).readCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})},we.prototype.searchCalendar=function(e,t,n,r,i,a,s){var o=this;return ve(this.configuration).searchCalendar(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},we.prototype.searchTimezones=function(e,t,n,r,i,a,s){var o=this;return ve(this.configuration).searchTimezones(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},we.prototype.updateCalendar=function(e,t,n){var r=this;return ve(this.configuration).updateCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var ye,be=we;function we(){return null!==ye&&ye.apply(this,arguments)||this}function te(ie){var e=this;return{aggregateHistoryCall:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling aggregateHistoryCall.");return(t=se.parse("/calls/history/aggregate",!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},blindTransferCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling blindTransferCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling blindTransferCall.");return(t="/calls/active/{id}/transfer".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},confirmPush:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling confirmPush.");return(t="/calls/active/{id}/confirm_push".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),c),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},createCall:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createCall.");return(t=se.parse("/calls",!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},createCallAnnotation:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("callId","Required parameter callId was null or undefined when calling createCallAnnotation.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createCallAnnotation.");return(t="/calls/history/{call_id}/annotation".replace("{call_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteCallAnnotation:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("callId","Required parameter callId was null or undefined when calling deleteCallAnnotation.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteCallAnnotation.");return(t="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},dtmfCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling dtmfCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling dtmfCall.");return(t="/calls/active/{id}/dtmf".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},eavesdropCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling eavesdropCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling eavesdropCall.");return(t="/calls/active/{id}/eavesdrop".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},hangupCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling hangupCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling hangupCall.");return(t="/calls/active/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},holdCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling holdCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling holdCall.");return(t="/calls/active/{id}/hold".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},patchHistoryCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchHistoryCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchHistoryCall.");return(t="/calls/history/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readCall:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readCall.");return(t="/calls/active/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchActiveCall:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I,k,W,E,X,x,j){return void 0===j&&(j={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/calls/active",!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),j),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),void 0!==h&&(a["created_at.from"]=h),void 0!==p&&(a["created_at.to"]=p),f&&(a.user_id=f),g&&(a.agent_id=g),v&&(a.queue_id=v),y&&(a.team_id=y),b&&(a.member_id=b),w&&(a.gateway_id=w),void 0!==m&&(a["duration.from"]=m),void 0!==q&&(a["duration.to"]=q),void 0!==A&&(a.skip_parent=A),void 0!==C&&(a.parent_id=C),R&&(a.cause=R),void 0!==S&&(a.exists_file=S),void 0!==K&&(a.domain_id=K),void 0!==P&&(a.number=P),T&&(a.direction=T),void 0!==O&&(a["answered_at.from"]=O),void 0!==I&&(a["answered_at.to"]=I),void 0!==k&&(a.missed=k),void 0!==W&&(a["stored_at.from"]=W),void 0!==E&&(a["stored_at.to"]=E),X&&(a.supervisor_id=X),x&&(a.state=x),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),j.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),j.headers),[2,{url:se.format(t),options:r}]}})})},searchHistoryCall:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I,k,W,E,X,x,j,U,Q,L,F,G,D,H,M,N,J,V,z,$,Y,Z,ee,te,ne,re,B){return void 0===B&&(B={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/calls/history",!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),B),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),void 0!==h&&(a["created_at.from"]=h),void 0!==p&&(a["created_at.to"]=p),f&&(a.user_id=f),g&&(a.agent_id=g),v&&(a.queue_id=v),y&&(a.team_id=y),b&&(a.member_id=b),w&&(a.gateway_id=w),void 0!==m&&(a["duration.from"]=m),void 0!==q&&(a["duration.to"]=q),void 0!==A&&(a.skip_parent=A),void 0!==C&&(a.parent_id=C),R&&(a.cause=R),void 0!==S&&(a.has_file=S),void 0!==K&&(a.domain_id=K),void 0!==P&&(a.number=P),void 0!==T&&(a.direction=T),void 0!==O&&(a["answered_at.from"]=O),void 0!==I&&(a["answered_at.to"]=I),void 0!==k&&(a.missed=k),void 0!==W&&(a["stored_at.from"]=W),void 0!==E&&(a["stored_at.to"]=E),X&&(a.id=X),x&&(a.transfer_from=x),j&&(a.transfer_to=j),void 0!==U&&(a.dependency_id=U),Q&&(a.tags=Q),L&&(a.amd_result=L),void 0!==F&&(a.fts=F),G&&(a.directions=G),void 0!==D&&(a.has_transcript=D),void 0!==H&&(a.agent_description=H),M&&(a.owner_id=M),N&&(a.grantee_id=N),J&&(a.amd_ai_result=J),void 0!==V&&(a["talk.from"]=V),void 0!==z&&(a["talk.to"]=z),void 0!==$&&(a.rated=$),Y&&(a.rated_by=Y),void 0!==Z&&(a["score_required.from"]=Z),void 0!==ee&&(a["score_required.to"]=ee),void 0!==te&&(a["score_optional.from"]=te),void 0!==ne&&(a["score_optional.to"]=ne),re&&(a.rated_user=re),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),B.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),B.headers),[2,{url:se.format(t),options:r}]}})})},searchHistoryCallPost:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling searchHistoryCallPost.");return(t=se.parse("/calls/history",!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},setVariablesCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling setVariablesCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling setVariablesCall.");return(t="/calls/active/{id}/variables".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},unHoldCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling unHoldCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling unHoldCall.");return(t="/calls/active/{id}/unhold".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},updateCallAnnotation:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("callId","Required parameter callId was null or undefined when calling updateCallAnnotation.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateCallAnnotation.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateCallAnnotation.");return(t="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function ne(Y){return{aggregateHistoryCall:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).aggregateHistoryCall(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},blindTransferCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).blindTransferCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},confirmPush:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).confirmPush(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createCall:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).createCall(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createCallAnnotation:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).createCallAnnotation(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCallAnnotation:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).deleteCallAnnotation(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},dtmfCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).dtmfCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},eavesdropCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).eavesdropCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},hangupCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).hangupCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},holdCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).holdCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchHistoryCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).patchHistoryCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).readCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchActiveCall:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).searchActiveCall(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchHistoryCall:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I,k,W,E,X,x,j,U,Q,L,F,G,B,D,H,M,N,J,V,z,$){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).searchHistoryCall(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I,k,W,E,X,x,j,U,Q,L,F,G,B,D,H,M,N,J,V,z,$)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchHistoryCallPost:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).searchHistoryCallPost(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},setVariablesCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).setVariablesCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},unHoldCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).unHoldCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCallAnnotation:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).updateCallAnnotation(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}me=e,ae.__extends(n,me),n.prototype.aggregateHistoryCall=function(e,t){var n=this;return ne(this.configuration).aggregateHistoryCall(e,t).then(function(e){return e(n.axios,n.basePath)})},n.prototype.blindTransferCall=function(e,t,n){var r=this;return ne(this.configuration).blindTransferCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.confirmPush=function(e,t){var n=this;return ne(this.configuration).confirmPush(e,t).then(function(e){return e(n.axios,n.basePath)})},n.prototype.createCall=function(e,t){var n=this;return ne(this.configuration).createCall(e,t).then(function(e){return e(n.axios,n.basePath)})},n.prototype.createCallAnnotation=function(e,t,n){var r=this;return ne(this.configuration).createCallAnnotation(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.deleteCallAnnotation=function(e,t,n){var r=this;return ne(this.configuration).deleteCallAnnotation(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.dtmfCall=function(e,t,n){var r=this;return ne(this.configuration).dtmfCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.eavesdropCall=function(e,t,n){var r=this;return ne(this.configuration).eavesdropCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.hangupCall=function(e,t,n){var r=this;return ne(this.configuration).hangupCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.holdCall=function(e,t,n){var r=this;return ne(this.configuration).holdCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.patchHistoryCall=function(e,t,n){var r=this;return ne(this.configuration).patchHistoryCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.readCall=function(e,t,n){var r=this;return ne(this.configuration).readCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.searchActiveCall=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T){var O=this;return ne(this.configuration).searchActiveCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T).then(function(e){return e(O.axios,O.basePath)})},n.prototype.searchHistoryCall=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I,k,W,E,x,j,U,Q,L,F,G,B,D,H,M,N,J,V,z){var X=this;return ne(this.configuration).searchHistoryCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I,k,W,E,x,j,U,Q,L,F,G,B,D,H,M,N,J,V,z).then(function(e){return e(X.axios,X.basePath)})},n.prototype.searchHistoryCallPost=function(e,t){var n=this;return ne(this.configuration).searchHistoryCallPost(e,t).then(function(e){return e(n.axios,n.basePath)})},n.prototype.setVariablesCall=function(e,t,n){var r=this;return ne(this.configuration).setVariablesCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.unHoldCall=function(e,t,n){var r=this;return ne(this.configuration).unHoldCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.updateCallAnnotation=function(e,t,n,r){var i=this;return ne(this.configuration).updateCallAnnotation(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var me,qe=n;function n(){return null!==me&&me.apply(this,arguments)||this}function Ae(_){var e=this;return{broadcast:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("profileId","Required parameter profileId was null or undefined when calling broadcast.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling broadcast.");return(t="/chat/bots/{profile_id}/broadcast".replace("{profile_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),_&&(n=_.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function Ce(a){return{broadcast:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ae(a).broadcast(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Re=e,ae.__extends(Ke,Re),Ke.prototype.broadcast=function(e,t,n){var r=this;return Ce(this.configuration).broadcast(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Re,Se=Ke;function Ke(){return null!==Re&&Re.apply(this,arguments)||this}function Pe(v){var e=this;return{createCognitiveProfile:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createCognitiveProfile.");return(t=se.parse("/storage/cognitive_profiles",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteCognitiveProfile:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},patchCognitiveProfile:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchCognitiveProfile.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readCognitiveProfile:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchCognitiveProfile:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/storage/cognitive_profiles",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.service=p),void 0!==f&&(a.enabled=f),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),g.headers),[2,{url:se.format(t),options:r}]}})})},updateCognitiveProfile:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateCognitiveProfile.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function Te(d){return{createCognitiveProfile:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Pe(d).createCognitiveProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCognitiveProfile:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Pe(d).deleteCognitiveProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchCognitiveProfile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Pe(d).patchCognitiveProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCognitiveProfile:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Pe(d).readCognitiveProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchCognitiveProfile:function(t,r,i,a,s,o,u,c,l){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Pe(d).searchCognitiveProfile(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCognitiveProfile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Pe(d).updateCognitiveProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Oe=e,ae.__extends(ke,Oe),ke.prototype.createCognitiveProfile=function(e,t){var n=this;return Te(this.configuration).createCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ke.prototype.deleteCognitiveProfile=function(e,t){var n=this;return Te(this.configuration).deleteCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ke.prototype.patchCognitiveProfile=function(e,t,n){var r=this;return Te(this.configuration).patchCognitiveProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ke.prototype.readCognitiveProfile=function(e,t){var n=this;return Te(this.configuration).readCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ke.prototype.searchCognitiveProfile=function(e,t,n,r,i,a,s,o,u){var c=this;return Te(this.configuration).searchCognitiveProfile(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},ke.prototype.updateCognitiveProfile=function(e,t,n){var r=this;return Te(this.configuration).updateCognitiveProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Oe,Ie=ke;function ke(){return null!==Oe&&Oe.apply(this,arguments)||this}function We(g){var e=this;return{createCommunicationType:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createCommunicationType.");return(t=se.parse("/call_center/communication_type",!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteCommunicationType:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteCommunicationType.");return(t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},readCommunicationType:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readCommunicationType.");return(t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchCommunicationType:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/communication_type",!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.channel=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},updateCommunicationType:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateCommunicationType.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateCommunicationType.");return(t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function Ee(l){return{createCommunicationType:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,We(l).createCommunicationType(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCommunicationType:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,We(l).deleteCommunicationType(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCommunicationType:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,We(l).readCommunicationType(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchCommunicationType:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,We(l).searchCommunicationType(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCommunicationType:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,We(l).updateCommunicationType(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Xe=e,ae.__extends(je,Xe),je.prototype.createCommunicationType=function(e,t){var n=this;return Ee(this.configuration).createCommunicationType(e,t).then(function(e){return e(n.axios,n.basePath)})},je.prototype.deleteCommunicationType=function(e,t,n){var r=this;return Ee(this.configuration).deleteCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})},je.prototype.readCommunicationType=function(e,t,n){var r=this;return Ee(this.configuration).readCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})},je.prototype.searchCommunicationType=function(e,t,n,r,i,a,s,o){var u=this;return Ee(this.configuration).searchCommunicationType(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},je.prototype.updateCommunicationType=function(e,t,n){var r=this;return Ee(this.configuration).updateCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Xe,xe=je;function je(){return null!==Xe&&Xe.apply(this,arguments)||this}function Ue(p){var e=this;return{createConfig:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createConfig.");return(t=se.parse("/logger/config",!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteConfig:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("configId","Required parameter configId was null or undefined when calling deleteConfig.");return(t="/logger/config/{config_id}".replace("{config_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},deleteConfigBulk:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling deleteConfigBulk.");return(t=se.parse("/logger/config",!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},patchConfig:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("configId","Required parameter configId was null or undefined when calling patchConfig.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchConfig.");return(t="/logger/config/{config_id}".replace("{config_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readConfig:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("configId","Required parameter configId was null or undefined when calling readConfig.");return(t="/logger/config/{config_id}".replace("{config_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},readSystemObjects:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/logger/available_objects",!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.include_existing=u),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchConfig:function(u,c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/logger/config",!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),h),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),[2,{url:se.format(t),options:r}]}})})},updateConfig:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("configId","Required parameter configId was null or undefined when calling updateConfig.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateConfig.");return(t="/logger/config/{config_id}".replace("{config_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function c(u){return{createConfig:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(u).createConfig(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteConfig:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(u).deleteConfig(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteConfigBulk:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(u).deleteConfigBulk(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchConfig:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(u).patchConfig(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readConfig:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(u).readConfig(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readSystemObjects:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(u).readSystemObjects(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchConfig:function(t,r,i,a,s,o){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(u).searchConfig(t,r,i,a,s,o)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateConfig:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(u).updateConfig(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Qe=e,ae.__extends(Fe,Qe),Fe.prototype.createConfig=function(e,t){var n=this;return c(this.configuration).createConfig(e,t).then(function(e){return e(n.axios,n.basePath)})},Fe.prototype.deleteConfig=function(e,t){var n=this;return c(this.configuration).deleteConfig(e,t).then(function(e){return e(n.axios,n.basePath)})},Fe.prototype.deleteConfigBulk=function(e,t){var n=this;return c(this.configuration).deleteConfigBulk(e,t).then(function(e){return e(n.axios,n.basePath)})},Fe.prototype.patchConfig=function(e,t,n){var r=this;return c(this.configuration).patchConfig(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Fe.prototype.readConfig=function(e,t){var n=this;return c(this.configuration).readConfig(e,t).then(function(e){return e(n.axios,n.basePath)})},Fe.prototype.readSystemObjects=function(e,t){var n=this;return c(this.configuration).readSystemObjects(e,t).then(function(e){return e(n.axios,n.basePath)})},Fe.prototype.searchConfig=function(e,t,n,r,i,a){var s=this;return c(this.configuration).searchConfig(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},Fe.prototype.updateConfig=function(e,t,n){var r=this;return c(this.configuration).updateConfig(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Qe,Le=Fe;function Fe(){return null!==Qe&&Qe.apply(this,arguments)||this}function Ge(v){var e=this;return{createContact:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("input","Required parameter input was null or undefined when calling createContact.");return(t=se.parse("/contacts",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return l&&(a.fields=l),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteContact:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("etag","Required parameter etag was null or undefined when calling deleteContact.");return(t="/contacts/{etag}".replace("{etag}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return c&&(a.fields=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},locateContact:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("etag","Required parameter etag was null or undefined when calling locateContact.");return(t="/contacts/{etag}".replace("{etag}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return c&&(a.fields=c),void 0!==l&&(a.mode=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},searchContacts:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/contacts",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.qin=p),void 0!==f&&(a.mode=f),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),g.headers),[2,{url:se.format(t),options:r}]}})})},updateContact:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("etag","Required parameter etag was null or undefined when calling updateContact.");if(null==l)throw new O("input","Required parameter input was null or undefined when calling updateContact.");return(t="/contacts/{etag}".replace("{etag}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),_),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return d&&(a.fields=d),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function Be(d){return{createContact:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ge(d).createContact(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteContact:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ge(d).deleteContact(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},locateContact:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ge(d).locateContact(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchContacts:function(t,r,i,a,s,o,u,c,l){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ge(d).searchContacts(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateContact:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ge(d).updateContact(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}De=e,ae.__extends(Me,De),Me.prototype.createContact=function(e,t,n){var r=this;return Be(this.configuration).createContact(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Me.prototype.deleteContact=function(e,t,n){var r=this;return Be(this.configuration).deleteContact(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Me.prototype.locateContact=function(e,t,n,r){var i=this;return Be(this.configuration).locateContact(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Me.prototype.searchContacts=function(e,t,n,r,i,a,s,o,u){var c=this;return Be(this.configuration).searchContacts(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},Me.prototype.updateContact=function(e,t,n,r){var i=this;return Be(this.configuration).updateContact(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var De,He=Me;function Me(){return null!==De&&De.apply(this,arguments)||this}function Ne(p){var e=this;return{createEmailProfile:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createEmailProfile.");return(t=se.parse("/email/profile",!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteEmailProfile:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},loginEmailProfile:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling loginEmailProfile.");return(t="/email/profile/{id}/login".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},patchEmailProfile:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchEmailProfile.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readEmailProfile:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchEmailProfile:function(u,c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/email/profile",!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),h),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),[2,{url:se.format(t),options:r}]}})})},testEmailProfile:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling testEmailProfile.");return(t="/email/profile/{id}/test".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},updateEmailProfile:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateEmailProfile.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function l(u){return{createEmailProfile:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(u).createEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteEmailProfile:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(u).deleteEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},loginEmailProfile:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(u).loginEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchEmailProfile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(u).patchEmailProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readEmailProfile:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(u).readEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchEmailProfile:function(t,r,i,a,s,o){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(u).searchEmailProfile(t,r,i,a,s,o)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},testEmailProfile:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(u).testEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateEmailProfile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(u).updateEmailProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Je=e,ae.__extends(ze,Je),ze.prototype.createEmailProfile=function(e,t){var n=this;return l(this.configuration).createEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ze.prototype.deleteEmailProfile=function(e,t){var n=this;return l(this.configuration).deleteEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ze.prototype.loginEmailProfile=function(e,t){var n=this;return l(this.configuration).loginEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ze.prototype.patchEmailProfile=function(e,t,n){var r=this;return l(this.configuration).patchEmailProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ze.prototype.readEmailProfile=function(e,t){var n=this;return l(this.configuration).readEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ze.prototype.searchEmailProfile=function(e,t,n,r,i,a){var s=this;return l(this.configuration).searchEmailProfile(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},ze.prototype.testEmailProfile=function(e,t){var n=this;return l(this.configuration).testEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ze.prototype.updateEmailProfile=function(e,t,n){var r=this;return l(this.configuration).updateEmailProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Je,Ve=ze;function ze(){return null!==Je&&Je.apply(this,arguments)||this}function $e(m){var e=this;return{deleteEmail:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling deleteEmail.");if(null==c)throw new O("etag","Required parameter etag was null or undefined when calling deleteEmail.");return(t="/contacts/{contact_id}/emails/{etag}".replace("{contact_id}",encodeURIComponent(String(u))).replace("{etag}",encodeURIComponent(String(c))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return l&&(a.fields=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},deleteEmails:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling deleteEmails.");if(null==c)throw new O("etag","Required parameter etag was null or undefined when calling deleteEmails.");return(t="/contacts/{contact_id}/emails".replace("{contact_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return l&&(a.fields=l),c&&(a.etag=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},listEmails:function(u,c,l,d,_,h,p,f,g,v,y,b,w){return void 0===w&&(w={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling listEmails.");return(t="/contacts/{contact_id}/emails".replace("{contact_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),w),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),void 0!==f&&(a.primary=f),void 0!==g&&(a.verified=g),void 0!==v&&(a["type.id"]=v),void 0!==y&&(a["type.type"]=y),void 0!==b&&(a["type.name"]=b),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),w.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),w.headers),[2,{url:se.format(t),options:r}]}})})},locateEmail:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling locateEmail.");if(null==c)throw new O("etag","Required parameter etag was null or undefined when calling locateEmail.");return(t="/contacts/{contact_id}/emails/{etag}".replace("{contact_id}",encodeURIComponent(String(u))).replace("{etag}",encodeURIComponent(String(c))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return l&&(a.fields=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},mergeEmails:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling mergeEmails.");if(null==l)throw new O("input","Required parameter input was null or undefined when calling mergeEmails.");return(t="/contacts/{contact_id}/emails".replace("{contact_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),_),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return d&&(a.fields=d),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},resetEmails:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling resetEmails.");if(null==l)throw new O("input","Required parameter input was null or undefined when calling resetEmails.");return(t="/contacts/{contact_id}/emails".replace("{contact_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return d&&(a.fields=d),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},updateEmail:function(c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling updateEmail.");if(null==l)throw new O("etag","Required parameter etag was null or undefined when calling updateEmail.");if(null==d)throw new O("input","Required parameter input was null or undefined when calling updateEmail.");return(t="/contacts/{contact_id}/emails/{etag}".replace("{contact_id}",encodeURIComponent(String(c))).replace("{etag}",encodeURIComponent(String(l))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),h),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return _&&(a.fields=_),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})},updateEmail2:function(c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling updateEmail2.");if(null==l)throw new O("etag","Required parameter etag was null or undefined when calling updateEmail2.");if(null==d)throw new O("input","Required parameter input was null or undefined when calling updateEmail2.");return(t="/contacts/{contact_id}/emails/{etag}".replace("{contact_id}",encodeURIComponent(String(c))).replace("{etag}",encodeURIComponent(String(l))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),h),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return _&&(a.fields=_),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function y(f){return{deleteEmail:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,$e(f).deleteEmail(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteEmails:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,$e(f).deleteEmails(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},listEmails:function(t,r,i,a,s,o,u,c,l,d,_,h,p){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,$e(f).listEmails(t,r,i,a,s,o,u,c,l,d,_,h,p)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},locateEmail:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,$e(f).locateEmail(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},mergeEmails:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,$e(f).mergeEmails(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},resetEmails:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,$e(f).resetEmails(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateEmail:function(t,r,i,a,s){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,$e(f).updateEmail(t,r,i,a,s)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateEmail2:function(t,r,i,a,s){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,$e(f).updateEmail2(t,r,i,a,s)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Ye=e,ae.__extends(et,Ye),et.prototype.deleteEmail=function(e,t,n,r){var i=this;return y(this.configuration).deleteEmail(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},et.prototype.deleteEmails=function(e,t,n,r){var i=this;return y(this.configuration).deleteEmails(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},et.prototype.listEmails=function(e,t,n,r,i,a,s,o,u,c,l,d,_){var h=this;return y(this.configuration).listEmails(e,t,n,r,i,a,s,o,u,c,l,d,_).then(function(e){return e(h.axios,h.basePath)})},et.prototype.locateEmail=function(e,t,n,r){var i=this;return y(this.configuration).locateEmail(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},et.prototype.mergeEmails=function(e,t,n,r){var i=this;return y(this.configuration).mergeEmails(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},et.prototype.resetEmails=function(e,t,n,r){var i=this;return y(this.configuration).resetEmails(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},et.prototype.updateEmail=function(e,t,n,r,i){var a=this;return y(this.configuration).updateEmail(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},et.prototype.updateEmail2=function(e,t,n,r,i){var a=this;return y(this.configuration).updateEmail2(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})};var Ye,Ze=et;function et(){return null!==Ye&&Ye.apply(this,arguments)||this}function tt(d){var e=this;return{deleteFiles:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling deleteFiles.");return(t=se.parse("/storage/file",!0),d&&(n=d.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},d&&d.apiKey)?"function"!=typeof d.apiKey?[3,2]:[4,d.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,d.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})}}}function nt(i){return{deleteFiles:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,tt(i).deleteFiles(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}rt=e,ae.__extends(at,rt),at.prototype.deleteFiles=function(e,t){var n=this;return nt(this.configuration).deleteFiles(e,t).then(function(e){return e(n.axios,n.basePath)})};var rt,it=at;function at(){return null!==rt&&rt.apply(this,arguments)||this}function st(_){var e=this;return{createFileTranscript:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createFileTranscript.");return(t=se.parse("/storage/transcript_file",!0),_&&(n=_.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteFileTranscript:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling deleteFileTranscript.");return(t=se.parse("/storage/transcript_file",!0),_&&(n=_.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},getFileTranscriptPhrases:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling getFileTranscriptPhrases.");return(t="/storage/transcript_file/{id}/phrases".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),_&&(n=_.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})}}}function ot(s){return{createFileTranscript:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,st(s).createFileTranscript(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteFileTranscript:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,st(s).deleteFileTranscript(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},getFileTranscriptPhrases:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,st(s).getFileTranscriptPhrases(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ut=e,ae.__extends(lt,ut),lt.prototype.createFileTranscript=function(e,t){var n=this;return ot(this.configuration).createFileTranscript(e,t).then(function(e){return e(n.axios,n.basePath)})},lt.prototype.deleteFileTranscript=function(e,t){var n=this;return ot(this.configuration).deleteFileTranscript(e,t).then(function(e){return e(n.axios,n.basePath)})},lt.prototype.getFileTranscriptPhrases=function(e,t,n,r){var i=this;return ot(this.configuration).getFileTranscriptPhrases(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var ut,ct=lt;function lt(){return null!==ut&&ut.apply(this,arguments)||this}function dt(f){var e=this;return{createImportTemplate:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createImportTemplate.");return(t=se.parse("/storage/import_templates",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteImportTemplate:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},patchImportTemplate:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchImportTemplate.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readImportTemplate:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchImportTemplate:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/storage/import_templates",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},updateImportTemplate:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateImportTemplate.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function _t(c){return{createImportTemplate:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,dt(c).createImportTemplate(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteImportTemplate:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,dt(c).deleteImportTemplate(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchImportTemplate:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,dt(c).patchImportTemplate(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readImportTemplate:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,dt(c).readImportTemplate(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchImportTemplate:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,dt(c).searchImportTemplate(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateImportTemplate:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,dt(c).updateImportTemplate(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ht=e,ae.__extends(ft,ht),ft.prototype.createImportTemplate=function(e,t){var n=this;return _t(this.configuration).createImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},ft.prototype.deleteImportTemplate=function(e,t){var n=this;return _t(this.configuration).deleteImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},ft.prototype.patchImportTemplate=function(e,t,n){var r=this;return _t(this.configuration).patchImportTemplate(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ft.prototype.readImportTemplate=function(e,t){var n=this;return _t(this.configuration).readImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},ft.prototype.searchImportTemplate=function(e,t,n,r,i,a,s){var o=this;return _t(this.configuration).searchImportTemplate(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},ft.prototype.updateImportTemplate=function(e,t,n){var r=this;return _t(this.configuration).updateImportTemplate(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var ht,pt=ft;function ft(){return null!==ht&&ht.apply(this,arguments)||this}function gt(g){var e=this;return{deleteLabels:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling deleteLabels.");if(null==c)throw new O("etag","Required parameter etag was null or undefined when calling deleteLabels.");return(t="/contacts/{contact_id}/labels".replace("{contact_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return l&&(a.fields=l),c&&(a.etag=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},getLabels:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/contacts/labels",!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},listLabels:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling listLabels.");return(t="/contacts/{contact_id}/labels".replace("{contact_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},mergeLabels:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling mergeLabels.");if(null==l)throw new O("input","Required parameter input was null or undefined when calling mergeLabels.");return(t="/contacts/{contact_id}/labels".replace("{contact_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return d&&(a.fields=d),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},resetLabels:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling resetLabels.");if(null==l)throw new O("input","Required parameter input was null or undefined when calling resetLabels.");return(t="/contacts/{contact_id}/labels".replace("{contact_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return d&&(a.fields=d),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function vt(l){return{deleteLabels:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,gt(l).deleteLabels(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},getLabels:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,gt(l).getLabels(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},listLabels:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,gt(l).listLabels(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},mergeLabels:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,gt(l).mergeLabels(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},resetLabels:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,gt(l).resetLabels(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}yt=e,ae.__extends(wt,yt),wt.prototype.deleteLabels=function(e,t,n,r){var i=this;return vt(this.configuration).deleteLabels(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},wt.prototype.getLabels=function(e,t,n,r){var i=this;return vt(this.configuration).getLabels(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},wt.prototype.listLabels=function(e,t,n,r,i,a,s,o){var u=this;return vt(this.configuration).listLabels(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},wt.prototype.mergeLabels=function(e,t,n,r){var i=this;return vt(this.configuration).mergeLabels(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},wt.prototype.resetLabels=function(e,t,n,r){var i=this;return vt(this.configuration).resetLabels(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var yt,bt=wt;function wt(){return null!==yt&&yt.apply(this,arguments)||this}function mt(y){var e=this;return{createList:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createList.");return(t=se.parse("/call_center/list",!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},createListCommunication:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("listId","Required parameter listId was null or undefined when calling createListCommunication.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createListCommunication.");return(t="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteList:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteList.");return(t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},deleteListCommunication:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("listId","Required parameter listId was null or undefined when calling deleteListCommunication.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteListCommunication.");return(t="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},readList:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readList.");return(t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},readListCommunication:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("listId","Required parameter listId was null or undefined when calling readListCommunication.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readListCommunication.");return(t="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},searchList:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/list",!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},searchListCommunication:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("listId","Required parameter listId was null or undefined when calling searchListCommunication.");return(t="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),v),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),void 0!==f&&(a["expire_at.from"]=f),void 0!==g&&(a["expire_at.to"]=g),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),v.headers),[2,{url:se.format(t),options:r}]}})})},updateList:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateList.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateList.");return(t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},updateListCommunication:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("listId","Required parameter listId was null or undefined when calling updateListCommunication.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateListCommunication.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateListCommunication.");return(t="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function h(_){return{createList:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).createList(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createListCommunication:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).createListCommunication(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteList:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).deleteList(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteListCommunication:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).deleteListCommunication(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readList:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).readList(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readListCommunication:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).readListCommunication(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchList:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).searchList(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchListCommunication:function(t,r,i,a,s,o,u,c,l,d){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).searchListCommunication(t,r,i,a,s,o,u,c,l,d)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateList:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).updateList(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateListCommunication:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).updateListCommunication(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}qt=e,ae.__extends(Ct,qt),Ct.prototype.createList=function(e,t){var n=this;return h(this.configuration).createList(e,t).then(function(e){return e(n.axios,n.basePath)})},Ct.prototype.createListCommunication=function(e,t,n){var r=this;return h(this.configuration).createListCommunication(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ct.prototype.deleteList=function(e,t,n){var r=this;return h(this.configuration).deleteList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ct.prototype.deleteListCommunication=function(e,t,n,r){var i=this;return h(this.configuration).deleteListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Ct.prototype.readList=function(e,t,n){var r=this;return h(this.configuration).readList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ct.prototype.readListCommunication=function(e,t,n,r){var i=this;return h(this.configuration).readListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Ct.prototype.searchList=function(e,t,n,r,i,a,s){var o=this;return h(this.configuration).searchList(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Ct.prototype.searchListCommunication=function(e,t,n,r,i,a,s,o,u,c){var l=this;return h(this.configuration).searchListCommunication(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},Ct.prototype.updateList=function(e,t,n){var r=this;return h(this.configuration).updateList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ct.prototype.updateListCommunication=function(e,t,n,r){var i=this;return h(this.configuration).updateListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var qt,At=Ct;function Ct(){return null!==qt&&qt.apply(this,arguments)||this}function Rt(m){var e=this;return{searchLogByConfigId:function(u,c,l,d,_,h,p,f,g,v,y,b,w){return void 0===w&&(w={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("configId","Required parameter configId was null or undefined when calling searchLogByConfigId.");return(t="/logger/config/{config_id}/logs".replace("{config_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),w),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),void 0!==p&&(a["user.id"]=p),void 0!==f&&(a["user.name"]=f),void 0!==g&&(a.action=g),void 0!==v&&(a.user_ip=v),void 0!==y&&(a.date_from=y),void 0!==b&&(a.date_to=b),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),w.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),w.headers),[2,{url:se.format(t),options:r}]}})})},searchLogByUserId:function(u,c,l,d,_,h,p,f,g,v,y,b,w){return void 0===w&&(w={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("userId","Required parameter userId was null or undefined when calling searchLogByUserId.");return(t="/logger/user/{user_id}/logs".replace("{user_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),w),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),void 0!==p&&(a["object.id"]=p),void 0!==f&&(a["object.name"]=f),void 0!==g&&(a.action=g),void 0!==v&&(a.user_ip=v),void 0!==y&&(a.date_from=y),void 0!==b&&(a.date_to=b),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),w.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),w.headers),[2,{url:se.format(t),options:r}]}})})}}}function St(f){return{searchLogByConfigId:function(t,r,i,a,s,o,u,c,l,d,_,h,p){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Rt(f).searchLogByConfigId(t,r,i,a,s,o,u,c,l,d,_,h,p)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchLogByUserId:function(t,r,i,a,s,o,u,c,l,d,_,h,p){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Rt(f).searchLogByUserId(t,r,i,a,s,o,u,c,l,d,_,h,p)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Kt=e,ae.__extends(Tt,Kt),Tt.prototype.searchLogByConfigId=function(e,t,n,r,i,a,s,o,u,c,l,d,_){var h=this;return St(this.configuration).searchLogByConfigId(e,t,n,r,i,a,s,o,u,c,l,d,_).then(function(e){return e(h.axios,h.basePath)})},Tt.prototype.searchLogByUserId=function(e,t,n,r,i,a,s,o,u,c,l,d,_){var h=this;return St(this.configuration).searchLogByUserId(e,t,n,r,i,a,s,o,u,c,l,d,_).then(function(e){return e(h.axios,h.basePath)})};var Kt,Pt=Tt;function Tt(){return null!==Kt&&Kt.apply(this,arguments)||this}function Ot(f){var e=this;return{deleteMediaFile:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteMediaFile.");return(t="/storage/media/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},readMediaFile:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readMediaFile.");return(t="/storage/media/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchMediaFile:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/storage/media",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})}}}function It(c){return{deleteMediaFile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ot(c).deleteMediaFile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readMediaFile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ot(c).readMediaFile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchMediaFile:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ot(c).searchMediaFile(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}kt=e,ae.__extends(Et,kt),Et.prototype.deleteMediaFile=function(e,t,n){var r=this;return It(this.configuration).deleteMediaFile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Et.prototype.readMediaFile=function(e,t,n){var r=this;return It(this.configuration).readMediaFile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Et.prototype.searchMediaFile=function(e,t,n,r,i,a,s){var o=this;return It(this.configuration).searchMediaFile(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})};var kt,Wt=Et;function Et(){return null!==kt&&kt.apply(this,arguments)||this}function R(T){var e=this;return{attemptCallback:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("attemptId","Required parameter attemptId was null or undefined when calling attemptCallback.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling attemptCallback.");return(t="/call_center/attempts/{attempt_id}".replace("{attempt_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},attemptResult:function(c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling attemptResult.");if(null==l)throw new O("memberId","Required parameter memberId was null or undefined when calling attemptResult.");if(null==d)throw new O("attemptId","Required parameter attemptId was null or undefined when calling attemptResult.");if(null==_)throw new O("body","Required parameter body was null or undefined when calling attemptResult.");return(t="/call_center/queues/{queue_id}/members/{member_id}/attempts/{attempt_id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{member_id}",encodeURIComponent(String(l))).replace("{attempt_id}",encodeURIComponent(String(d))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),h),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),u="string"!=typeof _||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:se.format(t),options:r}]}})})},attemptsRenewalResult:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("attemptId","Required parameter attemptId was null or undefined when calling attemptsRenewalResult.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling attemptsRenewalResult.");return(t="/call_center/queues/attempts/{attempt_id}/renewal".replace("{attempt_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},createAttempt:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createAttempt.");if(null==l)throw new O("memberId","Required parameter memberId was null or undefined when calling createAttempt.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling createAttempt.");return(t="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(c))).replace("{member_id}",encodeURIComponent(String(l))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),_),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})},createMember:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createMember.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createMember.");return(t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},createMemberBulk:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createMemberBulk.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createMemberBulk.");return(t="/call_center/queues/{queue_id}/members/bulk".replace("{queue_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteMember:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling deleteMember.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},deleteMembers:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling deleteMembers.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling deleteMembers.");return(t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},patchMember:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling patchMember.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling patchMember.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling patchMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),_),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})},readMember:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling readMember.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},resetMembers:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling resetMembers.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling resetMembers.");return(t="/call_center/queues/{queue_id}/members/reset".replace("{queue_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},searchAttempts:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K){return void 0===K&&(K={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/queues/attempts/active",!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),K),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),void 0!==h&&(a["joined_at.from"]=h),void 0!==p&&(a["joined_at.to"]=p),f&&(a.id=f),g&&(a.queue_id=g),v&&(a.bucket_id=v),y&&(a.member_id=y),b&&(a.agent_id=b),w&&(a.result=w),void 0!==m&&(a["leaving_at.from"]=m),void 0!==q&&(a["leaving_at.to"]=q),void 0!==A&&(a["offering_at.from"]=A),void 0!==C&&(a["offering_at.to"]=C),void 0!==R&&(a["duration.from"]=R),void 0!==S&&(a["duration.to"]=S),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),K.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),K.headers),[2,{url:se.format(t),options:r}]}})})},searchAttemptsHistory:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K){return void 0===K&&(K={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/queues/attempts/history",!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),K),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),void 0!==h&&(a["joined_at.from"]=h),void 0!==p&&(a["joined_at.to"]=p),f&&(a.id=f),g&&(a.queue_id=g),v&&(a.bucket_id=v),y&&(a.member_id=y),b&&(a.agent_id=b),w&&(a.result=w),void 0!==m&&(a["leaving_at.from"]=m),void 0!==q&&(a["leaving_at.to"]=q),void 0!==A&&(a["offering_at.from"]=A),void 0!==C&&(a["offering_at.to"]=C),void 0!==R&&(a["duration.from"]=R),void 0!==S&&(a["duration.to"]=S),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),K.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),K.headers),[2,{url:se.format(t),options:r}]}})})},searchMemberAttempts:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling searchMemberAttempts.");if(null==c)throw new O("memberId","Required parameter memberId was null or undefined when calling searchMemberAttempts.");return(t="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(u))).replace("{member_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},searchMemberInQueue:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P){return void 0===P&&(P={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling searchMemberInQueue.");return(t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),P),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),f&&(a.bucket_id=f),void 0!==g&&(a.destination=g),void 0!==v&&(a["created_at.from"]=v),void 0!==y&&(a["created_at.to"]=y),void 0!==b&&(a["offering_at.from"]=b),void 0!==w&&(a["offering_at.to"]=w),m&&(a.stop_cause=m),void 0!==q&&(a["priority.from"]=q),void 0!==A&&(a["priority.to"]=A),void 0!==C&&(a.name=C),void 0!==R&&(a["attempts.from"]=R),void 0!==S&&(a["attempts.to"]=S),K&&(a.agent_id=K),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),P.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),P.headers),[2,{url:se.format(t),options:r}]}})})},searchMembers:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P){return void 0===P&&(P={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/members",!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),P),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.queue_id=p),f&&(a.bucket_id=f),void 0!==g&&(a.destination=g),void 0!==v&&(a["created_at.from"]=v),void 0!==y&&(a["created_at.to"]=y),void 0!==b&&(a["offering_at.from"]=b),void 0!==w&&(a["offering_at.to"]=w),m&&(a.stop_cause=m),void 0!==q&&(a["priority.from"]=q),void 0!==A&&(a["priority.to"]=A),void 0!==C&&(a.name=C),void 0!==R&&(a["attempts.from"]=R),void 0!==S&&(a["attempts.to"]=S),K&&(a.agent_id=K),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),P.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),P.headers),[2,{url:se.format(t),options:r}]}})})},updateMember:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling updateMember.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateMember.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function S(A){return{attemptCallback:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).attemptCallback(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},attemptResult:function(t,r,i,a,s){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).attemptResult(t,r,i,a,s)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},attemptsRenewalResult:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).attemptsRenewalResult(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createAttempt:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).createAttempt(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createMember:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).createMember(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createMemberBulk:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).createMemberBulk(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteMember:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).deleteMember(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteMembers:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).deleteMembers(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchMember:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).patchMember(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readMember:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).readMember(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},resetMembers:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).resetMembers(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAttempts:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).searchAttempts(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAttemptsHistory:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).searchAttemptsHistory(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchMemberAttempts:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).searchMemberAttempts(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchMemberInQueue:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).searchMemberInQueue(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchMembers:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).searchMembers(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateMember:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).updateMember(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Xt=e,ae.__extends(r,Xt),r.prototype.attemptCallback=function(e,t,n){var r=this;return S(this.configuration).attemptCallback(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.attemptResult=function(e,t,n,r,i){var a=this;return S(this.configuration).attemptResult(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},r.prototype.attemptsRenewalResult=function(e,t,n){var r=this;return S(this.configuration).attemptsRenewalResult(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.createAttempt=function(e,t,n,r){var i=this;return S(this.configuration).createAttempt(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.createMember=function(e,t,n){var r=this;return S(this.configuration).createMember(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.createMemberBulk=function(e,t,n){var r=this;return S(this.configuration).createMemberBulk(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.deleteMember=function(e,t,n,r){var i=this;return S(this.configuration).deleteMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.deleteMembers=function(e,t,n){var r=this;return S(this.configuration).deleteMembers(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.patchMember=function(e,t,n,r){var i=this;return S(this.configuration).patchMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.readMember=function(e,t,n,r){var i=this;return S(this.configuration).readMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.resetMembers=function(e,t,n){var r=this;return S(this.configuration).resetMembers(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.searchAttempts=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b){var w=this;return S(this.configuration).searchAttempts(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b).then(function(e){return e(w.axios,w.basePath)})},r.prototype.searchAttemptsHistory=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b){var w=this;return S(this.configuration).searchAttemptsHistory(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b).then(function(e){return e(w.axios,w.basePath)})},r.prototype.searchMemberAttempts=function(e,t,n,r){var i=this;return S(this.configuration).searchMemberAttempts(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.searchMemberInQueue=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){var m=this;return S(this.configuration).searchMemberInQueue(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w).then(function(e){return e(m.axios,m.basePath)})},r.prototype.searchMembers=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){var m=this;return S(this.configuration).searchMembers(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w).then(function(e){return e(m.axios,m.basePath)})},r.prototype.updateMember=function(e,t,n,r){var i=this;return S(this.configuration).updateMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var Xt,xt=r;function r(){return null!==Xt&&Xt.apply(this,arguments)||this}function jt(g){var e=this;return{createOutboundResourceGroup:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createOutboundResourceGroup.");return(t=se.parse("/call_center/resource_group",!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},createOutboundResourceInGroup:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("groupId","Required parameter groupId was null or undefined when calling createOutboundResourceInGroup.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteOutboundResourceGroup:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteOutboundResourceGroup.");return(t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},deleteOutboundResourceInGroup:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("groupId","Required parameter groupId was null or undefined when calling deleteOutboundResourceInGroup.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},readOutboundResourceGroup:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readOutboundResourceGroup.");return(t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},readOutboundResourceInGroup:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("groupId","Required parameter groupId was null or undefined when calling readOutboundResourceInGroup.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},searchOutboundResourceGroup:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/resource_group",!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},searchOutboundResourceInGroup:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("groupId","Required parameter groupId was null or undefined when calling searchOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},updateOutboundResourceGroup:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateOutboundResourceGroup.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateOutboundResourceGroup.");return(t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},updateOutboundResourceInGroup:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("groupId","Required parameter groupId was null or undefined when calling updateOutboundResourceInGroup.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateOutboundResourceInGroup.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function d(l){return{createOutboundResourceGroup:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,jt(l).createOutboundResourceGroup(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createOutboundResourceInGroup:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,jt(l).createOutboundResourceInGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResourceGroup:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,jt(l).deleteOutboundResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResourceInGroup:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,jt(l).deleteOutboundResourceInGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResourceGroup:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,jt(l).readOutboundResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResourceInGroup:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,jt(l).readOutboundResourceInGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResourceGroup:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,jt(l).searchOutboundResourceGroup(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResourceInGroup:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,jt(l).searchOutboundResourceInGroup(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResourceGroup:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,jt(l).updateOutboundResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResourceInGroup:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,jt(l).updateOutboundResourceInGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Ut=e,ae.__extends(Lt,Ut),Lt.prototype.createOutboundResourceGroup=function(e,t){var n=this;return d(this.configuration).createOutboundResourceGroup(e,t).then(function(e){return e(n.axios,n.basePath)})},Lt.prototype.createOutboundResourceInGroup=function(e,t,n){var r=this;return d(this.configuration).createOutboundResourceInGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Lt.prototype.deleteOutboundResourceGroup=function(e,t,n){var r=this;return d(this.configuration).deleteOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Lt.prototype.deleteOutboundResourceInGroup=function(e,t,n,r){var i=this;return d(this.configuration).deleteOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Lt.prototype.readOutboundResourceGroup=function(e,t,n){var r=this;return d(this.configuration).readOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Lt.prototype.readOutboundResourceInGroup=function(e,t,n,r){var i=this;return d(this.configuration).readOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Lt.prototype.searchOutboundResourceGroup=function(e,t,n,r,i,a,s){var o=this;return d(this.configuration).searchOutboundResourceGroup(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Lt.prototype.searchOutboundResourceInGroup=function(e,t,n,r,i,a,s,o){var u=this;return d(this.configuration).searchOutboundResourceInGroup(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},Lt.prototype.updateOutboundResourceGroup=function(e,t,n){var r=this;return d(this.configuration).updateOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Lt.prototype.updateOutboundResourceInGroup=function(e,t,n,r){var i=this;return d(this.configuration).updateOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var Ut,Qt=Lt;function Lt(){return null!==Ut&&Ut.apply(this,arguments)||this}function Ft(g){var e=this;return{createOutboundResource:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createOutboundResource.");return(t=se.parse("/call_center/resources",!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},createOutboundResourceDisplay:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("resourceId","Required parameter resourceId was null or undefined when calling createOutboundResourceDisplay.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},createOutboundResourceDisplayBulk:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("resourceId","Required parameter resourceId was null or undefined when calling createOutboundResourceDisplayBulk.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createOutboundResourceDisplayBulk.");return(t="/call_center/resources/{resource_id}/display/bulk".replace("{resource_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteOutboundResource:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},deleteOutboundResourceDisplay:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("resourceId","Required parameter resourceId was null or undefined when calling deleteOutboundResourceDisplay.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},deleteOutboundResourceDisplays:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("resourceId","Required parameter resourceId was null or undefined when calling deleteOutboundResourceDisplays.");return(t="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return c&&(a.items=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},patchOutboundResource:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchOutboundResource.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readOutboundResource:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},readOutboundResourceDisplay:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("resourceId","Required parameter resourceId was null or undefined when calling readOutboundResourceDisplay.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},searchOutboundResource:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/resources",!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},searchOutboundResourceDisplay:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("resourceId","Required parameter resourceId was null or undefined when calling searchOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},updateOutboundResource:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateOutboundResource.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},updateOutboundResourceDisplay:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("resourceId","Required parameter resourceId was null or undefined when calling updateOutboundResourceDisplay.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateOutboundResourceDisplay.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function p(l){return{createOutboundResource:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ft(l).createOutboundResource(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createOutboundResourceDisplay:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ft(l).createOutboundResourceDisplay(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createOutboundResourceDisplayBulk:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ft(l).createOutboundResourceDisplayBulk(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResource:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ft(l).deleteOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResourceDisplay:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ft(l).deleteOutboundResourceDisplay(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResourceDisplays:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ft(l).deleteOutboundResourceDisplays(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchOutboundResource:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ft(l).patchOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResource:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ft(l).readOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResourceDisplay:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ft(l).readOutboundResourceDisplay(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResource:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ft(l).searchOutboundResource(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResourceDisplay:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ft(l).searchOutboundResourceDisplay(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResource:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ft(l).updateOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResourceDisplay:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ft(l).updateOutboundResourceDisplay(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Gt=e,ae.__extends(i,Gt),i.prototype.createOutboundResource=function(e,t){var n=this;return p(this.configuration).createOutboundResource(e,t).then(function(e){return e(n.axios,n.basePath)})},i.prototype.createOutboundResourceDisplay=function(e,t,n){var r=this;return p(this.configuration).createOutboundResourceDisplay(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.createOutboundResourceDisplayBulk=function(e,t,n){var r=this;return p(this.configuration).createOutboundResourceDisplayBulk(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.deleteOutboundResource=function(e,t,n){var r=this;return p(this.configuration).deleteOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.deleteOutboundResourceDisplay=function(e,t,n,r){var i=this;return p(this.configuration).deleteOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},i.prototype.deleteOutboundResourceDisplays=function(e,t,n){var r=this;return p(this.configuration).deleteOutboundResourceDisplays(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.patchOutboundResource=function(e,t,n){var r=this;return p(this.configuration).patchOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.readOutboundResource=function(e,t,n){var r=this;return p(this.configuration).readOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.readOutboundResourceDisplay=function(e,t,n,r){var i=this;return p(this.configuration).readOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},i.prototype.searchOutboundResource=function(e,t,n,r,i,a,s){var o=this;return p(this.configuration).searchOutboundResource(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},i.prototype.searchOutboundResourceDisplay=function(e,t,n,r,i,a,s,o){var u=this;return p(this.configuration).searchOutboundResourceDisplay(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},i.prototype.updateOutboundResource=function(e,t,n){var r=this;return p(this.configuration).updateOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.updateOutboundResourceDisplay=function(e,t,n,r){var i=this;return p(this.configuration).updateOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var Gt,Bt=i;function i(){return null!==Gt&&Gt.apply(this,arguments)||this}function Dt(g){var e=this;return{createPresetQuery:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createPresetQuery.");return(t=se.parse("/call_center/preset/query",!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deletePresetQuery:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deletePresetQuery.");return(t="/call_center/preset/query/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},patchPresetQuery:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchPresetQuery.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchPresetQuery.");return(t="/call_center/preset/query/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readPresetQuery:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readPresetQuery.");return(t="/call_center/preset/query/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchPresetQuery:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/preset/query",!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.section=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},updatePresetQuery:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updatePresetQuery.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updatePresetQuery.");return(t="/call_center/preset/query/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function Ht(l){return{createPresetQuery:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(l).createPresetQuery(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deletePresetQuery:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(l).deletePresetQuery(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchPresetQuery:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(l).patchPresetQuery(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readPresetQuery:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(l).readPresetQuery(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchPresetQuery:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(l).searchPresetQuery(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updatePresetQuery:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(l).updatePresetQuery(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Mt=e,ae.__extends(Jt,Mt),Jt.prototype.createPresetQuery=function(e,t){var n=this;return Ht(this.configuration).createPresetQuery(e,t).then(function(e){return e(n.axios,n.basePath)})},Jt.prototype.deletePresetQuery=function(e,t){var n=this;return Ht(this.configuration).deletePresetQuery(e,t).then(function(e){return e(n.axios,n.basePath)})},Jt.prototype.patchPresetQuery=function(e,t,n){var r=this;return Ht(this.configuration).patchPresetQuery(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Jt.prototype.readPresetQuery=function(e,t){var n=this;return Ht(this.configuration).readPresetQuery(e,t).then(function(e){return e(n.axios,n.basePath)})},Jt.prototype.searchPresetQuery=function(e,t,n,r,i,a,s,o){var u=this;return Ht(this.configuration).searchPresetQuery(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},Jt.prototype.updatePresetQuery=function(e,t,n){var r=this;return Ht(this.configuration).updatePresetQuery(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Mt,Nt=Jt;function Jt(){return null!==Mt&&Mt.apply(this,arguments)||this}function Vt(g){var e=this;return{createQueueBucket:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createQueueBucket.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteQueueBucket:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling deleteQueueBucket.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},patchQueueBucket:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling patchQueueBucket.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling patchQueueBucket.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling patchQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})},readQueueBucket:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling readQueueBucket.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchQueueBucket:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling searchQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},updateQueueBucket:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling updateQueueBucket.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateQueueBucket.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function zt(l){return{createQueueBucket:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Vt(l).createQueueBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueBucket:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Vt(l).deleteQueueBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueueBucket:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Vt(l).patchQueueBucket(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueBucket:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Vt(l).readQueueBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueBucket:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Vt(l).searchQueueBucket(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueBucket:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Vt(l).updateQueueBucket(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}$t=e,ae.__extends(Zt,$t),Zt.prototype.createQueueBucket=function(e,t,n){var r=this;return zt(this.configuration).createQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Zt.prototype.deleteQueueBucket=function(e,t,n){var r=this;return zt(this.configuration).deleteQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Zt.prototype.patchQueueBucket=function(e,t,n,r){var i=this;return zt(this.configuration).patchQueueBucket(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Zt.prototype.readQueueBucket=function(e,t,n){var r=this;return zt(this.configuration).readQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Zt.prototype.searchQueueBucket=function(e,t,n,r,i,a,s,o){var u=this;return zt(this.configuration).searchQueueBucket(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},Zt.prototype.updateQueueBucket=function(e,t,n,r){var i=this;return zt(this.configuration).updateQueueBucket(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var $t,Yt=Zt;function Zt(){return null!==$t&&$t.apply(this,arguments)||this}function en(y){var e=this;return{createQueueHook:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createQueueHook.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createQueueHook.");return(t="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteQueueHook:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling deleteQueueHook.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},patchQueueHook:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling patchQueueHook.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling patchQueueHook.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling patchQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),_),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})},readQueueHook:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling readQueueHook.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchQueueHook:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling searchQueueHook.");return(t="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),v),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),f&&(a.schema_id=f),g&&(a.event=g),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),v.headers),[2,{url:se.format(t),options:r}]}})})},updateQueueHook:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling updateQueueHook.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateQueueHook.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function tn(_){return{createQueueHook:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,en(_).createQueueHook(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueHook:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,en(_).deleteQueueHook(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueueHook:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,en(_).patchQueueHook(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueHook:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,en(_).readQueueHook(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueHook:function(t,r,i,a,s,o,u,c,l,d){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,en(_).searchQueueHook(t,r,i,a,s,o,u,c,l,d)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueHook:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,en(_).updateQueueHook(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}nn=e,ae.__extends(an,nn),an.prototype.createQueueHook=function(e,t,n){var r=this;return tn(this.configuration).createQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},an.prototype.deleteQueueHook=function(e,t,n){var r=this;return tn(this.configuration).deleteQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},an.prototype.patchQueueHook=function(e,t,n,r){var i=this;return tn(this.configuration).patchQueueHook(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},an.prototype.readQueueHook=function(e,t,n){var r=this;return tn(this.configuration).readQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},an.prototype.searchQueueHook=function(e,t,n,r,i,a,s,o,u,c){var l=this;return tn(this.configuration).searchQueueHook(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},an.prototype.updateQueueHook=function(e,t,n,r){var i=this;return tn(this.configuration).updateQueueHook(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var nn,rn=an;function an(){return null!==nn&&nn.apply(this,arguments)||this}function sn(g){var e=this;return{createQueueResourceGroup:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createQueueResourceGroup.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteQueueResourceGroup:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling deleteQueueResourceGroup.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},readQueueResourceGroup:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling readQueueResourceGroup.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},searchQueueResourceGroup:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling searchQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},updateQueueResourceGroup:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling updateQueueResourceGroup.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateQueueResourceGroup.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function on(l){return{createQueueResourceGroup:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,sn(l).createQueueResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueResourceGroup:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,sn(l).deleteQueueResourceGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueResourceGroup:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,sn(l).readQueueResourceGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueResourceGroup:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,sn(l).searchQueueResourceGroup(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueResourceGroup:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,sn(l).updateQueueResourceGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}un=e,ae.__extends(ln,un),ln.prototype.createQueueResourceGroup=function(e,t,n){var r=this;return on(this.configuration).createQueueResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ln.prototype.deleteQueueResourceGroup=function(e,t,n,r){var i=this;return on(this.configuration).deleteQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},ln.prototype.readQueueResourceGroup=function(e,t,n,r){var i=this;return on(this.configuration).readQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},ln.prototype.searchQueueResourceGroup=function(e,t,n,r,i,a,s,o){var u=this;return on(this.configuration).searchQueueResourceGroup(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},ln.prototype.updateQueueResourceGroup=function(e,t,n,r){var i=this;return on(this.configuration).updateQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var un,cn=ln;function ln(){return null!==un&&un.apply(this,arguments)||this}function dn(w){var e=this;return{createQueue:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createQueue.");return(t=se.parse("/call_center/queues",!0),w&&(n=w.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteQueue:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),w&&(n=w.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},patchQueue:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchQueue.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),w&&(n=w.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readQueue:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),w&&(n=w.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchQueue:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/queues",!0),w&&(n=w.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.type=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},searchQueueReportGeneral:function(u,c,l,d,_,h,p,f,g,v,y,b){return void 0===b&&(b={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/queues/reports/general",!0),w&&(n=w.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),b),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a["joined_at.from"]=l),void 0!==d&&(a["joined_at.to"]=d),void 0!==_&&(a.domain_id=_),h&&(a.fields=h),void 0!==p&&(a.sort=p),void 0!==f&&(a.q=f),g&&(a.queue_id=g),v&&(a.team_id=v),y&&(a.type=y),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),b.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),b.headers),[2,{url:se.format(t),options:r}]}})})},updateQueue:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateQueue.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),w&&(n=w.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function f(p){return{createQueue:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,dn(p).createQueue(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueue:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,dn(p).deleteQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueue:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,dn(p).patchQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueue:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,dn(p).readQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueue:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,dn(p).searchQueue(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueReportGeneral:function(t,r,i,a,s,o,u,c,l,d,_,h){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,dn(p).searchQueueReportGeneral(t,r,i,a,s,o,u,c,l,d,_,h)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueue:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,dn(p).updateQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}_n=e,ae.__extends(pn,_n),pn.prototype.createQueue=function(e,t){var n=this;return f(this.configuration).createQueue(e,t).then(function(e){return e(n.axios,n.basePath)})},pn.prototype.deleteQueue=function(e,t,n){var r=this;return f(this.configuration).deleteQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},pn.prototype.patchQueue=function(e,t,n){var r=this;return f(this.configuration).patchQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},pn.prototype.readQueue=function(e,t,n){var r=this;return f(this.configuration).readQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},pn.prototype.searchQueue=function(e,t,n,r,i,a,s,o){var u=this;return f(this.configuration).searchQueue(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},pn.prototype.searchQueueReportGeneral=function(e,t,n,r,i,a,s,o,u,c,l,d){var _=this;return f(this.configuration).searchQueueReportGeneral(e,t,n,r,i,a,s,o,u,c,l,d).then(function(e){return e(_.axios,_.basePath)})},pn.prototype.updateQueue=function(e,t,n){var r=this;return f(this.configuration).updateQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var _n,hn=pn;function pn(){return null!==_n&&_n.apply(this,arguments)||this}function fn(q){var e=this;return{createQueueSkill:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createQueueSkill.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createQueueSkill.");return(t="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteQueueSkill:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling deleteQueueSkill.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},patchQueueSkill:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling patchQueueSkill.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling patchQueueSkill.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling patchQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),_),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})},readQueueSkill:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling readQueueSkill.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchQueueSkill:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m){return void 0===m&&(m={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling searchQueueSkill.");return(t="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),m),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),f&&(a.skill_id=f),g&&(a.bucket_id=g),v&&(a.lvl=v),y&&(a.min_capacity=y),b&&(a.max_capacity=b),void 0!==w&&(a.enabled=w),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),m.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),m.headers),[2,{url:se.format(t),options:r}]}})})},updateQueueSkill:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling updateQueueSkill.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateQueueSkill.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function gn(g){return{createQueueSkill:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,fn(g).createQueueSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueSkill:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,fn(g).deleteQueueSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueueSkill:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,fn(g).patchQueueSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueSkill:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,fn(g).readQueueSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueSkill:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,fn(g).searchQueueSkill(t,r,i,a,s,o,u,c,l,d,_,h,p,f)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueSkill:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,fn(g).updateQueueSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}vn=e,ae.__extends(bn,vn),bn.prototype.createQueueSkill=function(e,t,n){var r=this;return gn(this.configuration).createQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},bn.prototype.deleteQueueSkill=function(e,t,n){var r=this;return gn(this.configuration).deleteQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},bn.prototype.patchQueueSkill=function(e,t,n,r){var i=this;return gn(this.configuration).patchQueueSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},bn.prototype.readQueueSkill=function(e,t,n){var r=this;return gn(this.configuration).readQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},bn.prototype.searchQueueSkill=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){var p=this;return gn(this.configuration).searchQueueSkill(e,t,n,r,i,a,s,o,u,c,l,d,_,h).then(function(e){return e(p.axios,p.basePath)})},bn.prototype.updateQueueSkill=function(e,t,n,r){var i=this;return gn(this.configuration).updateQueueSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var vn,yn=bn;function bn(){return null!==vn&&vn.apply(this,arguments)||this}function wn(y){var e=this;return{createRegion:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createRegion.");return(t=se.parse("/regions",!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteRegion:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},patchRegion:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchRegion.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readRegion:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchRegion:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/regions",!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),v),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),void 0!==f&&(a.description=f),g&&(a.timezone_id=g),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),v.headers),[2,{url:se.format(t),options:r}]}})})},updateRegion:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateRegion.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function mn(_){return{createRegion:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,wn(_).createRegion(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRegion:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,wn(_).deleteRegion(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchRegion:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,wn(_).patchRegion(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRegion:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,wn(_).readRegion(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRegion:function(t,r,i,a,s,o,u,c,l,d){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,wn(_).searchRegion(t,r,i,a,s,o,u,c,l,d)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRegion:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,wn(_).updateRegion(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}qn=e,ae.__extends(Cn,qn),Cn.prototype.createRegion=function(e,t){var n=this;return mn(this.configuration).createRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},Cn.prototype.deleteRegion=function(e,t){var n=this;return mn(this.configuration).deleteRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},Cn.prototype.patchRegion=function(e,t,n){var r=this;return mn(this.configuration).patchRegion(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Cn.prototype.readRegion=function(e,t){var n=this;return mn(this.configuration).readRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},Cn.prototype.searchRegion=function(e,t,n,r,i,a,s,o,u,c){var l=this;return mn(this.configuration).searchRegion(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},Cn.prototype.updateRegion=function(e,t,n){var r=this;return mn(this.configuration).updateRegion(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var qn,An=Cn;function Cn(){return null!==qn&&qn.apply(this,arguments)||this}function Rn(v){var e=this;return{createChatPlan:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createChatPlan.");return(t=se.parse("/routing/outbound/chat",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteChatPlan:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},patchChatPlan:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchChatPlan.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readChatPlan:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchChatPlan:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/routing/outbound/chat",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),void 0!==f&&(a.enabled=f),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),g.headers),[2,{url:se.format(t),options:r}]}})})},updateChatPlan:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateChatPlan.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function Sn(d){return{createChatPlan:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Rn(d).createChatPlan(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteChatPlan:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Rn(d).deleteChatPlan(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchChatPlan:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Rn(d).patchChatPlan(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readChatPlan:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Rn(d).readChatPlan(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchChatPlan:function(t,r,i,a,s,o,u,c,l){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Rn(d).searchChatPlan(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateChatPlan:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Rn(d).updateChatPlan(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Kn=e,ae.__extends(Tn,Kn),Tn.prototype.createChatPlan=function(e,t){var n=this;return Sn(this.configuration).createChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},Tn.prototype.deleteChatPlan=function(e,t){var n=this;return Sn(this.configuration).deleteChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},Tn.prototype.patchChatPlan=function(e,t,n){var r=this;return Sn(this.configuration).patchChatPlan(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Tn.prototype.readChatPlan=function(e,t){var n=this;return Sn(this.configuration).readChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},Tn.prototype.searchChatPlan=function(e,t,n,r,i,a,s,o,u){var c=this;return Sn(this.configuration).searchChatPlan(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},Tn.prototype.updateChatPlan=function(e,t,n){var r=this;return Sn(this.configuration).updateChatPlan(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Kn,Pn=Tn;function Tn(){return null!==Kn&&Kn.apply(this,arguments)||this}function On(b){var e=this;return{createRoutingOutboundCall:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createRoutingOutboundCall.");return(t=se.parse("/routing/outbound/calls",!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteRoutingOutboundCall:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},movePositionRoutingOutboundCall:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("fromId","Required parameter fromId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==l)throw new O("toId","Required parameter toId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling movePositionRoutingOutboundCall.");return(t="/routing/outbound/calls/{from_id}/to/{to_id}".replace("{from_id}",encodeURIComponent(String(c))).replace("{to_id}",encodeURIComponent(String(l))),t=se.parse(t,!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),_),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})},patchRoutingOutboundCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchRoutingOutboundCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readRoutingOutboundCall:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchRoutingOutboundCall:function(u,c,l,d,_,h,p,f,g,v,y){return void 0===y&&(y={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/routing/outbound/calls",!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),y),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),f&&(a.schema_id=f),void 0!==g&&(a.pattern=g),void 0!==v&&(a.description=v),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),y.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),y.headers),[2,{url:se.format(t),options:r}]}})})},updateRoutingOutboundCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateRoutingOutboundCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function b(h){return{createRoutingOutboundCall:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,On(h).createRoutingOutboundCall(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRoutingOutboundCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,On(h).deleteRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},movePositionRoutingOutboundCall:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,On(h).movePositionRoutingOutboundCall(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchRoutingOutboundCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,On(h).patchRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRoutingOutboundCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,On(h).readRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRoutingOutboundCall:function(t,r,i,a,s,o,u,c,l,d,_){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,On(h).searchRoutingOutboundCall(t,r,i,a,s,o,u,c,l,d,_)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRoutingOutboundCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,On(h).updateRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}In=e,ae.__extends(Wn,In),Wn.prototype.createRoutingOutboundCall=function(e,t){var n=this;return b(this.configuration).createRoutingOutboundCall(e,t).then(function(e){return e(n.axios,n.basePath)})},Wn.prototype.deleteRoutingOutboundCall=function(e,t,n){var r=this;return b(this.configuration).deleteRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Wn.prototype.movePositionRoutingOutboundCall=function(e,t,n,r){var i=this;return b(this.configuration).movePositionRoutingOutboundCall(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Wn.prototype.patchRoutingOutboundCall=function(e,t,n){var r=this;return b(this.configuration).patchRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Wn.prototype.readRoutingOutboundCall=function(e,t,n){var r=this;return b(this.configuration).readRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Wn.prototype.searchRoutingOutboundCall=function(e,t,n,r,i,a,s,o,u,c,l){var d=this;return b(this.configuration).searchRoutingOutboundCall(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(d.axios,d.basePath)})},Wn.prototype.updateRoutingOutboundCall=function(e,t,n){var r=this;return b(this.configuration).updateRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var In,kn=Wn;function Wn(){return null!==In&&In.apply(this,arguments)||this}function En(b){var e=this;return{createRoutingSchema:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createRoutingSchema.");return(t=se.parse("/routing/schema",!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteRoutingSchema:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},patchRoutingSchema:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchRoutingSchema.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readRoutingSchema:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchRoutingSchema:function(u,c,l,d,_,h,p,f,g,v,y){return void 0===y&&(y={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/routing/schema",!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),y),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),f&&(a.type=f),void 0!==g&&(a.editor=g),v&&(a.tags=v),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),y.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),y.headers),[2,{url:se.format(t),options:r}]}})})},searchRoutingSchemaTags:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/routing/schema/tags",!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.type=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},updateRoutingSchema:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateRoutingSchema.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function Xn(h){return{createRoutingSchema:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,En(h).createRoutingSchema(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRoutingSchema:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,En(h).deleteRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchRoutingSchema:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,En(h).patchRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRoutingSchema:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,En(h).readRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRoutingSchema:function(t,r,i,a,s,o,u,c,l,d,_){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,En(h).searchRoutingSchema(t,r,i,a,s,o,u,c,l,d,_)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRoutingSchemaTags:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,En(h).searchRoutingSchemaTags(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRoutingSchema:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,En(h).updateRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}xn=e,ae.__extends(Un,xn),Un.prototype.createRoutingSchema=function(e,t){var n=this;return Xn(this.configuration).createRoutingSchema(e,t).then(function(e){return e(n.axios,n.basePath)})},Un.prototype.deleteRoutingSchema=function(e,t,n){var r=this;return Xn(this.configuration).deleteRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Un.prototype.patchRoutingSchema=function(e,t,n){var r=this;return Xn(this.configuration).patchRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Un.prototype.readRoutingSchema=function(e,t,n){var r=this;return Xn(this.configuration).readRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Un.prototype.searchRoutingSchema=function(e,t,n,r,i,a,s,o,u,c,l){var d=this;return Xn(this.configuration).searchRoutingSchema(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(d.axios,d.basePath)})},Un.prototype.searchRoutingSchemaTags=function(e,t,n,r,i,a,s){var o=this;return Xn(this.configuration).searchRoutingSchemaTags(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Un.prototype.updateRoutingSchema=function(e,t,n){var r=this;return Xn(this.configuration).updateRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var xn,jn=Un;function Un(){return null!==xn&&xn.apply(this,arguments)||this}function Qn(_){var e=this;return{createRoutingVariable:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createRoutingVariable.");return(t=se.parse("/routing/variables",!0),_&&(n=_.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteRoutingVariable:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteRoutingVariable.");return(t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),_&&(n=_.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},readRoutingVariable:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readRoutingVariable.");return(t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),_&&(n=_.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchRoutingVariable:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/routing/variables",!0),_&&(n=_.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},updateRoutingVariable:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateRoutingVariable.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateRoutingVariable.");return(t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),_&&(n=_.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function Ln(s){return{createRoutingVariable:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Qn(s).createRoutingVariable(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRoutingVariable:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Qn(s).deleteRoutingVariable(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRoutingVariable:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Qn(s).readRoutingVariable(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRoutingVariable:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Qn(s).searchRoutingVariable(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRoutingVariable:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Qn(s).updateRoutingVariable(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Fn=e,ae.__extends(Bn,Fn),Bn.prototype.createRoutingVariable=function(e,t){var n=this;return Ln(this.configuration).createRoutingVariable(e,t).then(function(e){return e(n.axios,n.basePath)})},Bn.prototype.deleteRoutingVariable=function(e,t,n){var r=this;return Ln(this.configuration).deleteRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Bn.prototype.readRoutingVariable=function(e,t,n){var r=this;return Ln(this.configuration).readRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Bn.prototype.searchRoutingVariable=function(e,t,n,r){var i=this;return Ln(this.configuration).searchRoutingVariable(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Bn.prototype.updateRoutingVariable=function(e,t,n){var r=this;return Ln(this.configuration).updateRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Fn,Gn=Bn;function Bn(){return null!==Fn&&Fn.apply(this,arguments)||this}function Dn(v){var e=this;return{createSkill:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createSkill.");return(t=se.parse("/call_center/skills",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},createSkillAgent:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("skillId","Required parameter skillId was null or undefined when calling createSkillAgent.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createSkillAgent.");return(t="/call_center/skills/{skill_id}/agents".replace("{skill_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteSkill:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteSkill.");return(t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},deleteSkillAgent:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("skillId","Required parameter skillId was null or undefined when calling deleteSkillAgent.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling deleteSkillAgent.");return(t="/call_center/skills/{skill_id}/agents".replace("{skill_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},patchSkillAgent:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("skillId","Required parameter skillId was null or undefined when calling patchSkillAgent.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchSkillAgent.");return(t="/call_center/skills/{skill_id}/agents".replace("{skill_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readSkill:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readSkill.");return(t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchSkill:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/skills",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},searchSkillAgent:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("skillId","Required parameter skillId was null or undefined when calling searchSkillAgent.");return(t="/call_center/skills/{skill_id}/agents".replace("{skill_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),f&&(a.agent_id=f),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),g.headers),[2,{url:se.format(t),options:r}]}})})},updateSkill:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateSkill.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateSkill.");return(t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function w(d){return{createSkill:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dn(d).createSkill(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createSkillAgent:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dn(d).createSkillAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteSkill:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dn(d).deleteSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteSkillAgent:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dn(d).deleteSkillAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchSkillAgent:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dn(d).patchSkillAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readSkill:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dn(d).readSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchSkill:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dn(d).searchSkill(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchSkillAgent:function(t,r,i,a,s,o,u,c,l){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dn(d).searchSkillAgent(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateSkill:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dn(d).updateSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Hn=e,ae.__extends(Nn,Hn),Nn.prototype.createSkill=function(e,t){var n=this;return w(this.configuration).createSkill(e,t).then(function(e){return e(n.axios,n.basePath)})},Nn.prototype.createSkillAgent=function(e,t,n){var r=this;return w(this.configuration).createSkillAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Nn.prototype.deleteSkill=function(e,t,n){var r=this;return w(this.configuration).deleteSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Nn.prototype.deleteSkillAgent=function(e,t,n){var r=this;return w(this.configuration).deleteSkillAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Nn.prototype.patchSkillAgent=function(e,t,n){var r=this;return w(this.configuration).patchSkillAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Nn.prototype.readSkill=function(e,t,n){var r=this;return w(this.configuration).readSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Nn.prototype.searchSkill=function(e,t,n,r,i,a,s){var o=this;return w(this.configuration).searchSkill(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Nn.prototype.searchSkillAgent=function(e,t,n,r,i,a,s,o,u){var c=this;return w(this.configuration).searchSkillAgent(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},Nn.prototype.updateSkill=function(e,t,n){var r=this;return w(this.configuration).updateSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Hn,Mn=Nn;function Nn(){return null!==Hn&&Hn.apply(this,arguments)||this}function Jn(q){var e=this;return{createTrigger:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createTrigger.");return(t=se.parse("/trigger",!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},createTriggerJob:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("triggerId","Required parameter triggerId was null or undefined when calling createTriggerJob.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createTriggerJob.");return(t="/trigger/{trigger_id}/job".replace("{trigger_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteTrigger:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteTrigger.");return(t="/trigger/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},patchTrigger:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchTrigger.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchTrigger.");return(t="/trigger/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readTrigger:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readTrigger.");return(t="/trigger/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchTrigger:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/trigger",!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.schema_id=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},searchTriggerJob:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m){return void 0===m&&(m={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("triggerId","Required parameter triggerId was null or undefined when calling searchTriggerJob.");return(t="/trigger/{trigger_id}/job".replace("{trigger_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),m),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),void 0!==p&&(a["created_at.from"]=p),void 0!==f&&(a["created_at.to"]=f),void 0!==g&&(a["started_at.from"]=g),void 0!==v&&(a["started_at.to"]=v),void 0!==y&&(a["duration.from"]=y),void 0!==b&&(a["duration.to"]=b),w&&(a.state=w),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),m.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),m.headers),[2,{url:se.format(t),options:r}]}})})},updateTrigger:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateTrigger.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateTrigger.");return(t="/trigger/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function m(g){return{createTrigger:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Jn(g).createTrigger(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createTriggerJob:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Jn(g).createTriggerJob(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteTrigger:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Jn(g).deleteTrigger(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchTrigger:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Jn(g).patchTrigger(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readTrigger:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Jn(g).readTrigger(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchTrigger:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Jn(g).searchTrigger(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchTriggerJob:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Jn(g).searchTriggerJob(t,r,i,a,s,o,u,c,l,d,_,h,p,f)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateTrigger:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Jn(g).updateTrigger(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Vn=e,ae.__extends($n,Vn),$n.prototype.createTrigger=function(e,t){var n=this;return m(this.configuration).createTrigger(e,t).then(function(e){return e(n.axios,n.basePath)})},$n.prototype.createTriggerJob=function(e,t,n){var r=this;return m(this.configuration).createTriggerJob(e,t,n).then(function(e){return e(r.axios,r.basePath)})},$n.prototype.deleteTrigger=function(e,t){var n=this;return m(this.configuration).deleteTrigger(e,t).then(function(e){return e(n.axios,n.basePath)})},$n.prototype.patchTrigger=function(e,t,n){var r=this;return m(this.configuration).patchTrigger(e,t,n).then(function(e){return e(r.axios,r.basePath)})},$n.prototype.readTrigger=function(e,t){var n=this;return m(this.configuration).readTrigger(e,t).then(function(e){return e(n.axios,n.basePath)})},$n.prototype.searchTrigger=function(e,t,n,r,i,a,s,o){var u=this;return m(this.configuration).searchTrigger(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},$n.prototype.searchTriggerJob=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){var p=this;return m(this.configuration).searchTriggerJob(e,t,n,r,i,a,s,o,u,c,l,d,_,h).then(function(e){return e(p.axios,p.basePath)})},$n.prototype.updateTrigger=function(e,t,n){var r=this;return m(this.configuration).updateTrigger(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Vn,zn=$n;function $n(){return null!==Vn&&Vn.apply(this,arguments)||this}function Yn(l){var e=this;return{defaultDeviceConfig:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("type","Required parameter type was null or undefined when calling defaultDeviceConfig.");return(t="/user/device/config/{type}".replace("{type}",encodeURIComponent(String(u))),t=se.parse(t,!0),l&&(n=l.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},l&&l.apiKey)?"function"!=typeof l.apiKey?[3,2]:[4,l.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,l.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})}}}function Zn(i){return{defaultDeviceConfig:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Yn(i).defaultDeviceConfig(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}er=e,ae.__extends(nr,er),nr.prototype.defaultDeviceConfig=function(e,t){var n=this;return Zn(this.configuration).defaultDeviceConfig(e,t).then(function(e){return e(n.axios,n.basePath)})};var er,tr=nr;function nr(){return null!==er&&er.apply(this,arguments)||this}function rr(g){var e=this;return{deleteVariable:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling deleteVariable.");if(null==c)throw new O("etag","Required parameter etag was null or undefined when calling deleteVariable.");return(t="/contacts/{contact_id}/variables/{etag}".replace("{contact_id}",encodeURIComponent(String(u))).replace("{etag}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return l&&(a.fields=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},deleteVariables:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling deleteVariables.");if(null==c)throw new O("etag","Required parameter etag was null or undefined when calling deleteVariables.");return(t="/contacts/{contact_id}/variables".replace("{contact_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return l&&(a.fields=l),c&&(a.etag=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},listVariables:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling listVariables.");return(t="/contacts/{contact_id}/variables".replace("{contact_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},mergeVariables:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling mergeVariables.");if(null==l)throw new O("input","Required parameter input was null or undefined when calling mergeVariables.");return(t="/contacts/{contact_id}/variables".replace("{contact_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return d&&(a.fields=d),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},resetVariables:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling resetVariables.");if(null==l)throw new O("input","Required parameter input was null or undefined when calling resetVariables.");return(t="/contacts/{contact_id}/variables".replace("{contact_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return d&&(a.fields=d),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},updateVariable:function(c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling updateVariable.");if(null==l)throw new O("etag","Required parameter etag was null or undefined when calling updateVariable.");if(null==d)throw new O("input","Required parameter input was null or undefined when calling updateVariable.");return(t="/contacts/{contact_id}/variables/{etag}".replace("{contact_id}",encodeURIComponent(String(c))).replace("{etag}",encodeURIComponent(String(l))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),h),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return _&&(a.fields=_),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})},updateVariable2:function(c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling updateVariable2.");if(null==l)throw new O("etag","Required parameter etag was null or undefined when calling updateVariable2.");if(null==d)throw new O("input","Required parameter input was null or undefined when calling updateVariable2.");return(t="/contacts/{contact_id}/variables/{etag}".replace("{contact_id}",encodeURIComponent(String(c))).replace("{etag}",encodeURIComponent(String(l))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),h),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return _&&(a.fields=_),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function ir(l){return{deleteVariable:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,rr(l).deleteVariable(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteVariables:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,rr(l).deleteVariables(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},listVariables:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,rr(l).listVariables(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},mergeVariables:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,rr(l).mergeVariables(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},resetVariables:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,rr(l).resetVariables(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateVariable:function(t,r,i,a,s){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,rr(l).updateVariable(t,r,i,a,s)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateVariable2:function(t,r,i,a,s){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,rr(l).updateVariable2(t,r,i,a,s)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ar=e,ae.__extends(or,ar),or.prototype.deleteVariable=function(e,t,n,r){var i=this;return ir(this.configuration).deleteVariable(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},or.prototype.deleteVariables=function(e,t,n,r){var i=this;return ir(this.configuration).deleteVariables(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},or.prototype.listVariables=function(e,t,n,r,i,a,s,o){var u=this;return ir(this.configuration).listVariables(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},or.prototype.mergeVariables=function(e,t,n,r){var i=this;return ir(this.configuration).mergeVariables(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},or.prototype.resetVariables=function(e,t,n,r){var i=this;return ir(this.configuration).resetVariables(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},or.prototype.updateVariable=function(e,t,n,r,i){var a=this;return ir(this.configuration).updateVariable(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},or.prototype.updateVariable2=function(e,t,n,r,i){var a=this;return ir(this.configuration).updateVariable2(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})};var ar,sr=or;function or(){return null!==ar&&ar.apply(this,arguments)||this}function ur(e){this.apiKey=(e=void 0===e?{}:e).apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions}(K=g.EngineAuditQuestionType||(g.EngineAuditQuestionType={})).Default="question_default",K.Score="question_score",K.Option="question_option",(K=g.EngineBoolFilter||(g.EngineBoolFilter={})).Undefined="undefined",K.True="true",K.False="false",(K=g.EngineCommunicationChannels||(g.EngineCommunicationChannels={})).Undefined="Undefined",K.Phone="Phone",K.Email="Email",K.Messaging="Messaging",(K=g.EnginePresetQuerySection||(g.EnginePresetQuerySection={})).Default="section_default",K.Calls="section_calls",(K=g.EngineRoutingSchemaType||(g.EngineRoutingSchemaType={})).Default="default",K.Voice="voice",K.Chat="chat",K.Processing="processing",K.Service="service",(K=g.EngineTriggerJobState||(g.EngineTriggerJobState={})).Idle="idle",K.Active="active",K.Done="done",K.Error="error",(K=g.EngineTriggerType||(g.EngineTriggerType={})).DefaultTriggerType="default_trigger_type",K.Cron="cron",(g.GoogleProtobufNullValue||(g.GoogleProtobufNullValue={})).NULLVALUE="NULL_VALUE",(K=g.HistoryFileJobHistoryFileJobAction||(g.HistoryFileJobHistoryFileJobAction={})).Undefined="undefined",K.STT="STT",K.Delete="delete",(K=g.HistoryFileJobHistoryFileJobState||(g.HistoryFileJobHistoryFileJobState={})).Idle="idle",K.Active="active",K.Finished="finished",K.Error="error",(K=g.LoggerACTION||(g.LoggerACTION={})).DEFAULTNOACTION="DEFAULT_NO_ACTION",K.CREATE="CREATE",K.UPDATE="UPDATE",K.READ="READ",K.DELETE="DELETE",(g.ProtobufNullValue||(g.ProtobufNullValue={})).NULLVALUE="NULL_VALUE",(K=g.StorageImportSourceType||(g.StorageImportSourceType={})).DefaultSourceType="DefaultSourceType",K.Dialer="Dialer",(K=g.StorageProviderType||(g.StorageProviderType={})).DefaultProvider="DefaultProvider",K.Microsoft="Microsoft",K.Google="Google",(K=g.StorageServiceType||(g.StorageServiceType={})).DefaultService="DefaultService",K.STT="STT",K.TTS="TTS",(K=g.StorageUploadStatusCode||(g.StorageUploadStatusCode={})).Unknown="Unknown",K.Ok="Ok",K.Failed="Failed",(K=g.WebitelContactsAccessMode||(g.WebitelContactsAccessMode={})).READ="READ",K.WRITE="WRITE",K.DELETE="DELETE",lr.prototype.debug=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("debug",e,t)},lr.prototype.info=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("info",e,t)},lr.prototype.warn=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("warn",e,t)},lr.prototype.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("error",e,t)},lr.prototype.emitLogMessage=function(e,t,n){0<n.length?console[e].apply(console,ae.__spreadArrays([t],n)):console[e](t)};var cr=lr;function lr(){}Object.defineProperty(_r.prototype,"id",{get:function(){return this.session.id},enumerable:!1,configurable:!0}),_r.prototype.getLocalMedia=function(){if(this.session.connection){var e=this.session.connection.getLocalStreams();if(e.length)return e}return[]},_r.prototype.getPeerMedia=function(){if(this.session.connection){var e=this.session.connection.getRemoteStreams();if(e.length)return e}return[]},_r.prototype.answer=function(e){var t=this;return new Promise(function(){t.session.answer(e)})};var dr=_r;function _r(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")}hr=T.EventEmitter,ae.__extends(a,hr),a.prototype.callOption=function(n){return void 0===n&&(n={}),ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.getUserCallStream(n)];case 1:return t=e.sent(),[2,{sessionTimersExpires:120,pcConfig:n.disableStun?void 0:{iceServers:[{urls:["stun:stun.l.google.com:19302"]}]},mediaStream:t}]}})})},a.prototype.answer=function(r,i){return ae.__awaiter(this,void 0,void 0,function(){var t,n;return ae.__generator(this,function(e){switch(e.label){case 0:return this.sessionCache.has(r)?(t=this.sessionCache.get(r),[4,this.callOption(i)]):[3,2];case 1:return n=e.sent(),[2,t.answer(n)];case 2:return[2,!1]}})})},a.prototype.call=function(r){return ae.__awaiter(this,void 0,void 0,function(){var t,n;return ae.__generator(this,function(e){switch(e.label){case 0:if(n={},t=null,r.params&&(n.audio=r.params.audio,n.video=r.params.video||!1,n.screen=r.params.screen||!1,n.disableStun=r.params.disableStun||!1),"string"!=typeof r.destination)throw new Error("bad destination type");return[4,this.callOption(n)];case 1:return n=e.sent(),r.params&&r.params.display&&(t={extraHeaders:["X-Webitel-Display: "+r.params.display]}),[4,this.ua.call(r.destination,ae.__assign(ae.__assign({},n),t))];case 2:return e.sent(),[2]}})})},a.prototype.register=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t,i=this;return ae.__generator(this,function(e){return t=new I.WebSocketInterface(n.server),t={realm:n.realm,uri:n.uri,authorization_user:n.authorization_user,ha1:n.ha1,user_agent:a.userAgent,sockets:[t],session_timers:!0,display_name:n.display_name,register_expires:n.register_expires||90,connection_recovery_min_interval:5,connection_recovery_max_interval:60},(t=this.ua=new I.UA(t)).on("newRTCSession",function(e){var t=e.session,n=t.id,r=new dr(e);i.storeSession(n,r),t.on("connecting",function(){i.emit("localStreams",r,t.connection.getLocalStreams())}),t.connection&&t.connection.addEventListener("addstream",function(e){i.emit("peerStreams",r,new Array(e.stream))}),t.on("peerconnection",function(e){e.peerconnection.addEventListener("addstream",function(t){return ae.__awaiter(i,void 0,void 0,function(){return ae.__generator(this,function(e){return this.emit("peerStreams",r,new Array(t.stream)),[2]})})})}),t.on("ended",function(){i.removeSession(n,t.connection)}),t.on("failed",function(){i.removeSession(n,t.connection)}),t.on("accepted",function(){r.incoming||i.emit("peerStreams",r,t.connection.getRemoteStreams())}),t.on("confirmed",function(){}),i.emit("newSession",r)}),t.on("disconnected",function(e){i.emit("unregistered")}),t.on("unregistered",function(e){i.emit("unregistered")}),t.on("registrationFailed",function(e){i.log.error("registrationFailed",e)}),t.on("registered",function(e){i.emit("registered")}),t.start(),[2]})})},a.prototype.unregister=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){switch(e.label){case 0:return this.ua?(this.ua.terminateSessions(),this.ua.removeAllListeners(),[4,this.ua.stop()]):[3,2];case 1:e.sent(),delete this.ua,e.label=2;case 2:return[2]}})})},a.prototype.isRegistered=function(){return!!this.ua&&this.ua.isRegistered()},a.prototype.sipSessionByCallId=function(e){for(var t=0,n=this.allSession;t<n.length;t++){var r=n[t];if(r.callId===e)return r}return null},a.prototype.sipSessionBySipId=function(e){for(var t=0,n=this.allSession;t<n.length;t++){var r=n[t];if(r.id.startsWith(e))return r}return null},a.prototype.removeSession=function(e,t){var n;return t&&(n=t.getLocalStreams(),t=t.getRemoteStreams(),n&&n.forEach(function(e){e.getTracks().forEach(function(e){e.stop()})}),t)&&t.forEach(function(e){e.getTracks().forEach(function(e){e.stop()})}),!!this.sessionCache.has(e)&&(this.sessionCache.delete(e),!0)},a.prototype.storeSession=function(e,t){if(this.sessionCache.has(e))throw new Error("Session already store");this.sessionCache.set(e,t)},Object.defineProperty(a.prototype,"allSession",{get:function(){return Array.from(this.sessionCache.values())},enumerable:!1,configurable:!0}),a.prototype.getMediaConstraints=function(e){return e.screen?{video:!1,audio:!1,screen:!0}:{video:e.video||!1,audio:!0}},a.prototype.getSession=function(e){return this.sessionCache.has(e)?this.sessionCache.get(e):null},a.prototype.hasSession=function(e){return this.sessionCache.has(e)},a.prototype.getUserScreen=function(){return ae.__awaiter(this,void 0,void 0,function(){var t=this;return ae.__generator(this,function(e){return[2,new Promise(function(n,r){return ae.__awaiter(t,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,navigator.mediaDevices.getDisplayMedia()];case 1:return t=e.sent(),n(t),[3,3];case 2:return t=e.sent(),r(t),[3,3];case 3:return[2]}})})})]})})},a.prototype.getUserCallStream=function(r){return ae.__awaiter(this,void 0,void 0,function(){var t,n;return ae.__generator(this,function(e){switch(e.label){case 0:return!0!==r.screen?[3,2]:[4,this.getUserScreen()];case 1:t=e.sent(),e.label=2;case 2:return!1!==r.audio||r.video?[4,this.getUserMedia(r.audio,r.video)]:[3,4];case 3:n=e.sent(),t?n.getTracks().forEach(function(e){t.addTrack(e)}):t=n,e.label=4;case 4:if(t)return[2,t];throw new Error("bad stream request")}})})},a.prototype.getUserMedia=function(i,a){return ae.__awaiter(this,void 0,void 0,function(){var t=this;return ae.__generator(this,function(e){return[2,new Promise(function(n,r){return ae.__awaiter(t,void 0,void 0,function(){var t;return ae.__generator(this,function(e){return t={audio:!(!1===i),video:void 0},a&&(t.video={width:{min:10,ideal:1280,max:1920},height:{min:10,ideal:720,max:1080},frameRate:{ideal:10,max:15}}),[2,function(r){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,new Promise(function(t,n){navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia(r).then(function(e){return t(e)}).catch(function(e){return n(e)}):(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)(r,function(e){return t(e)},function(e){return n(e)})})]})})}(t).then(n).catch(r)]})})})]})})},a.userAgent="Webitel-Phone/"+I.version,a.sipVersion=I.version;var hr,pr=a;function a(e,t){var n=hr.call(this)||this;return n.instanceId=e,n.type="webrtc",n.sessionCache=new Map,n.log=new cr,t?(n.log.info("JsSip version: "+I.version),I.debug.enable("*")):I.debug.disable(),n.on("unregistered",function(){n.sessionCache.clear()}),n}(K=g.TypeErrors||(g.TypeErrors={})).RolePermission="api.context.permissions.app_error",K.LicencePermission="api.context.permissions.license",K.PauseNotAllow="app.agent.set_pause.not_allow",fr=Error,ae.__extends(vr,fr),vr.id="device_not_found";var fr,gr=vr;function vr(e){e=fr.call(this,e)||this;return e.id=vr.id,e}yr=Error,ae.__extends(wr,yr),wr.id="device_not_allow";var yr,br=wr;function wr(e){e=yr.call(this,e)||this;return e.id=wr.id,e}mr=Error,ae.__extends(Ar,mr),Ar.id=g.TypeErrors.RolePermission;var mr,qr=Ar;function Ar(e){e=mr.call(this,e)||this;return e.id=Ar.id,e}Cr=Error,ae.__extends(Sr,Cr),Sr.id=g.TypeErrors.LicencePermission;var Cr,Rr=Sr;function Sr(e){e=Cr.call(this,e)||this;return e.id=Sr.id,e}Kr=Error,ae.__extends(Or,Kr),Or.id=g.TypeErrors.PauseNotAllow;var Kr,Pr,Tr=Or;function Or(e){e=Kr.call(this,e)||this;return e.id=Or.id,e}(K=g.JobState||(g.JobState={})).Distribute="distribute",K.Offering="offering",K.Bridged="bridged",K.Missed="missed",K.Processing="processing",K.Closed="closed",K.Destroy="destroy",(K=Pr=Pr||{}).Call="call",K.Chat="chat",K.Task="task";Object.defineProperty(s.prototype,"queue",{get:function(){return{id:this.distribute.queue_id,name:this.distribute.queue_name}},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"duration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"hasForm",{get:function(){return this.distribute.has_form||!1},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"channel",{get:function(){return this.distribute.channel},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"allowAccept",{get:function(){return this.channel===Pr.Task&&0===this.bridgedAt&&0===this.closedAt},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"allowDecline",{get:function(){return this.allowAccept},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"allowClose",{get:function(){return this.channel===Pr.Task&&0===this.closedAt&&0<this.bridgedAt},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"memberId",{get:function(){return this.distribute.member_id},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"queueId",{get:function(){return this.distribute.queue_id},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"hasReporting",{get:function(){return this.distribute.has_reporting},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"allowReporting",{get:function(){return this.hasReporting&&0<this.bridgedAt},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"agentChannelId",{get:function(){return this.distribute.agent_channel_id},enumerable:!1,configurable:!0}),s.prototype.setState=function(e){this.state=e},s.prototype.setAnswered=function(e){this.answeredAt=e,this.lastStatusChange=Date.now(),this._autoAnswerTimerId&&(clearTimeout(this._autoAnswerTimerId),this._autoAnswerTimerId=null)},s.prototype.setOffering=function(e){var t=this;this.offeringAt=e.timestamp,e.offering.auto_answer&&this.channel===g.ChannelType.Job&&(this._autoAnswerParam=e.offering.auto_answer,this.acceptDelay().catch(function(e){t.client.emit("error",e)}))},s.prototype.setBridged=function(e){this.bridgedAt=e.timestamp,this.lastStatusChange=Date.now(),e.form&&(this.form=e.form),this._autoAnswerTimerId&&(clearTimeout(this._autoAnswerTimerId),this._autoAnswerTimerId=null)},s.prototype.setProcessing=function(e,t){this.state=g.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},s.prototype.setClosed=function(e){this.stopAt=e,this.state=g.JobState.Closed},s.prototype.setTransferred=function(e){this.distribute=e,this.history.push(e)},s.prototype.setMissed=function(){this.state=g.JobState.Missed},Object.defineProperty(s.prototype,"processingTimeoutAt",{get:function(){return this._processing&&this._processing.timeout?this._processing.timeout:null},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"processingSec",{get:function(){return this._processing&&this._processing.sec?this._processing.sec:null},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"attempt",{get:function(){return this},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"variables",{get:function(){var e,t={};for(e in this.distribute.variables)e.startsWith("cc_")||(t[e]=this.distribute.variables[e]);return t},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"isMember",{get:function(){return!!this.memberId},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"displayNumber",{get:function(){return this.communication.destination},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"displayName",{get:function(){return this.distribute.member_name||null},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"display",{get:function(){return this.displayName+" ("+this.displayNumber+")"},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"renewalSec",{get:function(){return this._processing&&this._processing.renewal_sec?this._processing.renewal_sec:null},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"autoAnswer",{get:function(){return 0<this.autoAnswerDelay},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"autoAnswerDelay",{get:function(){return this._autoAnswerParam&&""+this._autoAnswerParam!="false"?isFinite(+this._autoAnswerParam)?+this._autoAnswerParam:this.client.autoAnswerDelayTime:0},enumerable:!1,configurable:!0}),s.prototype.accept=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("cc_agent_task_accept",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})]})})},s.prototype.acceptDelay=function(){return ae.__awaiter(this,void 0,void 0,function(){var t=this;return ae.__generator(this,function(e){return this._autoAnswerTimerId=setTimeout(function(){return ae.__awaiter(t,void 0,void 0,function(){return ae.__generator(this,function(e){switch(e.label){case 0:return this.autoAnswered?[2]:this.answeredAt?[3,2]:(this.autoAnswered=!0,[4,this.accept()]);case 1:e.sent(),e.label=2;case 2:return[2]}})})},this.autoAnswerDelay),[2]})})},s.prototype.close=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("cc_agent_task_close",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})]})})},s.prototype.decline=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("cc_agent_task_close",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})]})})},s.prototype.reporting=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.request("cc_reporting",ae.__assign({attempt_id:this.id},n))];case 1:return t=e.sent(),this.reportedAt=Date.now(),[2,t]}})})},s.prototype.renew=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("cc_renewal",{attempt_id:this.id,renewal_sec:t||this.processingSec})]})})},s.prototype.formAction=function(s,o){return ae.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a;return ae.__generator(this,function(e){if(!this.form)throw new Error("not found active form");for(t={},n=0,r=Object.entries(o);n<r.length;n++)a=r[n],i=a[0],a=a[1],t[i]="object"==typeof a?JSON.stringify(a):a;return[2,this.client.request("cc_form_action",{attempt_id:this.id,app_id:this.distribute.app_id,action:s,fields:t})]})})};var Ir=s;function s(e,t,n){this.client=e,this.distribute=n,this.id=t.attempt_id,this.state=g.JobState.Offering,this.setState(t.status),this.lastStatusChange=t.timestamp,this.createdAt=t.timestamp,this._processing=null,this.offeringAt=0,this.answeredAt=0,this.bridgedAt=0,this.reportedAt=0,this.startProcessingAt=0,this.stopAt=0,this.closedAt=0,this.form=null,this.autoAnswered=!1,this._autoAnswerParam=!1,this._autoAnswerTimerId=null,this.communication=n.communication,this.history=[n]}(K=g.AgentStatus||(g.AgentStatus={})).Online="online",K.Offline="offline",K.Pause="pause",K.BreakOut="break_out",(K=g.ChannelState||(g.ChannelState={})).Waiting="waiting",K.Distribute="distribute",K.Offering="offering",K.Answered="answered",K.Active="active",K.Bridged="bridged",K.Hold="hold",K.Missed="missed",K.WrapTime="wrap_time",K.Processing="processing",K.Transfer="transfer",K.Form="form",(K=g.ChannelType||(g.ChannelType={})).Call="call",K.Email="email",K.Chat="chat",K.Job="task";Object.defineProperty(o.prototype,"agentId",{get:function(){return this.info.agent_id},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"onDemand",{get:function(){return this.info.on_demand},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"status",{get:function(){return this.info.status},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"statusPayload",{get:function(){return this.info.status_payload},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"isAdmin",{get:function(){return this.info.is_admin},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"isSupervisor",{get:function(){return this.info.is_supervisor},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"team",{get:function(){return this.info.team},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"supervisor",{get:function(){return this.info.supervisor},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"auditor",{get:function(){return this.info.auditor},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"channels",{get:function(){return Array.from(this._channels.values())},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"channel",{get:function(){return this._channels.get(g.ChannelType.Call)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"stateDuration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!1,configurable:!0}),o.prototype.setWaitingList=function(e){if(e){e=e.list;this.waitingListCalls.length=0;for(var t=this.waitingListChats.length=0,n=e;t<n.length;t++){var r=n[t];switch(r.channel){case g.ChannelType.Call:this.waitingListCalls.push(r);break;case g.ChannelType.Chat:this.waitingListChats.push(r)}}}},o.prototype.deleteWaitingAttempt=function(e){e&&(e=e.attempt_id,Wr(this.waitingListCalls,e)||Wr(this.waitingListChats,e))},o.prototype.interceptAttempt=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("cc_intercept_attempt",{attempt_id:t,agent_id:this.agentId})]})})},o.prototype.onChannelEvent=function(e){switch(e.status){case g.ChannelState.Distribute:var t=e;if(!t)throw new Error("bad event");if(r=new Ir(this.client,e,t.distribute),this.task.set(r.id,r),r.agentChannelId)switch(r.channel){case g.ChannelType.Call:var n=this.client.callById(r.agentChannelId);n&&!n.task&&(n.task=r);break;case g.ChannelType.Chat:n=this.client.conversationById(r.agentChannelId);n&&!n.task&&(n.task=r)}break;case g.ChannelState.Offering:var r,t=e;(r=this.task.get(e.attempt_id))&&r.setOffering(t);break;case g.ChannelState.Bridged:t=e;(r=this.task.get(t.attempt_id))&&r.setBridged(t);break;case g.ChannelState.Transfer:t=e;(r=this.task.get(t.to_attempt_id))&&(this.task.delete(r.id),r.id=t.attempt_id,r.setTransferred(t.distribute),this.task.set(r.id,r));break;case g.ChannelState.Answered:(r=this.task.get(e.attempt_id))&&(r.answeredAt=e.timestamp);break;case g.ChannelState.Form:t=e;return void((r=this.task.get(e.attempt_id))&&(r.form=t.form||null));case g.ChannelState.Missed:if(e.attempt_id&&(r=this.task.get(e.attempt_id))){r.stopAt=e.timestamp;t=e;if(t)return r.setMissed(),this.setChannelStateTimeout(e,t.missed.timeout),this.task.delete(e.attempt_id),this.client.reportingChannelTask(r),r;throw new Error("bad event")}break;case g.ChannelState.WrapTime:if(e.attempt_id){if(!e)throw new Error("bad event");r=this.task.get(e.attempt_id),this.task.delete(e.attempt_id),this.client.reportingChannelTask(r)}break;case g.ChannelState.Processing:if(e.attempt_id){t=e;if(!t)throw new Error("bad event");if(r=this.task.get(e.attempt_id))return r.setProcessing(e.timestamp,t.processing),this.setChannelStateTimeout(e,t.processing.timeout||0),r}break;case g.ChannelState.Waiting:e.attempt_id&&(r=this.task.get(e.attempt_id))&&(r.setClosed(e.timestamp),this.task.delete(e.attempt_id),this.client.reportingChannelTask(r))}if(this.setChannelState(e),r)return r.setState(e.status),r},o.prototype.online=function(t,n){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.agentSetOnline(this.agentId,t,n)]})})},o.prototype.waiting=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.agentSetWaiting(this.agentId,t)]})})},o.prototype.pause=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.client.agentSetPause(this.agentId,n)];case 1:return[2,e.sent()];case 2:return(t=e.sent()).id===g.TypeErrors.PauseNotAllow?[2,new Tr(t.detail)]:[2,t];case 3:return[2]}})})},o.prototype.offline=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.agentSetOffline(this.agentId)]})})},o.prototype.setStatus=function(e){e.status===g.AgentStatus.Online&&(this.info.on_demand=e.on_demand||!1,this.initChannels(e.channels)),this.info.status=e.status,this.info.status_payload=e.status_payload||null,this.lastStatusChange=Date.now()},o.prototype.directMember=function(t,n){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("cc_member_direct",{agent_id:this.agentId,member_id:t,communication_id:n})]})})},o.prototype.offlineMembers=function(n,r,i){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,(t=this).client.request("cc_fetch_offline_members",{agent_id:this.agentId,page:r,q:n,per_page:i})];case 1:return t._listOfflineMembers=e.sent(),[2,this._listOfflineMembers]}})})},o.prototype.hasTask=function(e){return this.task.has(e.id)},o.prototype.initChannels=function(e){for(var t=0,n=e;t<n.length;t++){var r=n[t];this._channels.set(r.channel,r)}},o.prototype.getChannel=function(e){return this._channels.get(e)},o.prototype.setChannelState=function(e){var t=this.getChannel(e.channel);t&&(t.state=e.status,t.joined_at=e.timestamp,t.timeout=void 0)},o.prototype.setChannelStateTimeout=function(e,t){var n=this.getChannel(e.channel);n&&(n.state=e.status,n.timeout=t,n.joined_at=e.timestamp)};var kr=o;function o(e,t){this.client=e,this.info=t,this.task=new Map,this._channels=new Map,this.initChannels(t.channels),this._listOfflineMembers=null,this.waitingListChats=[],this.waitingListCalls=[],this.lastStatusChange=Date.now()-1e3*this.info.status_duration}function Wr(e,t){for(var n=0;n<e.length;n++)if(e[n].attempt_id===t)return e.splice(n,1),1}(K=g.CallReportingStatus||(g.CallReportingStatus={})).Abandoned="abandoned",K.Cancel="cancel",K.Success="success",K.Failed="failed",K.Missed="missed",K.Timeout="timeout",K.Endless="endless",K.Transferred="transferred",(K=g.EavesdropState||(g.EavesdropState={})).Muted="muted",K.Conference="conference",K.Prompt="prompt",(K=g.EavesdropType||(g.EavesdropType={})).Joined="joined",K.Leave="leave",K.Hide="hide",(K=g.CallActions||(g.CallActions={})).Ringing="ringing",K.Active="active",K.Bridge="bridge",K.Hold="hold",K.DTMF="dtmf",K.Voice="voice",K.Silence="silence",K.Execute="execute",K.Update="update",K.Hangup="hangup",K.Reporting="reporting",K.PeerStream="peerStream",K.LocalStream="localStream",K.Destroy="destroy",K.Eavesdrop="eavesdrop",(K=g.CallDirection||(g.CallDirection={})).Inbound="inbound",K.Outbound="outbound";u.prototype.setState=function(e){this.state=e.event},u.prototype.setSip=function(e){e&&!this.sip&&(this.sip=e,this.localStreams=e.getLocalMedia(),this.peerStreams=e.getPeerMedia())},Object.defineProperty(u.prototype,"duration",{get:function(){return 0===this.hangupAt?Math.round((Date.now()-this.createdAt)/1e3):Math.round((this.hangupAt-this.createdAt)/1e3)},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"allowDtmf",{get:function(){return 0<this.answeredAt&&this.allowHangup},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"allowHangup",{get:function(){return 0===this.hangupAt},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"allowHold",{get:function(){return 0===this.hangupAt&&("active"===this.state||"bridge"===this.state)},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"allowAnswer",{get:function(){return this.client.phone&&0===this.hangupAt&&0===this.answeredAt&&(this.queue||this.direction===g.CallDirection.Inbound||this.params&&!this.params.autoAnswer)},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"allowUnHold",{get:function(){return 0===this.hangupAt&&"hold"===this.state},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"memberCommunication",{get:function(){return this.task?this.task.communication:null},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"isEavesdrop",{get:function(){return!!this._eavesdrop},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"eavesdropName",{get:function(){return this.isEavesdrop?this._eavesdrop.name:""},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"eavesdropNumber",{get:function(){return this.isEavesdrop?this._eavesdrop.number:""},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"eavesdropDuration",{get:function(){return this.isEavesdrop?this._eavesdrop.duration:0},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"eavesdropState",{get:function(){return this.isEavesdrop?this._eavesdrop.state:null},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"eavesdropIsMuted",{get:function(){return this.eavesdropState===g.EavesdropState.Muted},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"eavesdropIsConference",{get:function(){return this.eavesdropState===g.EavesdropState.Conference},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"eavesdropIsPrompt",{get:function(){return this.eavesdropState===g.EavesdropState.Prompt},enumerable:!1,configurable:!0}),u.prototype.getMember=function(e){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.isMember)return[2,this.client.request("cc_member_page",{queue_id:this.task.queueId,member_id:this.task.memberId})];throw new Error("call is not from outbound queue")})})},Object.defineProperty(u.prototype,"isMember",{get:function(){return!(!this.task||!this.task.isMember)},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"firstActive",{get:function(){return 1===this._activeCounter},enumerable:!1,configurable:!0}),u.prototype.setActive=function(e){this._activeCounter++,this._autoAnswerTimerId&&(clearTimeout(this._autoAnswerTimerId),this._autoAnswerTimerId=null),this.answeredAt||(this.direction===g.CallDirection.Inbound&&(this.bridgedAt=+e.timestamp,this.parentId)&&(this.bridgedId=this.parentId),this.answeredAt=+e.timestamp),this.setState(e)},u.prototype.setBridged=function(e){var t=e.data;this.bridgedAt||(this.bridgedAt=+e.timestamp),this.bridgedId=t.bridged_id,t.to&&(this.direction===g.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)},u.prototype.setHold=function(e){this.setState(e)},u.prototype.setInfo=function(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},u.prototype.setPeerStreams=function(e){this.peerStreams=e||[]},u.prototype.setLocalStreams=function(e){this.localStreams=e||[]},u.prototype.setVoice=function(){this.voice=!0},u.prototype.setSilence=function(){this.voice=!1},u.prototype.setExecute=function(e){this.applications.push(e.application)},u.prototype.addDigit=function(e){this.digits.push(e.digit)},u.prototype.setEavesdropState=function(e){e.type===g.EavesdropType.Joined?this._eavesdrop=e:e.type===g.EavesdropType.Leave?this._eavesdrop=null:this._eavesdrop.state=e.state},u.prototype.setHangup=function(e){var 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)},Object.defineProperty(u.prototype,"allowReporting",{get:function(){return 0<this.answeredAt&&this.hasReporting},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"hasReporting",{get:function(){return!!this.task&&this.task.hasReporting},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"display",{get:function(){return this.displayNumber+" ("+this.displayName+")"},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"muted",{get:function(){return this._muted},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"isHold",{get:function(){return this.state===g.CallActions.Hold},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"allowInboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"allowOutboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"active",{get:function(){return 0===this.hangupAt},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"displayNumber",{get:function(){return"inbound"===this.direction?this.from.number:this.to?this.to.number:this.destination},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"displayName",{get:function(){return"inbound"===this.direction?this.from.name:this.to?this.to.name:this.destination},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"autoAnswer",{get:function(){return this.queue&&"offline"===this.queue.queue_type||0<this.autoAnswerDelay},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"autoAnswerDelay",{get:function(){return this.params&&this.params.autoAnswer&&""+this.params.autoAnswer!="false"?isFinite(+this.params.autoAnswer)?+this.params.autoAnswer:this.client.autoAnswerDelayTime:0},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"attempt",{get:function(){return this.task},enumerable:!1,configurable:!0}),u.prototype.answer=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:if(!this.sip||!this.client.phone)return[3,6];e.label=1;case 1:return e.trys.push([1,4,,5]),[4,this.client.phone.callOption(n)];case 2:return t=e.sent(),[4,this.sip.answer(t)];case 3:return e.sent(),[3,5];case 4:return t=e.sent(),this.client.handleError(t),[3,5];case 5:return[2,!0];case 6:return[2,!1]}})})},u.prototype.answerDelay=function(n){var e=this;this.autoAnswered||(this._autoAnswerTimerId=setTimeout(function(){return ae.__awaiter(e,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return this.autoAnswered?[2]:[4,(t=this).answer(n)];case 1:return t.autoAnswered=e.sent(),[2]}})})},this.autoAnswerDelay))},u.prototype.hangup=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){return t=n,0!==this.answeredAt||n||(t=this.direction===g.CallDirection.Inbound?"USER_BUSY":"ORIGINATOR_CANCEL"),[2,this.client.request("call_hangup",{id:this.id,app_id:this.appId,cause:t})]})})},u.prototype.eavesdrop=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return t.id=this.id,[2,this.client.request("call_eavesdrop",t)]})})},u.prototype.changeEavesdropState=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(!this.isEavesdrop)throw new Error("this call not in eavesdrop");if(this.eavesdropState===t)throw new Error("this call already eavesdrop state: "+t);return[2,this.client.request("call_eavesdrop_state",{id:this.id,state:t})]})})},u.prototype.toggleHold=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return this.state===g.CallActions.Hold?[2,this.unHold()]:[2,this.hold()]})})},u.prototype.hold=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.state===g.CallActions.Hold)throw new Error("Call is hold");return[2,this.client.request("call_hold",{id:this.id,app_id:this.appId})]})})},u.prototype.unHold=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.state!==g.CallActions.Hold)throw new Error("Call is active");return[2,this.client.request("call_unhold",{id:this.id,app_id:this.appId})]})})},u.prototype.sendDTMF=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("call_dtmf",{id:this.id,app_id:this.appId,dtmf:t})]})})},u.prototype.blindTransfer=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("call_blind_transfer",{id:this.id,app_id:this.appId,destination:t})]})})},u.prototype.mute=function(n){return void 0===n&&(n=!1),ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.request("call_mute",{id:this.id,app_id:this.appId,mute:n})];case 1:return t=e.sent(),this._muted=n,[2,t]}})})},u.prototype.bridgeTo=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("call_bridge",{from_id:this.id,from_app_id:this.appId,to_id:t.id,to_app_id:t.appId})]})})},u.prototype.reporting=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.task)return[2,this.task.reporting(t)];throw new Error("this call not in queue")})})},u.prototype.renew=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.task)return[2,this.task.renew(t)];throw new Error("this conversation not in queue")})})},u.prototype.callToUser=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return t.nodeId=this.appId,t.parentCallId=this.id||null,t.sendToCallId=this.parentId||null,[2,this.client.inviteToUser(t)]})})};var Er=u;function u(e,t){this.client=e;var n=t.data;this._muted=!1,this.voice=!0,this.createdAt=+t.timestamp,this.task=null,this.data=null,this._eavesdrop=null,this._autoAnswerTimerId=null,this._activeCounter=0,this.answeredAt=0,this.hangupAt=0,this.bridgedAt=0,this.reportingAt=0,this.autoAnswered=!1,this.peerStreams=[],this.localStreams=[],n.eavesdrop&&(this._eavesdrop=n.eavesdrop),e.phone&&(n.sip_id?this.setSip(e.phone.sipSessionBySipId(n.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(n),this.queue&&this.client.agent&&(this.task=this.client.agent.task.get(+this.queue.attempt_id)||null)}(K=g.DeclineCause||(g.DeclineCause={})).Timeout="TIMEOUT",K.Busy="BUSY",K.Cancel="CANCEL",K.Transfer="TRANSFER",(K=g.ChatActions||(g.ChatActions={})).Message="message",K.UserInvite="user_invite",K.Invite="invite_conversation",K.Joined="join_conversation",K.Close="close_conversation",K.Leave="leave_conversation",K.Decline="decline_invite",K.Update="update_channel",K.Destroy="destroy",K.MessageDeleted="message_deleted",(K=g.ConversationState||(g.ConversationState={})).Init="init",K.Invite="invite",K.Active="active",K.Pending="pending",K.Closed="closed",q.prototype.setInvite=function(e,t){var n=this;this.inviteId=e,this.invitedAt=t,this.autoAnswer&&this.joinDelay().catch(function(e){n.client.emit("error",e)})},Object.defineProperty(q.prototype,"autoAnswer",{get:function(){return 0<this.autoAnswerDelay},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"autoAnswerDelay",{get:function(){return this._autoAnswerParam&&""+this._autoAnswerParam!="false"?isFinite(+this._autoAnswerParam)?+this._autoAnswerParam:this.client.autoAnswerDelayTime:0},enumerable:!1,configurable:!0}),q.prototype.setAnswered=function(e,t,n){this.state=g.ConversationState.Active,this.answeredAt=t,this.channelId=e,this._autoAnswerTimerId&&(clearTimeout(this._autoAnswerTimerId),this._autoAnswerTimerId=null),this.member=jr(n),this.inviteId=null},q.prototype.setClosed=function(e){this.state=g.ConversationState.Closed,this.closedAt=e},q.prototype.setDecline=function(e){this.setClosed(e.timestamp),this._cause=e.cause||null},q.prototype.setLeave=function(e){e.cause&&(this._cause=e.cause),this.setClosed(e.timestamp)},q.prototype.setDeletedMessage=function(e){for(var t=this._messages,n=0;n<t.length;n++)t[n].id===e.id&&(e.created_at=t[n].created_at,t.splice(n,1,e))},Object.defineProperty(q.prototype,"id",{get:function(){return this.channelId||this.inviteId||this.conversationId},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"cause",{get:function(){return this._cause},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"messages",{get:function(){return this.getMessages()},enumerable:!1,configurable:!0}),q.prototype.getMessages=function(){var n=this;return this._messages.map(function(e){var t={id:e.id,type:e.type,member:n.messageMember(e),channelId:e.channel_id,createdAt:e.created_at,updatedAt:e.updated_at,contact:null};return e.hasOwnProperty("file")&&(e.file&&0<e.file.id&&(e.file.url=n.client.fileUrlDownload(e.file.id),e.file.streamUrl=n.client.fileUrlStream(e.file.id)),t.file=e.file),e.hasOwnProperty("text")&&(t.text=e.text),e.hasOwnProperty("contact")&&(t.contact=e.contact),t})},q.prototype.next=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){throw new Error("TODO")})})},q.prototype.pagination=function(e,t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){throw new Error("TODO")})})},q.prototype.newMessage=function(e){this._messages.push(e)},Object.defineProperty(q.prototype,"allowDecline",{get:function(){return!!this.inviteId},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"allowJoin",{get:function(){return!!this.inviteId},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"allowLeave",{get:function(){return!(!this.channelId||0!==this.closedAt&&this.hasReporting)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"allowReporting",{get:function(){return 0<this.answeredAt&&this.hasReporting},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"hasReporting",{get:function(){return this._hasReporting},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"membersId",{get:function(){for(var e=[this.id],t=0,n=this.members;t<n.length;t++){var r=n[t];e.push(r.id)}return e},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"attempt",{get:function(){return this.task},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isTransferred",{get:function(){return(this._cause&&this._cause.toUpperCase())===g.DeclineCause.Transfer},enumerable:!1,configurable:!0}),q.prototype.decline=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){if(this.inviteId)return(t=n)||0!==this.answeredAt||(t=g.DeclineCause.Busy),[2,this.client.request("decline_chat",{invite_id:this.inviteId,cause:t})];throw new Error("This conversation is joined")})})},q.prototype.joinDelay=function(){return ae.__awaiter(this,void 0,void 0,function(){var t=this;return ae.__generator(this,function(e){return this.autoAnswered||(this.autoAnswered=!0,this._autoAnswerTimerId=setTimeout(function(){return ae.__awaiter(t,void 0,void 0,function(){return ae.__generator(this,function(e){switch(e.label){case 0:return this.answeredAt?[3,2]:[4,this.join()];case 1:e.sent(),e.label=2;case 2:return[2]}})})},this.autoAnswerDelay)),[2]})})},q.prototype.join=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.inviteId)return[2,this.client.request("join_chat",{invite_id:this.inviteId})];throw new Error("This conversation is joined")})})},q.prototype.close=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.channelId)return[2,this.client.request("close_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:t})];throw new Error("This conversation not active")})})},q.prototype.leave=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.channelId)return 0===this.closedAt||this.hasReporting||this.cause===g.DeclineCause.Busy?[2,this.client.request("leave_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:t})]:[2,this.client.destroyConversation(this)];throw new Error("This conversation not active")})})},q.prototype.sendText=function(r){return ae.__awaiter(this,void 0,void 0,function(){var t,n;return ae.__generator(this,function(e){switch(e.label){case 0:if(!this.channelId)throw new Error("conversation not active");if(!r.length)throw new Error("empty message");t=function(e,t){for(var n=Math.ceil(e.length/t),r=new Array(n),i=0,a=0;a<n;a++)r[a]=e.substring(i,i+t),i+=t;return r}(r,4096),n=0,e.label=1;case 1:return n<t.length?n+1>=t.length?[2,this.sendMessageTextChunk(t[n])]:[4,this.sendMessageTextChunk(t[n])]:[3,4];case 2:e.sent(),e.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},q.prototype.sendFile=function(n,r){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.storeFile(this.conversationId,[n],r)];case 1:return t=e.sent(),t=t[0],[2,this.client.request("send_file_chat",{channel_id:this.channelId,conversation_id:this.conversationId,id:t.id,name:n.name,mime:t.mime,url:t.shared,size:t.size})]}})})},q.prototype.send=function(t,n){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if("string"==typeof t)return[2,this.sendText(t)];if(t instanceof File)return[2,this.sendFile(t,n)];throw new Error("unknown send data")})})},q.prototype.addToChat=function(t,n){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("add_to_chat",{channel_id:this.channelId,conversation_id:this.conversationId,user_id:t,title:n})]})})},q.prototype.startChat=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("start_chat",{user_id:t})]})})},q.prototype.updateChannel=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("update_channel_chat",{channel_id:this.channelId})]})})},q.prototype.reporting=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.task)return[2,this.task.reporting(t)];throw new Error("this conversation not in queue")})})},q.prototype.renew=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.task)return[2,this.task.renew(t)];throw new Error("this conversation not in queue")})})},q.prototype.transferToPlan=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("blind_transfer_chat",{conversation_id:this.conversationId,channel_id:this.channelId,plan_id:t})]})})},q.prototype.transferToUser=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("transfer_user_chat",{conversation_id:this.conversationId,channel_id:this.channelId,user_id:t})]})})},q.prototype.sendMessageTextChunk=function(e){return this.client.request("send_text_chat",{channel_id:this.channelId,conversation_id:this.conversationId,text:e})},q.prototype.messageMember=function(e){if(this.member&&e.channel_id===this.channelId)return{self:!0};for(var t=0,n=this.members;t<n.length;t++){var r=n[t];if(r.id===e.channel_id)return r}return null};var Xr,xr=q;function q(e,t,n,r,i,a){for(var s in this.client=e,this.conversationId=t,this.title=n,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=(r||[]).map(jr),this._messages=i||[],this.state=g.ConversationState.Invite,this.variables={},this._hasReporting=!(!a||"true"!==a.cc_reporting),this.autoAnswered=!1,this._autoAnswerParam=!1,this._autoAnswerTimerId=null,this._cause=null,this.lastAction=null,a)!s.startsWith("cc_")&&a.hasOwnProperty(s)&&("wbt_auto_answer"===s?this._autoAnswerParam=a.wbt_auto_answer:this.variables[s]=a[s]);a&&a.hasOwnProperty("cc_attempt_id")&&this.client.agent&&(this.queue={id:+a.cc_queue_id||null,name:a.cc_queue_name||""},this.task=this.client.agent.task.get(+a.cc_attempt_id)||null)}function jr(e){return e.messenger=e.type,e}(K=Xr=Xr||{}).HideMember="hide_member",K.HideAttempt="hide_attempt",K.WaitingList="waiting_list";Ur=T.EventEmitter,ae.__extends(Lr,Ur),Lr.prototype.connect=function(e){var t=this;this.socket=new WebSocket(this.host.replace(/^http/,"ws")+"/websocket"),this.socket.onclose=function(e){return t.onClose(e.code)},this.socket.onmessage=function(e){return t.onMessage(e.data)},this.socket.onopen=function(){return t.onOpen()}},Lr.prototype.send=function(e){return this.socket.send(JSON.stringify(e)),null},Lr.prototype.close=function(e){this.socket.close(e||1e3),delete this.socket,this.onClose(e||1e3)},Lr.prototype.onOpen=function(){this.emit("open")},Lr.prototype.onClose=function(e){this.emit("close",e),this.off("*")},Lr.prototype.onMessage=function(e){"\0\0\0\0"!==e&&(e=JSON.parse(e),this.emit("message",e))};var Ur,Qr=Lr;function Lr(e){var t=Ur.call(this)||this;return t.host=e,t}var Fr,Gr,Br="call",Dr="chat",Hr="user_state",Mr="agent_status",K=((K=Fr=Fr||{}).NotFoundError="NotFoundError",K.NotAllowedError="NotAllowedError",(K=g.Response||(g.Response={})).STATUS_FAIL="FAIL",K.STATUS_OK="OK",Gr=T.EventEmitter,ae.__extends(P,Gr),P.prototype.connect=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.connectToSocket()];case 1:return e.sent(),[2]}})})},P.prototype.disconnect=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return this.socket.close(),[2]})})},P.prototype.subscribeCall=function(s,o){return ae.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("subscribe_call",o)];case 1:if(t=e.sent(),this.eventHandler.on(Br,s),t.items&&t.items.length)for(n=0,r=t.items;n<r.length;n++)(i=r[n]).hangup_at&&0<i.hangup_at&&!i.task||(a={cc_app_id:"",app_id:i.app_id,event:i.state,id:i.id,timestamp:Date.now(),data:{app_id:i.app_id,event:i.state,id:i.id,timestamp:Date.now(),cc_app_id:"",sip_id:"",parent_id:i.parent_id,direction:i.direction,destination:i.destination,queue:i.queue,from:i.from,to:i.to,payload:i.variables}},(a=new Er(this,a)).createdAt=i.created_at,a.answeredAt=i.answered_at||0,a.bridgedAt=i.bridged_at||0,a.hangupAt=i.hangup_at||0,i.task&&(a.task=new Ir(this,{attempt_id:i.task.attempt_id,channel:i.task.channel,status:i.task.status,timestamp:Date.now()},i.task),a.queue.reporting="true",a.task.form=i.task.form||null,i.leaving_at)&&i.task.processing_sec&&(a.task.startProcessingAt=i.leaving_at,a.task.setProcessing(i.leaving_at,{sec:i.task.processing_sec||0,timeout:i.task.processing_timeout_at||null,renewal_sec:i.task.processing_renewal_sec||0})),this.callStore.set(a.id,a));return[2,t]}})})},P.prototype.subscribeChat=function(s,o){return ae.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("subscribe_chat",o)];case 1:if(t=e.sent(),this.eventHandler.on(Dr,s),t&&t.items)for(n=0,r=t.items;n<r.length;n++){if(i=r[n],a=i.messages.reverse(),(a=new xr(this,i.id,i.title,i.members,a,i.variables)).createdAt=i.created_at,a.closedAt=i.closed_at,i.task&&(a.task=new Ir(this,{attempt_id:i.task.attempt_id,channel:i.task.channel,status:i.task.status,timestamp:Date.now()},i.task),i.leaving_at&&i.task.processing_sec&&(a.task.startProcessingAt=i.leaving_at,a.task.setProcessing(i.leaving_at,{sec:i.task.processing_sec||0,timeout:i.task.processing_timeout_at||null,renewal_sec:i.task.processing_renewal_sec||0})),a.task.form=i.task.form||null),i.invite_id)a.setInvite(i.invite_id,i.created_at);else{if(!i.channel_id){this.log.error("conversation "+i.id+" not valid");continue}a.setAnswered(i.channel_id,i.joined_at,{id:i.channel_id,name:"TODO",type:"webitel"})}this.conversationStore.set(a.id,a)}return[2,t]}})})},P.prototype.subscribeUsersStatus=function(n,r){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("subscribe_users_status",r)];case 1:return t=e.sent(),this.eventHandler.on(Hr,n),[2,t]}})})},P.prototype.subscribeAgentsStatus=function(n,r){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("cc_agent_subscribe_status",r)];case 1:return t=e.sent(),this.eventHandler.on(Mr,n),[2,t]}})})},P.prototype.subscribeTask=function(e){this.eventHandler.on("task",e)},P.prototype.subscribeJob=function(e){this.eventHandler.on("job",e)},P.prototype.unSubscribe=function(t,e,n){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("un_subscribe_"+t,n)]})})},P.prototype.destroy=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.disconnect()];case 1:return(e.sent(),this.phone)?[4,this.phone.unregister()]:[3,3];case 2:e.sent(),this.phone.off("*"),delete this.phone,e.label=3;case 3:return this.eventHandler.off("*"),[2]}})})},P.prototype.allCall=function(){return Array.from(this.callStore.values())},P.prototype.allConversations=function(){return Array.from(this.conversationStore.values())},P.prototype.allTask=function(){return this.agent?Array.from(this.agent.task.values()):[]},P.prototype.allJob=function(){return this.allTask().filter(Nr)},P.prototype.callById=function(e){if(this.callStore.has(e))return this.callStore.get(e)},P.prototype.conversationById=function(e){if(this.conversationStore.has(e))return this.conversationStore.get(e)},P.prototype.callBySipId=function(e){for(var t=0,n=this.allCall();t<n.length;t++){var r=n[t];if(r.sipId&&e.startsWith(r.sipId))return r}},P.prototype.reportingTask=function(t,n){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("cc_reporting",ae.__assign({attempt_id:t},n))]})})},P.prototype.agentActiveTasks=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("cc_agent_tasks",{agent_id:t})]})})},P.prototype.auth=function(){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,4]),[4,this.request("authentication_challenge",{token:this._config.token})];case 1:return[2,e.sent()];case 2:return t=e.sent(),this.handleError(t),[4,this.disconnect()];case 3:throw e.sent(),t;case 4:return[2]}})})},P.prototype.ping=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("ping",{ping:1})]})})},P.prototype.sessionInfo=function(){return this.connectionInfo.session},Object.defineProperty(P.prototype,"version",{get:function(){return this.connectionInfo.server_version},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"buildVersion",{get:function(){return"0.0.2"},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"instanceId",{get:function(){return this.connectionInfo.sock_id},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"autoAnswerDelayTime",{get:function(){return this._config.autoAnswerDelayTime||400},enumerable:!1,configurable:!0}),P.prototype.agentSession=function(){return ae.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l,d;return ae.__generator(this,function(e){switch(e.label){case 0:return this.agent?[2,this.agent]:[4,this.request("cc_agent_session")];case 1:return t=e.sent(),this.agent=new kr(this,t),[4,this.agentActiveTasks(this.agent.agentId)];case 2:for(t=e.sent(),n=0,r=t.items;n<r.length;n++)i=r[n],(a=new Ir(this,{status:i.status,timestamp:Date.now(),channel:i.channel,attempt_id:i.attempt_id},i)).postProcessData={},a.setState(i.state),i.bridged_at&&(a.bridgedAt=i.bridged_at,a.answeredAt=i.bridged_at),i.leaving_at&&(a.closedAt=i.leaving_at),i.leaving_at&&i.processing_sec&&(a.startProcessingAt=i.leaving_at,a.setProcessing(i.leaving_at,{sec:i.processing_sec||0,timeout:i.processing_timeout_at||null,renewal_sec:i.processing_renewal_sec||0})),a.form=i.form||null,this.agent.task.set(a.id,a);for(s=0,o=this.allCall();s<o.length;s++)(u=o[s]).task&&this.agent.task.set(u.task.id,u.task);for(c=0,l=this.allConversations();c<l.length;c++)(d=l[c]).task&&this.agent.task.set(d.task.id,d.task);return[2,this.agent]}})})},P.prototype.invite=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("call_invite",t)]})})},P.prototype.call=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:if(!this.phone)return[3,5];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.phone.call(n)];case 2:return e.sent(),[3,4];case 3:return t=e.sent(),this.handleError(t),[3,4];case 4:return[3,7];case 5:return[4,this.invite(n)];case 6:e.sent(),e.label=7;case 7:return[2]}})})},P.prototype.callRecordId=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("call_recordings",{id:t})]})})},P.prototype.eavesdrop=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("call_eavesdrop",t)]})})},P.prototype.agentSetOnline=function(t,n,r){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("cc_agent_online",{agent_id:t,channels:n,on_demand:r})]})})},P.prototype.agentSetWaiting=function(t,n){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("cc_agent_waiting",{agent_id:t,channel:n})]})})},P.prototype.agentSetPause=function(t,n){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("cc_agent_pause",{agent_id:t,payload:n})]})})},P.prototype.agentSetOffline=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("cc_agent_offline",{agent_id:t})]})})},P.prototype.inviteToUser=function(e){return this.request("call_user",e)},P.prototype.answer=function(n,r){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){return(t=this.callById(n))?[2,t.answer(r)]:[2]})})},P.prototype.request=function(n,r){var i=this;return new Promise(function(e,t){i.queueRequest.set(++i.reqSeq,{resolve:e,reject:t}),i.socket.send({seq:i.reqSeq,action:n,data:r})})},P.prototype.useWebPhone=function(){return this._config.registerWebDevice||!1},P.prototype.callDestroyed=function(e){return 0<e.hangupAt&&!this.hasAgentTask(e.task)},P.prototype.conversationDestroyed=function(e){return 0<e.closedAt&&(!this.hasAgentTask(e.task)||!e.hasReporting)&&(e.hasReporting||!(e.lastAction===g.ChatActions.Close&&0<e.answeredAt))},P.prototype.reportingChannelTask=function(e){switch(e.channel){case Pr.Call:for(var t=0,n=this.allCall();t<n.length;t++){var r=n[t];if(this.callDestroyed(r))return void this.destroyCall(r)}break;case Pr.Chat:if(e.agentChannelId){var i=this.conversationById(e.agentChannelId);if(i&&this.conversationDestroyed(i))return void this.destroyConversation(i)}}},P.prototype.registerCallClient=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:this.phone=n,this.subscribePhone(n),e.label=1;case 1:return e.trys.push([1,4,,5]),[4,this.deviceConfig(this.phone.type)];case 2:return t=e.sent(),[4,this.phone.register(t)];case 3:return e.sent(),[3,5];case 4:return t=e.sent(),this.log.error(t),[3,5];case 5:return[2]}})})},P.prototype.subscribePhone=function(e){var n=this;e.on("peerStreams",function(e,t){e=n.callBySession(e);e&&!e.peerStreams.length&&(e.setPeerStreams(t),n.eventHandler.emit(Br,g.CallActions.PeerStream,e))}),e.on("localStreams",function(e,t){e=n.callBySession(e);e&&!e.localStreams.length&&(e.setLocalStreams(t),n.eventHandler.emit(Br,g.CallActions.LocalStream,e))}),e.on("newSession",this.onNewCallSession.bind(this)),e.on("registered",function(){return n.emit("phone_registered",!0)}),e.on("unregistered",function(){return n.emit("phone_registered",!1)})},P.prototype.phoneIsRegister=function(){return!(!this.phone||!this.phone.isRegistered)&&this.phone.isRegistered()},P.prototype.deviceConfig=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("user_default_device",{name:t})]})})},P.prototype.storeFile=function(l,d,_){return ae.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return ae.__generator(this,function(e){switch(e.label){case 0:if(!d||d.length<1)throw new Error("no files");for(t=new FormData,n=0,r=d;n<r.length;n++)i=r[n],t.append(i.name,i);return[4,Z.post(this.basePath+"/api/storage/file/"+l+"/upload",t,{headers:((c={})["X-Webitel-Access"]=this._config.token,c),onUploadProgress:_})];case 1:for(c=e.sent(),a=c.data,s=0,o=a;s<o.length;s++)(u=o[s]).shared=this.basePath+u.shared;return[2,a]}})})},P.prototype.fileUrlDownload=function(e){return this.basePath+"/api/storage/file/"+e+"/download?access_token="+this._config.token},P.prototype.fileUrlStream=function(e){return this.basePath+"/api/storage/file/"+e+"/stream?access_token="+this._config.token},P.prototype.handleError=function(e){if(e)switch(e.name){case Fr.NotFoundError:this.emit("error",new gr(e.message));break;case Fr.NotAllowedError:this.emit("error",new br(e.message));break;default:this.emit("error",e)}},P.prototype.destroyConversation=function(e){this.conversationStore.delete(e.id),this.eventHandler.emit(Dr,g.ChatActions.Destroy,e)},P.prototype.onMessage=function(r){return ae.__awaiter(this,void 0,void 0,function(){var t,n;return ae.__generator(this,function(e){switch(e.label){case 0:return(this.log.debug("receive message: ",r),0<r.seq_reply)?(this.queueRequest.has(r.seq_reply)&&(t=this.queueRequest.get(r.seq_reply),this.queueRequest.delete(r.seq_reply),r.status===g.Response.STATUS_OK?t.resolve(r.data):(n=r.error)&&n.id===g.TypeErrors.RolePermission?t.reject(new qr(n.detail)):n&&n.id===g.TypeErrors.LicencePermission?t.reject(new Rr(n.detail)):t.reject(r.error)),[3,15]):[3,1];case 1:switch(r.event){case"hello":return[3,2];case Br:return[3,4];case Dr:return[3,6];case Hr:return[3,8];case"sip":return[3,9];case Mr:return[3,10];case"channel":return[3,11];case"error":return[3,12];case"notification":return[3,13]}return[3,14];case 2:return[4,this.connected(r.data)];case 3:return e.sent(),this.log.debug("opened session "+this.connectionInfo.sock_id+" for userId="+this.connectionInfo.session.user_id),[3,15];case 4:return[4,this.handleCallEvents(r.data.call)];case 5:return e.sent(),[3,15];case 6:return[4,this.handleChatEvents(r.data)];case 7:return e.sent(),[3,15];case 8:return this.handleUserStateEvent(r.data.state),[3,15];case 9:return this.eventHandler.emit("sip",r.data),[3,15];case 10:return this.handleAgentStatus(r.data),[3,15];case 11:return this.handleChannelEvents(r.data),[3,15];case 12:return this.lastError=r.data.error,[3,15];case 13:return this.handleNotification(r.data.notification),[3,15];case 14:this.log.error("event "+r.event+" not handler"),e.label=15;case 15:return[2]}})})},P.prototype.handleNotification=function(e){switch(e.action){case Xr.HideMember:if(this.agent&&this.agent._listOfflineMembers){var t=this.agent._listOfflineMembers;if(t.items)for(var n=0;n<t.items.length;n++)if(t.items[n].id===e.body.member_id){t.items.splice(n,1);break}}break;case Xr.WaitingList:this.agent&&this.agent.setWaitingList(e.body);break;case Xr.HideAttempt:this.agent&&this.agent.deleteWaitingAttempt(e.body);break;default:this.log.error('notification "'+e.action+'" not handled')}},P.prototype.handleAgentStatus=function(e){this.agent&&e.agent_id===this.agent.agentId&&this.agent.setStatus(e),this.eventHandler.emit(Mr,e,this.agent)},P.prototype.handleChannelEvents=function(e){var t;this.agent&&(e.timestamp=Date.now(),t=this.agent.onChannelEvent(e)||void 0,this.eventHandler.emit("task",e.status,t),t)&&Nr(t)&&(this.eventHandler.emit("job",t.state,t),e=t.state,-1<[g.ChannelState.Missed.toString(),g.ChannelState.Waiting,g.ChannelState.WrapTime,g.JobState.Closed].indexOf(e))&&this.eventHandler.emit("job",g.JobState.Destroy,t)},P.prototype.pingServer=function(){return ae.__awaiter(this,void 0,void 0,function(){var t,n=this;return ae.__generator(this,function(e){switch(e.label){case 0:return this.pingTimer&&this.connectionInfo.ping_interval?(t=setTimeout(function(){return ae.__awaiter(n,void 0,void 0,function(){return ae.__generator(this,function(e){return this.log.error("close socket without pong"),this.socket.close(3005),[2]})})},2e3),[4,this.ping()]):[3,2];case 1:e.sent(),clearTimeout(t),e.label=2;case 2:return this.connectionInfo.ping_interval&&(this.pingTimer=setTimeout(this.pingServer.bind(this),+this.connectionInfo.ping_interval)),[2]}})})},P.prototype.connected=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){switch(e.label){case 0:return(this.connectionInfo=t).ping_interval?[4,this.pingServer()]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.useWebPhone()?[2,this.registerCallClient(new pr(this.instanceId,this._config.debug))]:[2]}})})},P.prototype.callBySession=function(e){for(var t=0,n=this.allCall();t<n.length;t++){var r=n[t];if(r.sip&&r.sip.id===e.id)return r}},P.prototype.onNewCallSession=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){return(t=n.callId?this.callById(n.callId):this.callBySipId(n.id))&&(t.setSip(n),this.checkAutoAnswer(t)),[2]})})},P.prototype.checkAutoAnswer=function(e){e.autoAnswer&&e.answerDelay({video:e.params.video,screen:e.params.screen,disableStun:e.params.disableStun})},P.prototype.connectToSocket=function(){var n=this;return new Promise(function(e,t){try{n.socket=new Qr(n._config.endpoint),n.socket.connect(n._config.token)}catch(e){return void t(e)}n.socket.on("message",n.onMessage.bind(n)),n.socket.on("close",function(e){n.pingTimer&&clearTimeout(n.pingTimer),n.log.error("socket close code: ",e),1e3!==e&&(n.emit("disconnected",e,n.lastError),t(new Error("close socket code: "+e))),n.eventHandler.off("*")}),n.socket.on("open",function(){e(null),n.emit("connected")})})},P.prototype.handleUserStateEvent=function(e){this.eventHandler.emit(Hr,e)},P.prototype.handleCallEvents=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(n.timestamp=Date.now(),n.event){case g.CallActions.Ringing:t=new Er(this,n),this.callStore.set(t.id,t),this.checkAutoAnswer(t);break;case g.CallActions.Active:(t=this.callById(n.id))&&t.setActive(n);break;case g.CallActions.Bridge:(t=this.callById(n.id))&&t.setBridged(n);break;case g.CallActions.Execute:(t=this.callById(n.id))&&t.setExecute(n.data);break;case g.CallActions.DTMF:(t=this.callById(n.id))&&t.addDigit(n.data);break;case g.CallActions.Eavesdrop:(t=this.callById(n.id))&&t.setEavesdropState(n.data);break;case g.CallActions.Voice:(t=this.callById(n.id))&&t.setVoice();break;case g.CallActions.Silence:(t=this.callById(n.id))&&t.setSilence();break;case g.CallActions.Hold:(t=this.callById(n.id))&&t.setHold(n);break;case g.CallActions.Hangup:(t=this.callById(n.id))&&t.setHangup(n);break;default:throw new Error("Unhandled action")}return t&&(this.eventHandler.emit(Br,n.event,t),this.callDestroyed(t))&&this.destroyCall(t),[2]})})},P.prototype.handleChatEvents=function(f){return ae.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l,d,_,h,p;return ae.__generator(this,function(e){switch(n=Date.now(),f.action){case g.ChatActions.UserInvite:s=f.data,(t=new xr(this,s.conversation_id,s.title,s.members,s.messages,s.variables)).setInvite(s.invite_id,n),this.conversationStore.set(t.id,t);break;case g.ChatActions.MessageDeleted:for(r=f.data,i=0,a=this.allConversations();i<a.length;i++)if(!(h=a[i]).closedAt&&-1<h.membersId.indexOf(r.channel_id)){t=h;break}return t&&t.setDeletedMessage(r),[2];case g.ChatActions.Joined:s=f.data,(t=this.conversationById(s.member.id))&&t.setAnswered(s.member.id,n,s.member);break;case g.ChatActions.Message:for((o=f.data).timestamp=n,u=0,c=this.allConversations();u<c.length;u++)!(h=c[u]).closedAt&&-1<h.membersId.indexOf(o.channel_id)&&(t=h);t&&t.newMessage(o);break;case g.ChatActions.Close:for(l=f.data,d=0,_=this.allConversations();d<_.length;d++)!(h=_[d]).closedAt&&-1<h.membersId.indexOf(l.from_channel_id)&&(t=h);t&&t.setClosed(n);break;case g.ChatActions.Leave:p=f.data,(t=this.conversationById(p.leaved_channel_id))&&t.setLeave(p);break;case g.ChatActions.Decline:p=f.data,(t=this.conversationById(p.invite_id))&&t.setDecline(p)}return t&&(t.lastAction=f.action,this.eventHandler.emit(Dr,f.action,t),this.conversationDestroyed(t))&&this.destroyConversation(t),[2]})})},P.prototype.hasAgentTask=function(e){return!(!this.agent||!e)&&this.agent.hasTask(e)},P.prototype.destroyCall=function(e){this.callStore.delete(e.id),this.eventHandler.emit(Br,g.CallActions.Destroy,e)},P);function P(e){var t=Gr.call(this)||this;return t._config=e,t.reqSeq=0,t.queueRequest=new Map,t.log=new cr,t.eventHandler=new T.EventEmitter,t.callStore=new Map,t.conversationStore=new Map,t.pingTimer=null,t.basePath=""+(e=(e=(e=(e=e.storageEndpoint||e.endpoint).replace(/^ws/,"http")).endsWith("/")?e.slice(0,-1):e).endsWith("/ws")?e.slice(0,-3):e),t.lastError=null,t}function Nr(e){return e.channel===Pr.Task}Jr=T.EventEmitter,ae.__extends(zr,Jr);var Jr,Vr=zr;function zr(){return null!==Jr&&Jr.apply(this,arguments)||this}var $r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(function(c){var e=$r&&$r.__generator||function(r,i){var a,s,o,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(n){return function(e){var t=[n,e];if(a)throw new TypeError("Generator is already executing.");for(;u;)try{if(a=1,s&&(o=2&t[0]?s.return:t[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,t[1])).done)return o;switch(s=0,(t=o?[2&t[0],o.value]:t)[0]){case 0:case 1:o=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,s=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(o=0<(o=u.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3]))u.label=t[1];else if(6===t[0]&&u.label<o[1])u.label=o[1],o=t;else{if(!(o&&u.label<o[2])){o[2]&&u.ops.pop(),u.trys.pop();continue}u.label=o[2],u.ops.push(t)}}t=i.call(r,u)}catch(e){t=[6,e],s=0}finally{a=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},t=(Object.defineProperty(c,"__esModule",{value:!0}),c.$listeners=Symbol("EventEmitter.listeners"),c.$addListener=Symbol("EventEmitter.addListener"),n.count=function(e,t){var n=0,e=e[c.$listeners][t];if(e)for(var r=e.first;++n&&r.next;)r=r.next;return n},n.has=function(e,t){if("*"!=t)return void 0!==e[c.$listeners][t];for(t in e[c.$listeners])return!0;return!1},n.keys=function(e){return Object.keys(e[c.$listeners])},n.unhandle=function(n,r,i,e){return n.on(r,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!n[c.$listeners][r].first.next)return i.apply(void 0,e)},e)},n.prototype.on=function(e,t,n){return"function"==typeof t?this[c.$addListener](e,t,n):this[c.$addListener](e,void 0,t)},n.prototype.one=function(e,t,n){return"function"==typeof t?this[c.$addListener](e,t,n,!0):this[c.$addListener](e,void 0,t,!0)},n.prototype.off=function(e,t){if("*"==e){var n=this[c.$listeners];if(this[c.$listeners]={},this._onEventUnhandled)for(var r in n)this._onEventUnhandled(r)}else{if("function"==typeof t){n=this[c.$listeners][e];if(n&&function(e,t){var n=null,r=e.first;for(;;)if(t(r))if(n){if(n.next=r.next,!r.next)break;r=r.next}else{if(!r.next)return;e.first=r=r.next}else{if(!(n=r).next)break;r=r.next}return e.last=n,e}(n,function(e){return e.fn==t}))return this}delete this[c.$listeners][e],this._onEventUnhandled&&this._onEventUnhandled(e)}return this},n.prototype.emit=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];for(var i=this.listeners(e);;){var a=i.next(),s=a.value;if(a.done)return t;a=s.apply(void 0,n);void 0!==a&&(t=a)}},n.prototype.listeners=function(t){var n,r,i;return e(this,function(e){switch(e.label){case 0:if(!(n=this[c.$listeners][t]))return[2];r=null,i=n.first,e.label=1;case 1:return[4,i.fn];case 2:if(e.sent(),i.once){if(!r)return i.next?(n.first=i=i.next,[3,1]):(delete this[c.$listeners][t],this._onEventUnhandled&&this._onEventUnhandled(t),[2]);r.next=i.next}else r=i;return i.next?(i=i.next,[3,1]):(n.last=i,[2]);case 3:return[2]}})},n.prototype[c.$addListener]=function(n,e,r,i){var t,a,s=this;if(void 0===i&&(i=!1),"object"!=typeof n)return"function"==typeof e&&(a=l(this[c.$listeners],t=n,{fn:e,once:i,next:null}),r&&r.push({dispose:function(){return s.off(t,e)}}),e==a.first.fn)&&this._onEventHandled&&this._onEventHandled(n),e;var o,u=this;for(o in n)!function(){var e,t;"function"==typeof n[o]&&(e=n[o],t=l(u[c.$listeners],o,{fn:e,once:i,next:null}),r&&r.push({dispose:function(){return s.off(o,e)}}),e==t.first.fn)&&u._onEventHandled&&u._onEventHandled(o)}();return this},n.ev=c.$listeners,n);function n(){this[c.$listeners]={}}function l(e,t,n){var r=e[t];return r?(r.last.next=n,r.last=n):e[t]=r={first:n,last:n},r}c.EventEmitter=t})((Yr={exports:{}},Yr.exports));var Yr=Yr.exports,Zr=((Zr=Yr)&&Zr.__esModule&&Object.prototype.hasOwnProperty.call(Zr,"default")&&Zr.default,Yr.$listeners,Yr.$addListener,Yr.EventEmitter),ei=(Object.defineProperty(ti.prototype,"id",{get:function(){return this.callId},enumerable:!1,configurable:!0}),ti.prototype.getLocalMedia=function(){return[]},ti.prototype.getPeerMedia=function(){return[]},ti.prototype.answer=function(e){var t=this;return new Promise(function(e){t.client.answer(t.id),e()})},ti);function ti(e,t){this.client=e,this.callId=t,this.incoming=!1,this.instanceId="fixme"}ni=Zr,ae.__extends(ri,ni),ri.prototype.callOption=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,t]})})},ri.prototype.register=function(e){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2]})})},ri.prototype.unregister=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2]})})},ri.prototype.call=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return t.destination&&this.exec(t.destination),[2]})})},ri.prototype.answer=function(e){this.exec(e,"answer")},ri.prototype.isRegistered=function(){return!1},ri.prototype.sipSessionByCallId=function(e){return new ei(this,e)},ri.prototype.sipSessionBySipId=function(e){return null},ri.prototype.open=function(e){this.exec(encodeURIComponent(JSON.stringify(ae.__assign({token:e},this.config))),"open")},ri.prototype.exec=function(e,t){e=""+this.schema+e,t&&(e+=" "+t),t=document.createElement("a");t.download="File name",t.href=e,t.click()};var ni,Yr=ri;function ri(e){var t=ni.call(this)||this;return t.config=e,t.type="external",t.schema="wtel://",t}g.AgentPauseCauseServiceApiAxiosParamCreator=E,g.AgentPauseCauseServiceApiFp=X,g.AgentPauseCauseServiceApiFactory=function(o,u,c){return{createAgentPauseCause:function(e,t){return X(o).createAgentPauseCause(e,t).then(function(e){return e(c,u)})},deleteAgentPauseCause:function(e,t){return X(o).deleteAgentPauseCause(e,t).then(function(e){return e(c,u)})},patchAgentPauseCause:function(e,t,n){return X(o).patchAgentPauseCause(e,t,n).then(function(e){return e(c,u)})},readAgentPauseCause:function(e,t){return X(o).readAgentPauseCause(e,t).then(function(e){return e(c,u)})},searchAgentPauseCause:function(e,t,n,r,i,a,s){return X(o).searchAgentPauseCause(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateAgentPauseCause:function(e,t,n){return X(o).updateAgentPauseCause(e,t,n).then(function(e){return e(c,u)})}}},g.AgentPauseCauseServiceApi=j,g.AgentServiceApiAxiosParamCreator=A,g.AgentServiceApiFp=C,g.AgentServiceApiFactory=function(w,m,q){return{agentSetState:function(e,t,n){return C(w).agentSetState(e,t,n).then(function(e){return e(q,m)})},agentStateHistory:function(e,t,n,r,i,a,s,o){return C(w).agentStateHistory(e,t,n,r,i,a,s,o).then(function(e){return e(q,m)})},agentTodayStatistics:function(e,t,n){return C(w).agentTodayStatistics(e,t,n).then(function(e){return e(q,m)})},createAgent:function(e,t){return C(w).createAgent(e,t).then(function(e){return e(q,m)})},deleteAgent:function(e,t,n){return C(w).deleteAgent(e,t,n).then(function(e){return e(q,m)})},patchAgent:function(e,t,n){return C(w).patchAgent(e,t,n).then(function(e){return e(q,m)})},readAgent:function(e,t,n){return C(w).readAgent(e,t,n).then(function(e){return e(q,m)})},searchAgent:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b){return C(w).searchAgent(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b).then(function(e){return e(q,m)})},searchAgentCallStatistics:function(e,t,n,r,i,a,s,o,u,c){return C(w).searchAgentCallStatistics(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(q,m)})},searchAgentInQueue:function(e,t,n,r,i,a,s){return C(w).searchAgentInQueue(e,t,n,r,i,a,s).then(function(e){return e(q,m)})},searchAgentInQueueStatistics:function(e,t,n){return C(w).searchAgentInQueueStatistics(e,t,n).then(function(e){return e(q,m)})},searchAgentInTeam:function(e,t,n,r,i,a){return C(w).searchAgentInTeam(e,t,n,r,i,a).then(function(e){return e(q,m)})},searchAgentStateHistory:function(e,t,n,r,i,a,s,o,u){return C(w).searchAgentStateHistory(e,t,n,r,i,a,s,o,u).then(function(e){return e(q,m)})},searchAgentStatusStatistic:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y){return C(w).searchAgentStatusStatistic(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y).then(function(e){return e(q,m)})},searchAgentStatusStatisticItem:function(e,t,n,r){return C(w).searchAgentStatusStatisticItem(e,t,n,r).then(function(e){return e(q,m)})},searchLookupUsersAgentNotExists:function(e,t,n,r,i){return C(w).searchLookupUsersAgentNotExists(e,t,n,r,i).then(function(e){return e(q,m)})},searchPauseCauseForAgent:function(e,t,n){return C(w).searchPauseCauseForAgent(e,t,n).then(function(e){return e(q,m)})},updateAgent:function(e,t,n){return C(w).updateAgent(e,t,n).then(function(e){return e(q,m)})},updateAgentStatus:function(e,t,n){return C(w).updateAgentStatus(e,t,n).then(function(e){return e(q,m)})}}},g.AgentServiceApi=L,g.AgentSkillServiceApiAxiosParamCreator=F,g.AgentSkillServiceApiFp=_,g.AgentSkillServiceApiFactory=function(c,l,d){return{createAgentSkill:function(e,t,n){return _(c).createAgentSkill(e,t,n).then(function(e){return e(d,l)})},createAgentSkills:function(e,t,n){return _(c).createAgentSkills(e,t,n).then(function(e){return e(d,l)})},deleteAgentSkill:function(e,t,n,r){return _(c).deleteAgentSkill(e,t,n,r).then(function(e){return e(d,l)})},deleteAgentSkills:function(e,t,n,r){return _(c).deleteAgentSkills(e,t,n,r).then(function(e){return e(d,l)})},patchAgentSkill:function(e,t,n,r){return _(c).patchAgentSkill(e,t,n,r).then(function(e){return e(d,l)})},patchAgentSkills:function(e,t,n){return _(c).patchAgentSkills(e,t,n).then(function(e){return e(d,l)})},readAgentSkill:function(e,t,n,r){return _(c).readAgentSkill(e,t,n,r).then(function(e){return e(d,l)})},searchAgentSkill:function(e,t,n,r,i,a,s,o,u){return _(c).searchAgentSkill(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},searchLookupAgentNotExistsSkill:function(e,t,n,r,i,a){return _(c).searchLookupAgentNotExistsSkill(e,t,n,r,i,a).then(function(e){return e(d,l)})},updateAgentSkill:function(e,t,n,r){return _(c).updateAgentSkill(e,t,n,r).then(function(e){return e(d,l)})}}},g.AgentSkillServiceApi=B,g.AgentTeamServiceApiAxiosParamCreator=H,g.AgentTeamServiceApiFp=M,g.AgentTeamServiceApiFactory=function(c,l,d){return{createAgentTeam:function(e,t){return M(c).createAgentTeam(e,t).then(function(e){return e(d,l)})},deleteAgentTeam:function(e,t,n){return M(c).deleteAgentTeam(e,t,n).then(function(e){return e(d,l)})},readAgentTeam:function(e,t,n){return M(c).readAgentTeam(e,t,n).then(function(e){return e(d,l)})},searchAgentTeam:function(e,t,n,r,i,a,s,o,u){return M(c).searchAgentTeam(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateAgentTeam:function(e,t,n){return M(c).updateAgentTeam(e,t,n).then(function(e){return e(d,l)})}}},g.AgentTeamServiceApi=J,g.AuditFormServiceApiAxiosParamCreator=z,g.AuditFormServiceApiFp=v,g.AuditFormServiceApiFactory=function(h,p,f){return{createAuditForm:function(e,t){return v(h).createAuditForm(e,t).then(function(e){return e(f,p)})},createAuditFormRate:function(e,t){return v(h).createAuditFormRate(e,t).then(function(e){return e(f,p)})},deleteAuditForm:function(e,t){return v(h).deleteAuditForm(e,t).then(function(e){return e(f,p)})},patchAuditForm:function(e,t,n){return v(h).patchAuditForm(e,t,n).then(function(e){return e(f,p)})},readAuditForm:function(e,t){return v(h).readAuditForm(e,t).then(function(e){return e(f,p)})},readAuditRate:function(e,t){return v(h).readAuditRate(e,t).then(function(e){return e(f,p)})},searchAuditForm:function(e,t,n,r,i,a,s,o,u,c,l,d,_){return v(h).searchAuditForm(e,t,n,r,i,a,s,o,u,c,l,d,_).then(function(e){return e(f,p)})},searchAuditRate:function(e,t,n,r,i,a,s,o,u,c,l,d){return v(h).searchAuditRate(e,t,n,r,i,a,s,o,u,c,l,d).then(function(e){return e(f,p)})},updateAuditForm:function(e,t,n){return v(h).updateAuditForm(e,t,n).then(function(e){return e(f,p)})}}},g.AuditFormServiceApi=Y,g.BackendProfileServiceApiAxiosParamCreator=ie,g.BackendProfileServiceApiFp=oe,g.BackendProfileServiceApiFactory=function(o,u,c){return{createBackendProfile:function(e,t){return oe(o).createBackendProfile(e,t).then(function(e){return e(c,u)})},deleteBackendProfile:function(e,t,n){return oe(o).deleteBackendProfile(e,t,n).then(function(e){return e(c,u)})},patchBackendProfile:function(e,t,n){return oe(o).patchBackendProfile(e,t,n).then(function(e){return e(c,u)})},readBackendProfile:function(e,t,n){return oe(o).readBackendProfile(e,t,n).then(function(e){return e(c,u)})},searchBackendProfile:function(e,t,n,r,i,a,s){return oe(o).searchBackendProfile(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateBackendProfile:function(e,t,n){return oe(o).updateBackendProfile(e,t,n).then(function(e){return e(c,u)})}}},g.BackendProfileServiceApi=ce,g.BucketServiceApiAxiosParamCreator=de,g.BucketServiceApiFp=_e,g.BucketServiceApiFactory=function(o,u,c){return{createBucket:function(e,t){return _e(o).createBucket(e,t).then(function(e){return e(c,u)})},deleteBucket:function(e,t,n){return _e(o).deleteBucket(e,t,n).then(function(e){return e(c,u)})},readBucket:function(e,t,n){return _e(o).readBucket(e,t,n).then(function(e){return e(c,u)})},searchBucket:function(e,t,n,r,i,a,s){return _e(o).searchBucket(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateBucket:function(e,t,n){return _e(o).updateBucket(e,t,n).then(function(e){return e(c,u)})}}},g.BucketServiceApi=pe,g.CalendarServiceApiAxiosParamCreator=ge,g.CalendarServiceApiFp=ve,g.CalendarServiceApiFactory=function(o,u,c){return{createCalendar:function(e,t){return ve(o).createCalendar(e,t).then(function(e){return e(c,u)})},deleteCalendar:function(e,t,n){return ve(o).deleteCalendar(e,t,n).then(function(e){return e(c,u)})},readCalendar:function(e,t,n){return ve(o).readCalendar(e,t,n).then(function(e){return e(c,u)})},searchCalendar:function(e,t,n,r,i,a,s){return ve(o).searchCalendar(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},searchTimezones:function(e,t,n,r,i,a,s){return ve(o).searchTimezones(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateCalendar:function(e,t,n){return ve(o).updateCalendar(e,t,n).then(function(e){return e(c,u)})}}},g.CalendarServiceApi=be,g.CallServiceApiAxiosParamCreator=te,g.CallServiceApiFp=ne,g.CallServiceApiFactory=function(z,$,Y){return{aggregateHistoryCall:function(e,t){return ne(z).aggregateHistoryCall(e,t).then(function(e){return e(Y,$)})},blindTransferCall:function(e,t,n){return ne(z).blindTransferCall(e,t,n).then(function(e){return e(Y,$)})},confirmPush:function(e,t){return ne(z).confirmPush(e,t).then(function(e){return e(Y,$)})},createCall:function(e,t){return ne(z).createCall(e,t).then(function(e){return e(Y,$)})},createCallAnnotation:function(e,t,n){return ne(z).createCallAnnotation(e,t,n).then(function(e){return e(Y,$)})},deleteCallAnnotation:function(e,t,n){return ne(z).deleteCallAnnotation(e,t,n).then(function(e){return e(Y,$)})},dtmfCall:function(e,t,n){return ne(z).dtmfCall(e,t,n).then(function(e){return e(Y,$)})},eavesdropCall:function(e,t,n){return ne(z).eavesdropCall(e,t,n).then(function(e){return e(Y,$)})},hangupCall:function(e,t,n){return ne(z).hangupCall(e,t,n).then(function(e){return e(Y,$)})},holdCall:function(e,t,n){return ne(z).holdCall(e,t,n).then(function(e){return e(Y,$)})},patchHistoryCall:function(e,t,n){return ne(z).patchHistoryCall(e,t,n).then(function(e){return e(Y,$)})},readCall:function(e,t,n){return ne(z).readCall(e,t,n).then(function(e){return e(Y,$)})},searchActiveCall:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T){return ne(z).searchActiveCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T).then(function(e){return e(Y,$)})},searchHistoryCall:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I,k,W,E,X,x,j,U,Q,L,F,G,B,D,H,M,N,J,V){return ne(z).searchHistoryCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I,k,W,E,X,x,j,U,Q,L,F,G,B,D,H,M,N,J,V).then(function(e){return e(Y,$)})},searchHistoryCallPost:function(e,t){return ne(z).searchHistoryCallPost(e,t).then(function(e){return e(Y,$)})},setVariablesCall:function(e,t,n){return ne(z).setVariablesCall(e,t,n).then(function(e){return e(Y,$)})},unHoldCall:function(e,t,n){return ne(z).unHoldCall(e,t,n).then(function(e){return e(Y,$)})},updateCallAnnotation:function(e,t,n,r){return ne(z).updateCallAnnotation(e,t,n,r).then(function(e){return e(Y,$)})}}},g.CallServiceApi=qe,g.ChatHelperServiceApiAxiosParamCreator=Ae,g.ChatHelperServiceApiFp=Ce,g.ChatHelperServiceApiFactory=function(r,i,a){return{broadcast:function(e,t,n){return Ce(r).broadcast(e,t,n).then(function(e){return e(a,i)})}}},g.ChatHelperServiceApi=Se,g.CognitiveProfileServiceApiAxiosParamCreator=Pe,g.CognitiveProfileServiceApiFp=Te,g.CognitiveProfileServiceApiFactory=function(c,l,d){return{createCognitiveProfile:function(e,t){return Te(c).createCognitiveProfile(e,t).then(function(e){return e(d,l)})},deleteCognitiveProfile:function(e,t){return Te(c).deleteCognitiveProfile(e,t).then(function(e){return e(d,l)})},patchCognitiveProfile:function(e,t,n){return Te(c).patchCognitiveProfile(e,t,n).then(function(e){return e(d,l)})},readCognitiveProfile:function(e,t){return Te(c).readCognitiveProfile(e,t).then(function(e){return e(d,l)})},searchCognitiveProfile:function(e,t,n,r,i,a,s,o,u){return Te(c).searchCognitiveProfile(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateCognitiveProfile:function(e,t,n){return Te(c).updateCognitiveProfile(e,t,n).then(function(e){return e(d,l)})}}},g.CognitiveProfileServiceApi=Ie,g.CommunicationTypeServiceApiAxiosParamCreator=We,g.CommunicationTypeServiceApiFp=Ee,g.CommunicationTypeServiceApiFactory=function(u,c,l){return{createCommunicationType:function(e,t){return Ee(u).createCommunicationType(e,t).then(function(e){return e(l,c)})},deleteCommunicationType:function(e,t,n){return Ee(u).deleteCommunicationType(e,t,n).then(function(e){return e(l,c)})},readCommunicationType:function(e,t,n){return Ee(u).readCommunicationType(e,t,n).then(function(e){return e(l,c)})},searchCommunicationType:function(e,t,n,r,i,a,s,o){return Ee(u).searchCommunicationType(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateCommunicationType:function(e,t,n){return Ee(u).updateCommunicationType(e,t,n).then(function(e){return e(l,c)})}}},g.CommunicationTypeServiceApi=xe,g.ConfigServiceApiAxiosParamCreator=Ue,g.ConfigServiceApiFp=c,g.ConfigServiceApiFactory=function(s,o,u){return{createConfig:function(e,t){return c(s).createConfig(e,t).then(function(e){return e(u,o)})},deleteConfig:function(e,t){return c(s).deleteConfig(e,t).then(function(e){return e(u,o)})},deleteConfigBulk:function(e,t){return c(s).deleteConfigBulk(e,t).then(function(e){return e(u,o)})},patchConfig:function(e,t,n){return c(s).patchConfig(e,t,n).then(function(e){return e(u,o)})},readConfig:function(e,t){return c(s).readConfig(e,t).then(function(e){return e(u,o)})},readSystemObjects:function(e,t){return c(s).readSystemObjects(e,t).then(function(e){return e(u,o)})},searchConfig:function(e,t,n,r,i,a){return c(s).searchConfig(e,t,n,r,i,a).then(function(e){return e(u,o)})},updateConfig:function(e,t,n){return c(s).updateConfig(e,t,n).then(function(e){return e(u,o)})}}},g.ConfigServiceApi=Le,g.ContactsApiAxiosParamCreator=Ge,g.ContactsApiFp=Be,g.ContactsApiFactory=function(c,l,d){return{createContact:function(e,t,n){return Be(c).createContact(e,t,n).then(function(e){return e(d,l)})},deleteContact:function(e,t,n){return Be(c).deleteContact(e,t,n).then(function(e){return e(d,l)})},locateContact:function(e,t,n,r){return Be(c).locateContact(e,t,n,r).then(function(e){return e(d,l)})},searchContacts:function(e,t,n,r,i,a,s,o,u){return Be(c).searchContacts(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateContact:function(e,t,n,r){return Be(c).updateContact(e,t,n,r).then(function(e){return e(d,l)})}}},g.ContactsApi=He,g.EmailProfileServiceApiAxiosParamCreator=Ne,g.EmailProfileServiceApiFp=l,g.EmailProfileServiceApiFactory=function(s,o,u){return{createEmailProfile:function(e,t){return l(s).createEmailProfile(e,t).then(function(e){return e(u,o)})},deleteEmailProfile:function(e,t){return l(s).deleteEmailProfile(e,t).then(function(e){return e(u,o)})},loginEmailProfile:function(e,t){return l(s).loginEmailProfile(e,t).then(function(e){return e(u,o)})},patchEmailProfile:function(e,t,n){return l(s).patchEmailProfile(e,t,n).then(function(e){return e(u,o)})},readEmailProfile:function(e,t){return l(s).readEmailProfile(e,t).then(function(e){return e(u,o)})},searchEmailProfile:function(e,t,n,r,i,a){return l(s).searchEmailProfile(e,t,n,r,i,a).then(function(e){return e(u,o)})},testEmailProfile:function(e,t){return l(s).testEmailProfile(e,t).then(function(e){return e(u,o)})},updateEmailProfile:function(e,t,n){return l(s).updateEmailProfile(e,t,n).then(function(e){return e(u,o)})}}},g.EmailProfileServiceApi=Ve,g.EmailsApiAxiosParamCreator=$e,g.EmailsApiFp=y,g.EmailsApiFactory=function(h,p,f){return{deleteEmail:function(e,t,n,r){return y(h).deleteEmail(e,t,n,r).then(function(e){return e(f,p)})},deleteEmails:function(e,t,n,r){return y(h).deleteEmails(e,t,n,r).then(function(e){return e(f,p)})},listEmails:function(e,t,n,r,i,a,s,o,u,c,l,d,_){return y(h).listEmails(e,t,n,r,i,a,s,o,u,c,l,d,_).then(function(e){return e(f,p)})},locateEmail:function(e,t,n,r){return y(h).locateEmail(e,t,n,r).then(function(e){return e(f,p)})},mergeEmails:function(e,t,n,r){return y(h).mergeEmails(e,t,n,r).then(function(e){return e(f,p)})},resetEmails:function(e,t,n,r){return y(h).resetEmails(e,t,n,r).then(function(e){return e(f,p)})},updateEmail:function(e,t,n,r,i){return y(h).updateEmail(e,t,n,r,i).then(function(e){return e(f,p)})},updateEmail2:function(e,t,n,r,i){return y(h).updateEmail2(e,t,n,r,i).then(function(e){return e(f,p)})}}},g.EmailsApi=Ze,g.FileServiceApiAxiosParamCreator=tt,g.FileServiceApiFp=nt,g.FileServiceApiFactory=function(n,r,i){return{deleteFiles:function(e,t){return nt(n).deleteFiles(e,t).then(function(e){return e(i,r)})}}},g.FileServiceApi=it,g.FileTranscriptServiceApiAxiosParamCreator=st,g.FileTranscriptServiceApiFp=ot,g.FileTranscriptServiceApiFactory=function(i,a,s){return{createFileTranscript:function(e,t){return ot(i).createFileTranscript(e,t).then(function(e){return e(s,a)})},deleteFileTranscript:function(e,t){return ot(i).deleteFileTranscript(e,t).then(function(e){return e(s,a)})},getFileTranscriptPhrases:function(e,t,n,r){return ot(i).getFileTranscriptPhrases(e,t,n,r).then(function(e){return e(s,a)})}}},g.FileTranscriptServiceApi=ct,g.ImportTemplateServiceApiAxiosParamCreator=dt,g.ImportTemplateServiceApiFp=_t,g.ImportTemplateServiceApiFactory=function(o,u,c){return{createImportTemplate:function(e,t){return _t(o).createImportTemplate(e,t).then(function(e){return e(c,u)})},deleteImportTemplate:function(e,t){return _t(o).deleteImportTemplate(e,t).then(function(e){return e(c,u)})},patchImportTemplate:function(e,t,n){return _t(o).patchImportTemplate(e,t,n).then(function(e){return e(c,u)})},readImportTemplate:function(e,t){return _t(o).readImportTemplate(e,t).then(function(e){return e(c,u)})},searchImportTemplate:function(e,t,n,r,i,a,s){return _t(o).searchImportTemplate(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateImportTemplate:function(e,t,n){return _t(o).updateImportTemplate(e,t,n).then(function(e){return e(c,u)})}}},g.ImportTemplateServiceApi=pt,g.LabelsApiAxiosParamCreator=gt,g.LabelsApiFp=vt,g.LabelsApiFactory=function(u,c,l){return{deleteLabels:function(e,t,n,r){return vt(u).deleteLabels(e,t,n,r).then(function(e){return e(l,c)})},getLabels:function(e,t,n,r){return vt(u).getLabels(e,t,n,r).then(function(e){return e(l,c)})},listLabels:function(e,t,n,r,i,a,s,o){return vt(u).listLabels(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},mergeLabels:function(e,t,n,r){return vt(u).mergeLabels(e,t,n,r).then(function(e){return e(l,c)})},resetLabels:function(e,t,n,r){return vt(u).resetLabels(e,t,n,r).then(function(e){return e(l,c)})}}},g.LabelsApi=bt,g.ListServiceApiAxiosParamCreator=mt,g.ListServiceApiFp=h,g.ListServiceApiFactory=function(l,d,_){return{createList:function(e,t){return h(l).createList(e,t).then(function(e){return e(_,d)})},createListCommunication:function(e,t,n){return h(l).createListCommunication(e,t,n).then(function(e){return e(_,d)})},deleteList:function(e,t,n){return h(l).deleteList(e,t,n).then(function(e){return e(_,d)})},deleteListCommunication:function(e,t,n,r){return h(l).deleteListCommunication(e,t,n,r).then(function(e){return e(_,d)})},readList:function(e,t,n){return h(l).readList(e,t,n).then(function(e){return e(_,d)})},readListCommunication:function(e,t,n,r){return h(l).readListCommunication(e,t,n,r).then(function(e){return e(_,d)})},searchList:function(e,t,n,r,i,a,s){return h(l).searchList(e,t,n,r,i,a,s).then(function(e){return e(_,d)})},searchListCommunication:function(e,t,n,r,i,a,s,o,u,c){return h(l).searchListCommunication(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},updateList:function(e,t,n){return h(l).updateList(e,t,n).then(function(e){return e(_,d)})},updateListCommunication:function(e,t,n,r){return h(l).updateListCommunication(e,t,n,r).then(function(e){return e(_,d)})}}},g.ListServiceApi=At,g.LoggerServiceApiAxiosParamCreator=Rt,g.LoggerServiceApiFp=St,g.LoggerServiceApiFactory=function(h,p,f){return{searchLogByConfigId:function(e,t,n,r,i,a,s,o,u,c,l,d,_){return St(h).searchLogByConfigId(e,t,n,r,i,a,s,o,u,c,l,d,_).then(function(e){return e(f,p)})},searchLogByUserId:function(e,t,n,r,i,a,s,o,u,c,l,d,_){return St(h).searchLogByUserId(e,t,n,r,i,a,s,o,u,c,l,d,_).then(function(e){return e(f,p)})}}},g.LoggerServiceApi=Pt,g.MediaFileServiceApiAxiosParamCreator=Ot,g.MediaFileServiceApiFp=It,g.MediaFileServiceApiFactory=function(o,u,c){return{deleteMediaFile:function(e,t,n){return It(o).deleteMediaFile(e,t,n).then(function(e){return e(c,u)})},readMediaFile:function(e,t,n){return It(o).readMediaFile(e,t,n).then(function(e){return e(c,u)})},searchMediaFile:function(e,t,n,r,i,a,s){return It(o).searchMediaFile(e,t,n,r,i,a,s).then(function(e){return e(c,u)})}}},g.MediaFileServiceApi=Wt,g.MemberServiceApiAxiosParamCreator=R,g.MemberServiceApiFp=S,g.MemberServiceApiFactory=function(m,q,A){return{attemptCallback:function(e,t,n){return S(m).attemptCallback(e,t,n).then(function(e){return e(A,q)})},attemptResult:function(e,t,n,r,i){return S(m).attemptResult(e,t,n,r,i).then(function(e){return e(A,q)})},attemptsRenewalResult:function(e,t,n){return S(m).attemptsRenewalResult(e,t,n).then(function(e){return e(A,q)})},createAttempt:function(e,t,n,r){return S(m).createAttempt(e,t,n,r).then(function(e){return e(A,q)})},createMember:function(e,t,n){return S(m).createMember(e,t,n).then(function(e){return e(A,q)})},createMemberBulk:function(e,t,n){return S(m).createMemberBulk(e,t,n).then(function(e){return e(A,q)})},deleteMember:function(e,t,n,r){return S(m).deleteMember(e,t,n,r).then(function(e){return e(A,q)})},deleteMembers:function(e,t,n){return S(m).deleteMembers(e,t,n).then(function(e){return e(A,q)})},patchMember:function(e,t,n,r){return S(m).patchMember(e,t,n,r).then(function(e){return e(A,q)})},readMember:function(e,t,n,r){return S(m).readMember(e,t,n,r).then(function(e){return e(A,q)})},resetMembers:function(e,t,n){return S(m).resetMembers(e,t,n).then(function(e){return e(A,q)})},searchAttempts:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b){return S(m).searchAttempts(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b).then(function(e){return e(A,q)})},searchAttemptsHistory:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b){return S(m).searchAttemptsHistory(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b).then(function(e){return e(A,q)})},searchMemberAttempts:function(e,t,n,r){return S(m).searchMemberAttempts(e,t,n,r).then(function(e){return e(A,q)})},searchMemberInQueue:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){return S(m).searchMemberInQueue(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w).then(function(e){return e(A,q)})},searchMembers:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){return S(m).searchMembers(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w).then(function(e){return e(A,q)})},updateMember:function(e,t,n,r){return S(m).updateMember(e,t,n,r).then(function(e){return e(A,q)})}}},g.MemberServiceApi=xt,g.OutboundResourceGroupServiceApiAxiosParamCreator=jt,g.OutboundResourceGroupServiceApiFp=d,g.OutboundResourceGroupServiceApiFactory=function(u,c,l){return{createOutboundResourceGroup:function(e,t){return d(u).createOutboundResourceGroup(e,t).then(function(e){return e(l,c)})},createOutboundResourceInGroup:function(e,t,n){return d(u).createOutboundResourceInGroup(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceGroup:function(e,t,n){return d(u).deleteOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceInGroup:function(e,t,n,r){return d(u).deleteOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})},readOutboundResourceGroup:function(e,t,n){return d(u).readOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},readOutboundResourceInGroup:function(e,t,n,r){return d(u).readOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})},searchOutboundResourceGroup:function(e,t,n,r,i,a,s){return d(u).searchOutboundResourceGroup(e,t,n,r,i,a,s).then(function(e){return e(l,c)})},searchOutboundResourceInGroup:function(e,t,n,r,i,a,s,o){return d(u).searchOutboundResourceInGroup(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateOutboundResourceGroup:function(e,t,n){return d(u).updateOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},updateOutboundResourceInGroup:function(e,t,n,r){return d(u).updateOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})}}},g.OutboundResourceGroupServiceApi=Qt,g.OutboundResourceServiceApiAxiosParamCreator=Ft,g.OutboundResourceServiceApiFp=p,g.OutboundResourceServiceApiFactory=function(u,c,l){return{createOutboundResource:function(e,t){return p(u).createOutboundResource(e,t).then(function(e){return e(l,c)})},createOutboundResourceDisplay:function(e,t,n){return p(u).createOutboundResourceDisplay(e,t,n).then(function(e){return e(l,c)})},createOutboundResourceDisplayBulk:function(e,t,n){return p(u).createOutboundResourceDisplayBulk(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResource:function(e,t,n){return p(u).deleteOutboundResource(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceDisplay:function(e,t,n,r){return p(u).deleteOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})},deleteOutboundResourceDisplays:function(e,t,n){return p(u).deleteOutboundResourceDisplays(e,t,n).then(function(e){return e(l,c)})},patchOutboundResource:function(e,t,n){return p(u).patchOutboundResource(e,t,n).then(function(e){return e(l,c)})},readOutboundResource:function(e,t,n){return p(u).readOutboundResource(e,t,n).then(function(e){return e(l,c)})},readOutboundResourceDisplay:function(e,t,n,r){return p(u).readOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})},searchOutboundResource:function(e,t,n,r,i,a,s){return p(u).searchOutboundResource(e,t,n,r,i,a,s).then(function(e){return e(l,c)})},searchOutboundResourceDisplay:function(e,t,n,r,i,a,s,o){return p(u).searchOutboundResourceDisplay(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateOutboundResource:function(e,t,n){return p(u).updateOutboundResource(e,t,n).then(function(e){return e(l,c)})},updateOutboundResourceDisplay:function(e,t,n,r){return p(u).updateOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})}}},g.OutboundResourceServiceApi=Bt,g.PresetQueryServiceApiAxiosParamCreator=Dt,g.PresetQueryServiceApiFp=Ht,g.PresetQueryServiceApiFactory=function(u,c,l){return{createPresetQuery:function(e,t){return Ht(u).createPresetQuery(e,t).then(function(e){return e(l,c)})},deletePresetQuery:function(e,t){return Ht(u).deletePresetQuery(e,t).then(function(e){return e(l,c)})},patchPresetQuery:function(e,t,n){return Ht(u).patchPresetQuery(e,t,n).then(function(e){return e(l,c)})},readPresetQuery:function(e,t){return Ht(u).readPresetQuery(e,t).then(function(e){return e(l,c)})},searchPresetQuery:function(e,t,n,r,i,a,s,o){return Ht(u).searchPresetQuery(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updatePresetQuery:function(e,t,n){return Ht(u).updatePresetQuery(e,t,n).then(function(e){return e(l,c)})}}},g.PresetQueryServiceApi=Nt,g.QueueBucketServiceApiAxiosParamCreator=Vt,g.QueueBucketServiceApiFp=zt,g.QueueBucketServiceApiFactory=function(u,c,l){return{createQueueBucket:function(e,t,n){return zt(u).createQueueBucket(e,t,n).then(function(e){return e(l,c)})},deleteQueueBucket:function(e,t,n){return zt(u).deleteQueueBucket(e,t,n).then(function(e){return e(l,c)})},patchQueueBucket:function(e,t,n,r){return zt(u).patchQueueBucket(e,t,n,r).then(function(e){return e(l,c)})},readQueueBucket:function(e,t,n){return zt(u).readQueueBucket(e,t,n).then(function(e){return e(l,c)})},searchQueueBucket:function(e,t,n,r,i,a,s,o){return zt(u).searchQueueBucket(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateQueueBucket:function(e,t,n,r){return zt(u).updateQueueBucket(e,t,n,r).then(function(e){return e(l,c)})}}},g.QueueBucketServiceApi=Yt,g.QueueHookServiceApiAxiosParamCreator=en,g.QueueHookServiceApiFp=tn,g.QueueHookServiceApiFactory=function(l,d,_){return{createQueueHook:function(e,t,n){return tn(l).createQueueHook(e,t,n).then(function(e){return e(_,d)})},deleteQueueHook:function(e,t,n){return tn(l).deleteQueueHook(e,t,n).then(function(e){return e(_,d)})},patchQueueHook:function(e,t,n,r){return tn(l).patchQueueHook(e,t,n,r).then(function(e){return e(_,d)})},readQueueHook:function(e,t,n){return tn(l).readQueueHook(e,t,n).then(function(e){return e(_,d)})},searchQueueHook:function(e,t,n,r,i,a,s,o,u,c){return tn(l).searchQueueHook(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},updateQueueHook:function(e,t,n,r){return tn(l).updateQueueHook(e,t,n,r).then(function(e){return e(_,d)})}}},g.QueueHookServiceApi=rn,g.QueueResourcesServiceApiAxiosParamCreator=sn,g.QueueResourcesServiceApiFp=on,g.QueueResourcesServiceApiFactory=function(u,c,l){return{createQueueResourceGroup:function(e,t,n){return on(u).createQueueResourceGroup(e,t,n).then(function(e){return e(l,c)})},deleteQueueResourceGroup:function(e,t,n,r){return on(u).deleteQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})},readQueueResourceGroup:function(e,t,n,r){return on(u).readQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})},searchQueueResourceGroup:function(e,t,n,r,i,a,s,o){return on(u).searchQueueResourceGroup(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateQueueResourceGroup:function(e,t,n,r){return on(u).updateQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})}}},g.QueueResourcesServiceApi=cn,g.QueueServiceApiAxiosParamCreator=dn,g.QueueServiceApiFp=f,g.QueueServiceApiFactory=function(_,h,p){return{createQueue:function(e,t){return f(_).createQueue(e,t).then(function(e){return e(p,h)})},deleteQueue:function(e,t,n){return f(_).deleteQueue(e,t,n).then(function(e){return e(p,h)})},patchQueue:function(e,t,n){return f(_).patchQueue(e,t,n).then(function(e){return e(p,h)})},readQueue:function(e,t,n){return f(_).readQueue(e,t,n).then(function(e){return e(p,h)})},searchQueue:function(e,t,n,r,i,a,s,o){return f(_).searchQueue(e,t,n,r,i,a,s,o).then(function(e){return e(p,h)})},searchQueueReportGeneral:function(e,t,n,r,i,a,s,o,u,c,l,d){return f(_).searchQueueReportGeneral(e,t,n,r,i,a,s,o,u,c,l,d).then(function(e){return e(p,h)})},updateQueue:function(e,t,n){return f(_).updateQueue(e,t,n).then(function(e){return e(p,h)})}}},g.QueueServiceApi=hn,g.QueueSkillServiceApiAxiosParamCreator=fn,g.QueueSkillServiceApiFp=gn,g.QueueSkillServiceApiFactory=function(p,f,g){return{createQueueSkill:function(e,t,n){return gn(p).createQueueSkill(e,t,n).then(function(e){return e(g,f)})},deleteQueueSkill:function(e,t,n){return gn(p).deleteQueueSkill(e,t,n).then(function(e){return e(g,f)})},patchQueueSkill:function(e,t,n,r){return gn(p).patchQueueSkill(e,t,n,r).then(function(e){return e(g,f)})},readQueueSkill:function(e,t,n){return gn(p).readQueueSkill(e,t,n).then(function(e){return e(g,f)})},searchQueueSkill:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){return gn(p).searchQueueSkill(e,t,n,r,i,a,s,o,u,c,l,d,_,h).then(function(e){return e(g,f)})},updateQueueSkill:function(e,t,n,r){return gn(p).updateQueueSkill(e,t,n,r).then(function(e){return e(g,f)})}}},g.QueueSkillServiceApi=yn,g.RegionServiceApiAxiosParamCreator=wn,g.RegionServiceApiFp=mn,g.RegionServiceApiFactory=function(l,d,_){return{createRegion:function(e,t){return mn(l).createRegion(e,t).then(function(e){return e(_,d)})},deleteRegion:function(e,t){return mn(l).deleteRegion(e,t).then(function(e){return e(_,d)})},patchRegion:function(e,t,n){return mn(l).patchRegion(e,t,n).then(function(e){return e(_,d)})},readRegion:function(e,t){return mn(l).readRegion(e,t).then(function(e){return e(_,d)})},searchRegion:function(e,t,n,r,i,a,s,o,u,c){return mn(l).searchRegion(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},updateRegion:function(e,t,n){return mn(l).updateRegion(e,t,n).then(function(e){return e(_,d)})}}},g.RegionServiceApi=An,g.RoutingChatPlanServiceApiAxiosParamCreator=Rn,g.RoutingChatPlanServiceApiFp=Sn,g.RoutingChatPlanServiceApiFactory=function(c,l,d){return{createChatPlan:function(e,t){return Sn(c).createChatPlan(e,t).then(function(e){return e(d,l)})},deleteChatPlan:function(e,t){return Sn(c).deleteChatPlan(e,t).then(function(e){return e(d,l)})},patchChatPlan:function(e,t,n){return Sn(c).patchChatPlan(e,t,n).then(function(e){return e(d,l)})},readChatPlan:function(e,t){return Sn(c).readChatPlan(e,t).then(function(e){return e(d,l)})},searchChatPlan:function(e,t,n,r,i,a,s,o,u){return Sn(c).searchChatPlan(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateChatPlan:function(e,t,n){return Sn(c).updateChatPlan(e,t,n).then(function(e){return e(d,l)})}}},g.RoutingChatPlanServiceApi=Pn,g.RoutingOutboundCallServiceApiAxiosParamCreator=On,g.RoutingOutboundCallServiceApiFp=b,g.RoutingOutboundCallServiceApiFactory=function(d,_,h){return{createRoutingOutboundCall:function(e,t){return b(d).createRoutingOutboundCall(e,t).then(function(e){return e(h,_)})},deleteRoutingOutboundCall:function(e,t,n){return b(d).deleteRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},movePositionRoutingOutboundCall:function(e,t,n,r){return b(d).movePositionRoutingOutboundCall(e,t,n,r).then(function(e){return e(h,_)})},patchRoutingOutboundCall:function(e,t,n){return b(d).patchRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},readRoutingOutboundCall:function(e,t,n){return b(d).readRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},searchRoutingOutboundCall:function(e,t,n,r,i,a,s,o,u,c,l){return b(d).searchRoutingOutboundCall(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(h,_)})},updateRoutingOutboundCall:function(e,t,n){return b(d).updateRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})}}},g.RoutingOutboundCallServiceApi=kn,g.RoutingSchemaServiceApiAxiosParamCreator=En,g.RoutingSchemaServiceApiFp=Xn,g.RoutingSchemaServiceApiFactory=function(d,_,h){return{createRoutingSchema:function(e,t){return Xn(d).createRoutingSchema(e,t).then(function(e){return e(h,_)})},deleteRoutingSchema:function(e,t,n){return Xn(d).deleteRoutingSchema(e,t,n).then(function(e){return e(h,_)})},patchRoutingSchema:function(e,t,n){return Xn(d).patchRoutingSchema(e,t,n).then(function(e){return e(h,_)})},readRoutingSchema:function(e,t,n){return Xn(d).readRoutingSchema(e,t,n).then(function(e){return e(h,_)})},searchRoutingSchema:function(e,t,n,r,i,a,s,o,u,c,l){return Xn(d).searchRoutingSchema(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(h,_)})},searchRoutingSchemaTags:function(e,t,n,r,i,a,s){return Xn(d).searchRoutingSchemaTags(e,t,n,r,i,a,s).then(function(e){return e(h,_)})},updateRoutingSchema:function(e,t,n){return Xn(d).updateRoutingSchema(e,t,n).then(function(e){return e(h,_)})}}},g.RoutingSchemaServiceApi=jn,g.RoutingVariableServiceApiAxiosParamCreator=Qn,g.RoutingVariableServiceApiFp=Ln,g.RoutingVariableServiceApiFactory=function(i,a,s){return{createRoutingVariable:function(e,t){return Ln(i).createRoutingVariable(e,t).then(function(e){return e(s,a)})},deleteRoutingVariable:function(e,t,n){return Ln(i).deleteRoutingVariable(e,t,n).then(function(e){return e(s,a)})},readRoutingVariable:function(e,t,n){return Ln(i).readRoutingVariable(e,t,n).then(function(e){return e(s,a)})},searchRoutingVariable:function(e,t,n,r){return Ln(i).searchRoutingVariable(e,t,n,r).then(function(e){return e(s,a)})},updateRoutingVariable:function(e,t,n){return Ln(i).updateRoutingVariable(e,t,n).then(function(e){return e(s,a)})}}},g.RoutingVariableServiceApi=Gn,g.SkillServiceApiAxiosParamCreator=Dn,g.SkillServiceApiFp=w,g.SkillServiceApiFactory=function(c,l,d){return{createSkill:function(e,t){return w(c).createSkill(e,t).then(function(e){return e(d,l)})},createSkillAgent:function(e,t,n){return w(c).createSkillAgent(e,t,n).then(function(e){return e(d,l)})},deleteSkill:function(e,t,n){return w(c).deleteSkill(e,t,n).then(function(e){return e(d,l)})},deleteSkillAgent:function(e,t,n){return w(c).deleteSkillAgent(e,t,n).then(function(e){return e(d,l)})},patchSkillAgent:function(e,t,n){return w(c).patchSkillAgent(e,t,n).then(function(e){return e(d,l)})},readSkill:function(e,t,n){return w(c).readSkill(e,t,n).then(function(e){return e(d,l)})},searchSkill:function(e,t,n,r,i,a,s){return w(c).searchSkill(e,t,n,r,i,a,s).then(function(e){return e(d,l)})},searchSkillAgent:function(e,t,n,r,i,a,s,o,u){return w(c).searchSkillAgent(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateSkill:function(e,t,n){return w(c).updateSkill(e,t,n).then(function(e){return e(d,l)})}}},g.SkillServiceApi=Mn,g.TriggerServiceApiAxiosParamCreator=Jn,g.TriggerServiceApiFp=m,g.TriggerServiceApiFactory=function(p,f,g){return{createTrigger:function(e,t){return m(p).createTrigger(e,t).then(function(e){return e(g,f)})},createTriggerJob:function(e,t,n){return m(p).createTriggerJob(e,t,n).then(function(e){return e(g,f)})},deleteTrigger:function(e,t){return m(p).deleteTrigger(e,t).then(function(e){return e(g,f)})},patchTrigger:function(e,t,n){return m(p).patchTrigger(e,t,n).then(function(e){return e(g,f)})},readTrigger:function(e,t){return m(p).readTrigger(e,t).then(function(e){return e(g,f)})},searchTrigger:function(e,t,n,r,i,a,s,o){return m(p).searchTrigger(e,t,n,r,i,a,s,o).then(function(e){return e(g,f)})},searchTriggerJob:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){return m(p).searchTriggerJob(e,t,n,r,i,a,s,o,u,c,l,d,_,h).then(function(e){return e(g,f)})},updateTrigger:function(e,t,n){return m(p).updateTrigger(e,t,n).then(function(e){return e(g,f)})}}},g.TriggerServiceApi=zn,g.UserHelperServiceApiAxiosParamCreator=Yn,g.UserHelperServiceApiFp=Zn,g.UserHelperServiceApiFactory=function(n,r,i){return{defaultDeviceConfig:function(e,t){return Zn(n).defaultDeviceConfig(e,t).then(function(e){return e(i,r)})}}},g.UserHelperServiceApi=tr,g.VariablesApiAxiosParamCreator=rr,g.VariablesApiFp=ir,g.VariablesApiFactory=function(u,c,l){return{deleteVariable:function(e,t,n,r){return ir(u).deleteVariable(e,t,n,r).then(function(e){return e(l,c)})},deleteVariables:function(e,t,n,r){return ir(u).deleteVariables(e,t,n,r).then(function(e){return e(l,c)})},listVariables:function(e,t,n,r,i,a,s,o){return ir(u).listVariables(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},mergeVariables:function(e,t,n,r){return ir(u).mergeVariables(e,t,n,r).then(function(e){return e(l,c)})},resetVariables:function(e,t,n,r){return ir(u).resetVariables(e,t,n,r).then(function(e){return e(l,c)})},updateVariable:function(e,t,n,r,i){return ir(u).updateVariable(e,t,n,r,i).then(function(e){return e(l,c)})},updateVariable2:function(e,t,n,r,i){return ir(u).updateVariable2(e,t,n,r,i).then(function(e){return e(l,c)})}}},g.VariablesApi=sr,g.Configuration=ur,g.Client=K,g.Call=Er,g.Agent=kr,g.Conversation=xr,g.DeviceNotFoundError=gr,g.DeviceNotAllowPermissionError=br,g.RolePermissionError=qr,g.LicencePermissionError=Rr,g.PauseNotAllowedError=Tr,g.SipClient=Vr,g.ExternalClient=Yr,g.SipPhone=pr,g.Log=cr,Object.defineProperty(g,"__esModule",{value:!0})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("tslib"),require("url"),require("axios"),require("ee-ts"),require("jssip")):"function"==typeof define&&define.amd?define(["exports","tslib","url","axios","ee-ts","jssip"],t):t((e=e||self).WebitelSdk={},e.tslib,e.globalImportUrl,e.globalAxios,e.eeTs,e.JsSip)}(this,function(g,ae,se,Z,T,I){"use strict";Z=Z&&Z.hasOwnProperty("default")?Z.default:Z;function e(e,t,n){void 0===n&&(n=Z),this.basePath=t=void 0===t?ee:t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}var k,ee="https://dev.webitel.com/api".replace(/\/+$/,""),O=(k=Error,ae.__extends(W,k),W);function W(e,t){t=k.call(this,t)||this;return t.field=e,t.name="RequiredError",t}function E(f){var e=this;return{createAgentPauseCause:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createAgentPauseCause.");return(t=se.parse("/call_center/pause_causes",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteAgentPauseCause:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},patchAgentPauseCause:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchAgentPauseCause.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readAgentPauseCause:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentPauseCause:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/pause_causes",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},updateAgentPauseCause:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateAgentPauseCause.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function X(c){return{createAgentPauseCause:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,E(c).createAgentPauseCause(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgentPauseCause:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,E(c).deleteAgentPauseCause(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchAgentPauseCause:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,E(c).patchAgentPauseCause(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgentPauseCause:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,E(c).readAgentPauseCause(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentPauseCause:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,E(c).searchAgentPauseCause(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentPauseCause:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,E(c).updateAgentPauseCause(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}x=e,ae.__extends(U,x),U.prototype.createAgentPauseCause=function(e,t){var n=this;return X(this.configuration).createAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},U.prototype.deleteAgentPauseCause=function(e,t){var n=this;return X(this.configuration).deleteAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},U.prototype.patchAgentPauseCause=function(e,t,n){var r=this;return X(this.configuration).patchAgentPauseCause(e,t,n).then(function(e){return e(r.axios,r.basePath)})},U.prototype.readAgentPauseCause=function(e,t){var n=this;return X(this.configuration).readAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},U.prototype.searchAgentPauseCause=function(e,t,n,r,i,a,s){var o=this;return X(this.configuration).searchAgentPauseCause(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},U.prototype.updateAgentPauseCause=function(e,t,n){var r=this;return X(this.configuration).updateAgentPauseCause(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var x,j=U;function U(){return null!==x&&x.apply(this,arguments)||this}function A(P){var e=this;return{agentSetState:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("agentId","Required parameter agentId was null or undefined when calling agentSetState.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling agentSetState.");return(t="/call_center/agents/{agent_id}/states/waiting".replace("{agent_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},agentStateHistory:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling agentStateHistory.");return(t="/call_center/agents/{agent_id}/states/history".replace("{agent_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.time_from=d),void 0!==_&&(a.time_to=_),void 0!==h&&(a.q=h),void 0!==p&&(a.domain_id=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},agentTodayStatistics:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling agentTodayStatistics.");return(t="/call_center/agents/{agent_id}/statistics/today".replace("{agent_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return c&&(a.fields=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},createAgent:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createAgent.");return(t=se.parse("/call_center/agents",!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteAgent:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},patchAgent:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchAgent.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readAgent:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchAgent:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K){return void 0===K&&(K={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/agents",!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),K),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.allow_channels=p),f&&(a.supervisor_id=f),g&&(a.team_id=g),v&&(a.region_id=v),y&&(a.auditor_id=y),void 0!==b&&(a.is_supervisor=b),w&&(a.skill_id=w),m&&(a.queue_id=m),void 0!==q&&(a.not_supervisor=q),A&&(a.user_id=A),C&&(a.extension=C),R&&(a.not_team_id=R),S&&(a.not_skill_id=S),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),K.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),K.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentCallStatistics:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/agents/reports/call",!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),v),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a["time.from"]=l),void 0!==d&&(a["time.to"]=d),_&&(a.agent_id=_),void 0!==h&&(a.domain_id=h),void 0!==p&&(a.q=p),f&&(a.fields=f),void 0!==g&&(a.sort=g),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),v.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentInQueue:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling searchAgentInQueue.");return(t="/call_center/agents/{id}/queues".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentInQueueStatistics:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling searchAgentInQueueStatistics.");return(t="/call_center/agents/{agent_id}/statistics/queues".replace("{agent_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentInTeam:function(u,c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling searchAgentInTeam.");return(t="/call_center/agents/{id}/teams".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),h),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.domain_id=_),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentStateHistory:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/agents/states/history",!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),g),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a["joined_at.from"]=l),void 0!==d&&(a["joined_at.to"]=d),_&&(a.agent_id=_),void 0!==h&&(a.sort=h),void 0!==p&&(a.domain_id=p),void 0!==f&&(a.from_id=f),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),g.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentStatusStatistic:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S){return void 0===S&&(S={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/agents/reports/status",!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),S),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.agent_id=h),void 0!==p&&(a["time.from"]=p),void 0!==f&&(a["time.to"]=f),g&&(a.status=g),v&&(a.queue_id=v),y&&(a.team_id=y),void 0!==b&&(a["utilization.from"]=b),void 0!==w&&(a["utilization.to"]=w),void 0!==m&&(a.has_call=m),q&&(a.skill_id=q),A&&(a.region_id=A),C&&(a.supervisor_id=C),R&&(a.auditor_id=R),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),S.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),S.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentStatusStatisticItem:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling searchAgentStatusStatisticItem.");return(t="/call_center/agents/reports/status/{agent_id}".replace("{agent_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a["time.from"]=c),void 0!==l&&(a["time.to"]=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},searchLookupUsersAgentNotExists:function(u,c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/lookups/agents/users",!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),_),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.domain_id=d),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),[2,{url:se.format(t),options:r}]}})})},searchPauseCauseForAgent:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling searchPauseCauseForAgent.");return(t="/call_center/agents/{agent_id}/pause_causes".replace("{agent_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.allow_change=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},updateAgent:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateAgent.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},updateAgentStatus:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateAgentStatus.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateAgentStatus.");return(t="/call_center/agents/{id}/status".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),P&&(n=P.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function C(q){return{agentSetState:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).agentSetState(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentStateHistory:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).agentStateHistory(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentTodayStatistics:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).agentTodayStatistics(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createAgent:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).createAgent(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgent:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).deleteAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchAgent:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).patchAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgent:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).readAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgent:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchAgent(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentCallStatistics:function(t,r,i,a,s,o,u,c,l,d){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchAgentCallStatistics(t,r,i,a,s,o,u,c,l,d)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentInQueue:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchAgentInQueue(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentInQueueStatistics:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchAgentInQueueStatistics(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentInTeam:function(t,r,i,a,s,o){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchAgentInTeam(t,r,i,a,s,o)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentStateHistory:function(t,r,i,a,s,o,u,c,l){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchAgentStateHistory(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentStatusStatistic:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchAgentStatusStatistic(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentStatusStatisticItem:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchAgentStatusStatisticItem(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchLookupUsersAgentNotExists:function(t,r,i,a,s){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchLookupUsersAgentNotExists(t,r,i,a,s)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchPauseCauseForAgent:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).searchPauseCauseForAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgent:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).updateAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentStatus:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,A(q).updateAgentStatus(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Q=e,ae.__extends(t,Q),t.prototype.agentSetState=function(e,t,n){var r=this;return C(this.configuration).agentSetState(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.agentStateHistory=function(e,t,n,r,i,a,s,o){var u=this;return C(this.configuration).agentStateHistory(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},t.prototype.agentTodayStatistics=function(e,t,n){var r=this;return C(this.configuration).agentTodayStatistics(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.createAgent=function(e,t){var n=this;return C(this.configuration).createAgent(e,t).then(function(e){return e(n.axios,n.basePath)})},t.prototype.deleteAgent=function(e,t,n){var r=this;return C(this.configuration).deleteAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.patchAgent=function(e,t,n){var r=this;return C(this.configuration).patchAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.readAgent=function(e,t,n){var r=this;return C(this.configuration).readAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.searchAgent=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b){var w=this;return C(this.configuration).searchAgent(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b).then(function(e){return e(w.axios,w.basePath)})},t.prototype.searchAgentCallStatistics=function(e,t,n,r,i,a,s,o,u,c){var l=this;return C(this.configuration).searchAgentCallStatistics(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},t.prototype.searchAgentInQueue=function(e,t,n,r,i,a,s){var o=this;return C(this.configuration).searchAgentInQueue(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},t.prototype.searchAgentInQueueStatistics=function(e,t,n){var r=this;return C(this.configuration).searchAgentInQueueStatistics(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.searchAgentInTeam=function(e,t,n,r,i,a){var s=this;return C(this.configuration).searchAgentInTeam(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},t.prototype.searchAgentStateHistory=function(e,t,n,r,i,a,s,o,u){var c=this;return C(this.configuration).searchAgentStateHistory(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},t.prototype.searchAgentStatusStatistic=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y){var b=this;return C(this.configuration).searchAgentStatusStatistic(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y).then(function(e){return e(b.axios,b.basePath)})},t.prototype.searchAgentStatusStatisticItem=function(e,t,n,r){var i=this;return C(this.configuration).searchAgentStatusStatisticItem(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},t.prototype.searchLookupUsersAgentNotExists=function(e,t,n,r,i){var a=this;return C(this.configuration).searchLookupUsersAgentNotExists(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},t.prototype.searchPauseCauseForAgent=function(e,t,n){var r=this;return C(this.configuration).searchPauseCauseForAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.updateAgent=function(e,t,n){var r=this;return C(this.configuration).updateAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.updateAgentStatus=function(e,t,n){var r=this;return C(this.configuration).updateAgentStatus(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Q,M=t;function t(){return null!==Q&&Q.apply(this,arguments)||this}function L(v){var e=this;return{createAgentSkill:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("agentId","Required parameter agentId was null or undefined when calling createAgentSkill.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createAgentSkill.");return(t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},createAgentSkills:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("agentId","Required parameter agentId was null or undefined when calling createAgentSkills.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createAgentSkills.");return(t="/call_center/agents/{agent_id}/skills/bulk".replace("{agent_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteAgentSkill:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling deleteAgentSkill.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},deleteAgentSkills:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling deleteAgentSkills.");return(t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return c&&(a.id=c),l&&(a.skill_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},patchAgentSkill:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("agentId","Required parameter agentId was null or undefined when calling patchAgentSkill.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling patchAgentSkill.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling patchAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),_),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})},patchAgentSkills:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("agentId","Required parameter agentId was null or undefined when calling patchAgentSkills.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchAgentSkills.");return(t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readAgentSkill:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling readAgentSkill.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentSkill:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling searchAgentSkill.");return(t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),f&&(a.skill_id=f),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),g.headers),[2,{url:se.format(t),options:r}]}})})},searchLookupAgentNotExistsSkill:function(u,c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling searchLookupAgentNotExistsSkill.");return(t="/call_center/lookups/agents/skills/{agent_id}".replace("{agent_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),h),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.domain_id=_),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),[2,{url:se.format(t),options:r}]}})})},updateAgentSkill:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("agentId","Required parameter agentId was null or undefined when calling updateAgentSkill.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateAgentSkill.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function _(d){return{createAgentSkill:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,L(d).createAgentSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createAgentSkills:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,L(d).createAgentSkills(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgentSkill:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,L(d).deleteAgentSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgentSkills:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,L(d).deleteAgentSkills(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchAgentSkill:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,L(d).patchAgentSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchAgentSkills:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,L(d).patchAgentSkills(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgentSkill:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,L(d).readAgentSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentSkill:function(t,r,i,a,s,o,u,c,l){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,L(d).searchAgentSkill(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchLookupAgentNotExistsSkill:function(t,r,i,a,s,o){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,L(d).searchLookupAgentNotExistsSkill(t,r,i,a,s,o)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentSkill:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,L(d).updateAgentSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}F=e,ae.__extends(B,F),B.prototype.createAgentSkill=function(e,t,n){var r=this;return _(this.configuration).createAgentSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},B.prototype.createAgentSkills=function(e,t,n){var r=this;return _(this.configuration).createAgentSkills(e,t,n).then(function(e){return e(r.axios,r.basePath)})},B.prototype.deleteAgentSkill=function(e,t,n,r){var i=this;return _(this.configuration).deleteAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},B.prototype.deleteAgentSkills=function(e,t,n,r){var i=this;return _(this.configuration).deleteAgentSkills(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},B.prototype.patchAgentSkill=function(e,t,n,r){var i=this;return _(this.configuration).patchAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},B.prototype.patchAgentSkills=function(e,t,n){var r=this;return _(this.configuration).patchAgentSkills(e,t,n).then(function(e){return e(r.axios,r.basePath)})},B.prototype.readAgentSkill=function(e,t,n,r){var i=this;return _(this.configuration).readAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},B.prototype.searchAgentSkill=function(e,t,n,r,i,a,s,o,u){var c=this;return _(this.configuration).searchAgentSkill(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},B.prototype.searchLookupAgentNotExistsSkill=function(e,t,n,r,i,a){var s=this;return _(this.configuration).searchLookupAgentNotExistsSkill(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},B.prototype.updateAgentSkill=function(e,t,n,r){var i=this;return _(this.configuration).updateAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var F,G=B;function B(){return null!==F&&F.apply(this,arguments)||this}function D(v){var e=this;return{createAgentTeam:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createAgentTeam.");return(t=se.parse("/call_center/teams",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteAgentTeam:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteAgentTeam.");return(t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},readAgentTeam:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readAgentTeam.");return(t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchAgentTeam:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/teams",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.strategy=p),f&&(a.admin_id=f),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),g.headers),[2,{url:se.format(t),options:r}]}})})},updateAgentTeam:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateAgentTeam.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateAgentTeam.");return(t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function H(d){return{createAgentTeam:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,D(d).createAgentTeam(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgentTeam:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,D(d).deleteAgentTeam(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgentTeam:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,D(d).readAgentTeam(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentTeam:function(t,r,i,a,s,o,u,c,l){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,D(d).searchAgentTeam(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentTeam:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,D(d).updateAgentTeam(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}N=e,ae.__extends(V,N),V.prototype.createAgentTeam=function(e,t){var n=this;return H(this.configuration).createAgentTeam(e,t).then(function(e){return e(n.axios,n.basePath)})},V.prototype.deleteAgentTeam=function(e,t,n){var r=this;return H(this.configuration).deleteAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.readAgentTeam=function(e,t,n){var r=this;return H(this.configuration).readAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.searchAgentTeam=function(e,t,n,r,i,a,s,o,u){var c=this;return H(this.configuration).searchAgentTeam(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},V.prototype.updateAgentTeam=function(e,t,n){var r=this;return H(this.configuration).updateAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var N,J=V;function V(){return null!==N&&N.apply(this,arguments)||this}function z(m){var e=this;return{createAuditForm:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createAuditForm.");return(t=se.parse("/call_center/audit/forms",!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},createAuditFormRate:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createAuditFormRate.");return(t=se.parse("/call_center/audit/rate",!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteAuditForm:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteAuditForm.");return(t="/call_center/audit/forms/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},patchAuditForm:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchAuditForm.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchAuditForm.");return(t="/call_center/audit/forms/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readAuditForm:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readAuditForm.");return(t="/call_center/audit/forms/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},readAuditRate:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readAuditRate.");return(t="/call_center/audit/rate/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchAuditForm:function(u,c,l,d,_,h,p,f,g,v,y,b,w){return void 0===w&&(w={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/audit/forms",!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),w),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.team_id=p),void 0!==f&&(a.enabled=f),void 0!==g&&(a.archive=g),void 0!==v&&(a.editable=v),void 0!==y&&(a.active=y),void 0!==b&&(a.question=b),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),w.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),w.headers),[2,{url:se.format(t),options:r}]}})})},searchAuditRate:function(u,c,l,d,_,h,p,f,g,v,y,b){return void 0===b&&(b={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("formId","Required parameter formId was null or undefined when calling searchAuditRate.");return(t="/call_center/audit/forms/{form_id}/rate".replace("{form_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),b),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),void 0!==p&&(a["created_at.from"]=p),void 0!==f&&(a["created_at.to"]=f),g&&(a.id=g),v&&(a.call_id=v),y&&(a.rated_user=y),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),b.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),b.headers),[2,{url:se.format(t),options:r}]}})})},updateAuditForm:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateAuditForm.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateAuditForm.");return(t="/call_center/audit/forms/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function v(f){return{createAuditForm:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,z(f).createAuditForm(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createAuditFormRate:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,z(f).createAuditFormRate(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAuditForm:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,z(f).deleteAuditForm(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchAuditForm:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,z(f).patchAuditForm(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAuditForm:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,z(f).readAuditForm(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAuditRate:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,z(f).readAuditRate(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAuditForm:function(t,r,i,a,s,o,u,c,l,d,_,h,p){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,z(f).searchAuditForm(t,r,i,a,s,o,u,c,l,d,_,h,p)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAuditRate:function(t,r,i,a,s,o,u,c,l,d,_,h){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,z(f).searchAuditRate(t,r,i,a,s,o,u,c,l,d,_,h)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAuditForm:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,z(f).updateAuditForm(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}$=e,ae.__extends(re,$),re.prototype.createAuditForm=function(e,t){var n=this;return v(this.configuration).createAuditForm(e,t).then(function(e){return e(n.axios,n.basePath)})},re.prototype.createAuditFormRate=function(e,t){var n=this;return v(this.configuration).createAuditFormRate(e,t).then(function(e){return e(n.axios,n.basePath)})},re.prototype.deleteAuditForm=function(e,t){var n=this;return v(this.configuration).deleteAuditForm(e,t).then(function(e){return e(n.axios,n.basePath)})},re.prototype.patchAuditForm=function(e,t,n){var r=this;return v(this.configuration).patchAuditForm(e,t,n).then(function(e){return e(r.axios,r.basePath)})},re.prototype.readAuditForm=function(e,t){var n=this;return v(this.configuration).readAuditForm(e,t).then(function(e){return e(n.axios,n.basePath)})},re.prototype.readAuditRate=function(e,t){var n=this;return v(this.configuration).readAuditRate(e,t).then(function(e){return e(n.axios,n.basePath)})},re.prototype.searchAuditForm=function(e,t,n,r,i,a,s,o,u,c,l,d,_){var h=this;return v(this.configuration).searchAuditForm(e,t,n,r,i,a,s,o,u,c,l,d,_).then(function(e){return e(h.axios,h.basePath)})},re.prototype.searchAuditRate=function(e,t,n,r,i,a,s,o,u,c,l,d){var _=this;return v(this.configuration).searchAuditRate(e,t,n,r,i,a,s,o,u,c,l,d).then(function(e){return e(_.axios,_.basePath)})},re.prototype.updateAuditForm=function(e,t,n){var r=this;return v(this.configuration).updateAuditForm(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var $,Y=re;function re(){return null!==$&&$.apply(this,arguments)||this}function ie(f){var e=this;return{createBackendProfile:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createBackendProfile.");return(t=se.parse("/storage/backend_profiles",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteBackendProfile:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},patchBackendProfile:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchBackendProfile.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readBackendProfile:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchBackendProfile:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/storage/backend_profiles",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},updateBackendProfile:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateBackendProfile.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function oe(c){return{createBackendProfile:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ie(c).createBackendProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteBackendProfile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ie(c).deleteBackendProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchBackendProfile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ie(c).patchBackendProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readBackendProfile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ie(c).readBackendProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchBackendProfile:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ie(c).searchBackendProfile(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateBackendProfile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ie(c).updateBackendProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ue=e,ae.__extends(le,ue),le.prototype.createBackendProfile=function(e,t){var n=this;return oe(this.configuration).createBackendProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},le.prototype.deleteBackendProfile=function(e,t,n){var r=this;return oe(this.configuration).deleteBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},le.prototype.patchBackendProfile=function(e,t,n){var r=this;return oe(this.configuration).patchBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},le.prototype.readBackendProfile=function(e,t,n){var r=this;return oe(this.configuration).readBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},le.prototype.searchBackendProfile=function(e,t,n,r,i,a,s){var o=this;return oe(this.configuration).searchBackendProfile(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},le.prototype.updateBackendProfile=function(e,t,n){var r=this;return oe(this.configuration).updateBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var ue,ce=le;function le(){return null!==ue&&ue.apply(this,arguments)||this}function de(f){var e=this;return{createBucket:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createBucket.");return(t=se.parse("/call_center/buckets",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteBucket:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteBucket.");return(t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},readBucket:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readBucket.");return(t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchBucket:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/buckets",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},updateBucket:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateBucket.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateBucket.");return(t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function _e(c){return{createBucket:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,de(c).createBucket(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteBucket:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,de(c).deleteBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readBucket:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,de(c).readBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchBucket:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,de(c).searchBucket(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateBucket:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,de(c).updateBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}he=e,ae.__extends(fe,he),fe.prototype.createBucket=function(e,t){var n=this;return _e(this.configuration).createBucket(e,t).then(function(e){return e(n.axios,n.basePath)})},fe.prototype.deleteBucket=function(e,t,n){var r=this;return _e(this.configuration).deleteBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},fe.prototype.readBucket=function(e,t,n){var r=this;return _e(this.configuration).readBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},fe.prototype.searchBucket=function(e,t,n,r,i,a,s){var o=this;return _e(this.configuration).searchBucket(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},fe.prototype.updateBucket=function(e,t,n){var r=this;return _e(this.configuration).updateBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var he,pe=fe;function fe(){return null!==he&&he.apply(this,arguments)||this}function ge(f){var e=this;return{createCalendar:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createCalendar.");return(t=se.parse("/calendars",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteCalendar:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteCalendar.");return(t="/calendars/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},readCalendar:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readCalendar.");return(t="/calendars/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchCalendar:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/calendars",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},searchTimezones:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/calendars/timezones",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},updateCalendar:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateCalendar.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateCalendar.");return(t="/calendars/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function ve(c){return{createCalendar:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ge(c).createCalendar(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCalendar:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ge(c).deleteCalendar(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCalendar:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ge(c).readCalendar(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchCalendar:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ge(c).searchCalendar(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchTimezones:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ge(c).searchTimezones(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCalendar:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ge(c).updateCalendar(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ye=e,ae.__extends(we,ye),we.prototype.createCalendar=function(e,t){var n=this;return ve(this.configuration).createCalendar(e,t).then(function(e){return e(n.axios,n.basePath)})},we.prototype.deleteCalendar=function(e,t,n){var r=this;return ve(this.configuration).deleteCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})},we.prototype.readCalendar=function(e,t,n){var r=this;return ve(this.configuration).readCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})},we.prototype.searchCalendar=function(e,t,n,r,i,a,s){var o=this;return ve(this.configuration).searchCalendar(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},we.prototype.searchTimezones=function(e,t,n,r,i,a,s){var o=this;return ve(this.configuration).searchTimezones(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},we.prototype.updateCalendar=function(e,t,n){var r=this;return ve(this.configuration).updateCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var ye,be=we;function we(){return null!==ye&&ye.apply(this,arguments)||this}function te(ie){var e=this;return{aggregateHistoryCall:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling aggregateHistoryCall.");return(t=se.parse("/calls/history/aggregate",!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},blindTransferCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling blindTransferCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling blindTransferCall.");return(t="/calls/active/{id}/transfer".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},confirmPush:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling confirmPush.");return(t="/calls/active/{id}/confirm_push".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),c),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},createCall:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createCall.");return(t=se.parse("/calls",!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},createCallAnnotation:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("callId","Required parameter callId was null or undefined when calling createCallAnnotation.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createCallAnnotation.");return(t="/calls/history/{call_id}/annotation".replace("{call_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteCallAnnotation:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("callId","Required parameter callId was null or undefined when calling deleteCallAnnotation.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteCallAnnotation.");return(t="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},dtmfCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling dtmfCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling dtmfCall.");return(t="/calls/active/{id}/dtmf".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},eavesdropCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling eavesdropCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling eavesdropCall.");return(t="/calls/active/{id}/eavesdrop".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},hangupCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling hangupCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling hangupCall.");return(t="/calls/active/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},holdCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling holdCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling holdCall.");return(t="/calls/active/{id}/hold".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},patchHistoryCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchHistoryCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchHistoryCall.");return(t="/calls/history/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readCall:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readCall.");return(t="/calls/active/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchActiveCall:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I,k,W,E,X,x,j){return void 0===j&&(j={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/calls/active",!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),j),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),void 0!==h&&(a["created_at.from"]=h),void 0!==p&&(a["created_at.to"]=p),f&&(a.user_id=f),g&&(a.agent_id=g),v&&(a.queue_id=v),y&&(a.team_id=y),b&&(a.member_id=b),w&&(a.gateway_id=w),void 0!==m&&(a["duration.from"]=m),void 0!==q&&(a["duration.to"]=q),void 0!==A&&(a.skip_parent=A),void 0!==C&&(a.parent_id=C),R&&(a.cause=R),void 0!==S&&(a.exists_file=S),void 0!==K&&(a.domain_id=K),void 0!==P&&(a.number=P),T&&(a.direction=T),void 0!==O&&(a["answered_at.from"]=O),void 0!==I&&(a["answered_at.to"]=I),void 0!==k&&(a.missed=k),void 0!==W&&(a["stored_at.from"]=W),void 0!==E&&(a["stored_at.to"]=E),X&&(a.supervisor_id=X),x&&(a.state=x),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),j.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),j.headers),[2,{url:se.format(t),options:r}]}})})},searchHistoryCall:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I,k,W,E,X,x,j,U,Q,M,L,F,B,D,H,N,J,V,z,$,Y,Z,ee,te,ne,re,G){return void 0===G&&(G={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/calls/history",!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),G),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),void 0!==h&&(a["created_at.from"]=h),void 0!==p&&(a["created_at.to"]=p),f&&(a.user_id=f),g&&(a.agent_id=g),v&&(a.queue_id=v),y&&(a.team_id=y),b&&(a.member_id=b),w&&(a.gateway_id=w),void 0!==m&&(a["duration.from"]=m),void 0!==q&&(a["duration.to"]=q),void 0!==A&&(a.skip_parent=A),void 0!==C&&(a.parent_id=C),R&&(a.cause=R),void 0!==S&&(a.has_file=S),void 0!==K&&(a.domain_id=K),void 0!==P&&(a.number=P),void 0!==T&&(a.direction=T),void 0!==O&&(a["answered_at.from"]=O),void 0!==I&&(a["answered_at.to"]=I),void 0!==k&&(a.missed=k),void 0!==W&&(a["stored_at.from"]=W),void 0!==E&&(a["stored_at.to"]=E),X&&(a.id=X),x&&(a.transfer_from=x),j&&(a.transfer_to=j),void 0!==U&&(a.dependency_id=U),Q&&(a.tags=Q),M&&(a.amd_result=M),void 0!==L&&(a.fts=L),F&&(a.directions=F),void 0!==B&&(a.has_transcript=B),void 0!==D&&(a.agent_description=D),H&&(a.owner_id=H),N&&(a.grantee_id=N),J&&(a.amd_ai_result=J),void 0!==V&&(a["talk.from"]=V),void 0!==z&&(a["talk.to"]=z),void 0!==$&&(a.rated=$),Y&&(a.rated_by=Y),void 0!==Z&&(a["score_required.from"]=Z),void 0!==ee&&(a["score_required.to"]=ee),void 0!==te&&(a["score_optional.from"]=te),void 0!==ne&&(a["score_optional.to"]=ne),re&&(a.rated_user=re),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),G.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),G.headers),[2,{url:se.format(t),options:r}]}})})},searchHistoryCallPost:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling searchHistoryCallPost.");return(t=se.parse("/calls/history",!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},setVariablesCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling setVariablesCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling setVariablesCall.");return(t="/calls/active/{id}/variables".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},unHoldCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling unHoldCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling unHoldCall.");return(t="/calls/active/{id}/unhold".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},updateCallAnnotation:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("callId","Required parameter callId was null or undefined when calling updateCallAnnotation.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateCallAnnotation.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateCallAnnotation.");return(t="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),ie&&(n=ie.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},ie&&ie.apiKey)?"function"!=typeof ie.apiKey?[3,2]:[4,ie.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,ie.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function ne(Y){return{aggregateHistoryCall:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).aggregateHistoryCall(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},blindTransferCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).blindTransferCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},confirmPush:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).confirmPush(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createCall:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).createCall(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createCallAnnotation:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).createCallAnnotation(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCallAnnotation:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).deleteCallAnnotation(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},dtmfCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).dtmfCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},eavesdropCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).eavesdropCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},hangupCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).hangupCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},holdCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).holdCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchHistoryCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).patchHistoryCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).readCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchActiveCall:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).searchActiveCall(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchHistoryCall:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I,k,W,E,X,x,j,U,Q,M,L,F,G,B,D,H,N,J,V,z,$){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).searchHistoryCall(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I,k,W,E,X,x,j,U,Q,M,L,F,G,B,D,H,N,J,V,z,$)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchHistoryCallPost:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).searchHistoryCallPost(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},setVariablesCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).setVariablesCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},unHoldCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).unHoldCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCallAnnotation:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,te(Y).updateCallAnnotation(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}me=e,ae.__extends(n,me),n.prototype.aggregateHistoryCall=function(e,t){var n=this;return ne(this.configuration).aggregateHistoryCall(e,t).then(function(e){return e(n.axios,n.basePath)})},n.prototype.blindTransferCall=function(e,t,n){var r=this;return ne(this.configuration).blindTransferCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.confirmPush=function(e,t){var n=this;return ne(this.configuration).confirmPush(e,t).then(function(e){return e(n.axios,n.basePath)})},n.prototype.createCall=function(e,t){var n=this;return ne(this.configuration).createCall(e,t).then(function(e){return e(n.axios,n.basePath)})},n.prototype.createCallAnnotation=function(e,t,n){var r=this;return ne(this.configuration).createCallAnnotation(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.deleteCallAnnotation=function(e,t,n){var r=this;return ne(this.configuration).deleteCallAnnotation(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.dtmfCall=function(e,t,n){var r=this;return ne(this.configuration).dtmfCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.eavesdropCall=function(e,t,n){var r=this;return ne(this.configuration).eavesdropCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.hangupCall=function(e,t,n){var r=this;return ne(this.configuration).hangupCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.holdCall=function(e,t,n){var r=this;return ne(this.configuration).holdCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.patchHistoryCall=function(e,t,n){var r=this;return ne(this.configuration).patchHistoryCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.readCall=function(e,t,n){var r=this;return ne(this.configuration).readCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.searchActiveCall=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T){var O=this;return ne(this.configuration).searchActiveCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T).then(function(e){return e(O.axios,O.basePath)})},n.prototype.searchHistoryCall=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I,k,W,E,x,j,U,Q,M,L,F,G,B,D,H,N,J,V,z){var X=this;return ne(this.configuration).searchHistoryCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I,k,W,E,x,j,U,Q,M,L,F,G,B,D,H,N,J,V,z).then(function(e){return e(X.axios,X.basePath)})},n.prototype.searchHistoryCallPost=function(e,t){var n=this;return ne(this.configuration).searchHistoryCallPost(e,t).then(function(e){return e(n.axios,n.basePath)})},n.prototype.setVariablesCall=function(e,t,n){var r=this;return ne(this.configuration).setVariablesCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.unHoldCall=function(e,t,n){var r=this;return ne(this.configuration).unHoldCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.updateCallAnnotation=function(e,t,n,r){var i=this;return ne(this.configuration).updateCallAnnotation(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var me,qe=n;function n(){return null!==me&&me.apply(this,arguments)||this}function Ae(_){var e=this;return{broadcast:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("profileId","Required parameter profileId was null or undefined when calling broadcast.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling broadcast.");return(t="/chat/bots/{profile_id}/broadcast".replace("{profile_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),_&&(n=_.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function Ce(a){return{broadcast:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ae(a).broadcast(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Re=e,ae.__extends(Ke,Re),Ke.prototype.broadcast=function(e,t,n){var r=this;return Ce(this.configuration).broadcast(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Re,Se=Ke;function Ke(){return null!==Re&&Re.apply(this,arguments)||this}function Pe(v){var e=this;return{createCognitiveProfile:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createCognitiveProfile.");return(t=se.parse("/storage/cognitive_profiles",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteCognitiveProfile:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},patchCognitiveProfile:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchCognitiveProfile.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readCognitiveProfile:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchCognitiveProfile:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/storage/cognitive_profiles",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.service=p),void 0!==f&&(a.enabled=f),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),g.headers),[2,{url:se.format(t),options:r}]}})})},updateCognitiveProfile:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateCognitiveProfile.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function Te(d){return{createCognitiveProfile:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Pe(d).createCognitiveProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCognitiveProfile:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Pe(d).deleteCognitiveProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchCognitiveProfile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Pe(d).patchCognitiveProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCognitiveProfile:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Pe(d).readCognitiveProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchCognitiveProfile:function(t,r,i,a,s,o,u,c,l){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Pe(d).searchCognitiveProfile(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCognitiveProfile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Pe(d).updateCognitiveProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Oe=e,ae.__extends(ke,Oe),ke.prototype.createCognitiveProfile=function(e,t){var n=this;return Te(this.configuration).createCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ke.prototype.deleteCognitiveProfile=function(e,t){var n=this;return Te(this.configuration).deleteCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ke.prototype.patchCognitiveProfile=function(e,t,n){var r=this;return Te(this.configuration).patchCognitiveProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ke.prototype.readCognitiveProfile=function(e,t){var n=this;return Te(this.configuration).readCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ke.prototype.searchCognitiveProfile=function(e,t,n,r,i,a,s,o,u){var c=this;return Te(this.configuration).searchCognitiveProfile(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},ke.prototype.updateCognitiveProfile=function(e,t,n){var r=this;return Te(this.configuration).updateCognitiveProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Oe,Ie=ke;function ke(){return null!==Oe&&Oe.apply(this,arguments)||this}function We(g){var e=this;return{createCommunicationType:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createCommunicationType.");return(t=se.parse("/call_center/communication_type",!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteCommunicationType:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteCommunicationType.");return(t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},readCommunicationType:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readCommunicationType.");return(t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchCommunicationType:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/communication_type",!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.channel=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},updateCommunicationType:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateCommunicationType.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateCommunicationType.");return(t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function Ee(l){return{createCommunicationType:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,We(l).createCommunicationType(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCommunicationType:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,We(l).deleteCommunicationType(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCommunicationType:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,We(l).readCommunicationType(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchCommunicationType:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,We(l).searchCommunicationType(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCommunicationType:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,We(l).updateCommunicationType(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Xe=e,ae.__extends(je,Xe),je.prototype.createCommunicationType=function(e,t){var n=this;return Ee(this.configuration).createCommunicationType(e,t).then(function(e){return e(n.axios,n.basePath)})},je.prototype.deleteCommunicationType=function(e,t,n){var r=this;return Ee(this.configuration).deleteCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})},je.prototype.readCommunicationType=function(e,t,n){var r=this;return Ee(this.configuration).readCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})},je.prototype.searchCommunicationType=function(e,t,n,r,i,a,s,o){var u=this;return Ee(this.configuration).searchCommunicationType(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},je.prototype.updateCommunicationType=function(e,t,n){var r=this;return Ee(this.configuration).updateCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Xe,xe=je;function je(){return null!==Xe&&Xe.apply(this,arguments)||this}function Ue(p){var e=this;return{createConfig:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createConfig.");return(t=se.parse("/logger/config",!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteConfig:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("configId","Required parameter configId was null or undefined when calling deleteConfig.");return(t="/logger/config/{config_id}".replace("{config_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},deleteConfigBulk:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling deleteConfigBulk.");return(t=se.parse("/logger/config",!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},patchConfig:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("configId","Required parameter configId was null or undefined when calling patchConfig.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchConfig.");return(t="/logger/config/{config_id}".replace("{config_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readConfig:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("configId","Required parameter configId was null or undefined when calling readConfig.");return(t="/logger/config/{config_id}".replace("{config_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},readSystemObjects:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/logger/available_objects",!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.include_existing=u),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchConfig:function(u,c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/logger/config",!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),h),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),[2,{url:se.format(t),options:r}]}})})},updateConfig:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("configId","Required parameter configId was null or undefined when calling updateConfig.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateConfig.");return(t="/logger/config/{config_id}".replace("{config_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function c(u){return{createConfig:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(u).createConfig(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteConfig:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(u).deleteConfig(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteConfigBulk:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(u).deleteConfigBulk(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchConfig:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(u).patchConfig(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readConfig:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(u).readConfig(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readSystemObjects:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(u).readSystemObjects(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchConfig:function(t,r,i,a,s,o){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(u).searchConfig(t,r,i,a,s,o)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateConfig:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(u).updateConfig(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Qe=e,ae.__extends(Le,Qe),Le.prototype.createConfig=function(e,t){var n=this;return c(this.configuration).createConfig(e,t).then(function(e){return e(n.axios,n.basePath)})},Le.prototype.deleteConfig=function(e,t){var n=this;return c(this.configuration).deleteConfig(e,t).then(function(e){return e(n.axios,n.basePath)})},Le.prototype.deleteConfigBulk=function(e,t){var n=this;return c(this.configuration).deleteConfigBulk(e,t).then(function(e){return e(n.axios,n.basePath)})},Le.prototype.patchConfig=function(e,t,n){var r=this;return c(this.configuration).patchConfig(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Le.prototype.readConfig=function(e,t){var n=this;return c(this.configuration).readConfig(e,t).then(function(e){return e(n.axios,n.basePath)})},Le.prototype.readSystemObjects=function(e,t){var n=this;return c(this.configuration).readSystemObjects(e,t).then(function(e){return e(n.axios,n.basePath)})},Le.prototype.searchConfig=function(e,t,n,r,i,a){var s=this;return c(this.configuration).searchConfig(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},Le.prototype.updateConfig=function(e,t,n){var r=this;return c(this.configuration).updateConfig(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Qe,Me=Le;function Le(){return null!==Qe&&Qe.apply(this,arguments)||this}function Fe(v){var e=this;return{createContact:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("input","Required parameter input was null or undefined when calling createContact.");return(t=se.parse("/contacts",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return l&&(a.fields=l),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteContact:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("etag","Required parameter etag was null or undefined when calling deleteContact.");return(t="/contacts/{etag}".replace("{etag}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return c&&(a.fields=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},locateContact:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling locateContact.");return(t="/contacts/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return c&&(a.fields=c),void 0!==l&&(a.mode=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},searchContacts:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/contacts",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.qin=p),void 0!==f&&(a.mode=f),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),g.headers),[2,{url:se.format(t),options:r}]}})})},updateContact:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("etag","Required parameter etag was null or undefined when calling updateContact.");if(null==l)throw new O("input","Required parameter input was null or undefined when calling updateContact.");return(t="/contacts/{etag}".replace("{etag}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),_),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return d&&(a.fields=d),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function Ge(d){return{createContact:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Fe(d).createContact(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteContact:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Fe(d).deleteContact(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},locateContact:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Fe(d).locateContact(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchContacts:function(t,r,i,a,s,o,u,c,l){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Fe(d).searchContacts(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateContact:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Fe(d).updateContact(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Be=e,ae.__extends(He,Be),He.prototype.createContact=function(e,t,n){var r=this;return Ge(this.configuration).createContact(e,t,n).then(function(e){return e(r.axios,r.basePath)})},He.prototype.deleteContact=function(e,t,n){var r=this;return Ge(this.configuration).deleteContact(e,t,n).then(function(e){return e(r.axios,r.basePath)})},He.prototype.locateContact=function(e,t,n,r){var i=this;return Ge(this.configuration).locateContact(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},He.prototype.searchContacts=function(e,t,n,r,i,a,s,o,u){var c=this;return Ge(this.configuration).searchContacts(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},He.prototype.updateContact=function(e,t,n,r){var i=this;return Ge(this.configuration).updateContact(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var Be,De=He;function He(){return null!==Be&&Be.apply(this,arguments)||this}function Ne(p){var e=this;return{createEmailProfile:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createEmailProfile.");return(t=se.parse("/email/profile",!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteEmailProfile:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},loginEmailProfile:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling loginEmailProfile.");return(t="/email/profile/{id}/login".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},patchEmailProfile:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchEmailProfile.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readEmailProfile:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchEmailProfile:function(u,c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/email/profile",!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),h),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),[2,{url:se.format(t),options:r}]}})})},testEmailProfile:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling testEmailProfile.");return(t="/email/profile/{id}/test".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},updateEmailProfile:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateEmailProfile.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),p&&(n=p.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function l(u){return{createEmailProfile:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(u).createEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteEmailProfile:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(u).deleteEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},loginEmailProfile:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(u).loginEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchEmailProfile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(u).patchEmailProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readEmailProfile:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(u).readEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchEmailProfile:function(t,r,i,a,s,o){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(u).searchEmailProfile(t,r,i,a,s,o)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},testEmailProfile:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(u).testEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateEmailProfile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(u).updateEmailProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Je=e,ae.__extends(ze,Je),ze.prototype.createEmailProfile=function(e,t){var n=this;return l(this.configuration).createEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ze.prototype.deleteEmailProfile=function(e,t){var n=this;return l(this.configuration).deleteEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ze.prototype.loginEmailProfile=function(e,t){var n=this;return l(this.configuration).loginEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ze.prototype.patchEmailProfile=function(e,t,n){var r=this;return l(this.configuration).patchEmailProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ze.prototype.readEmailProfile=function(e,t){var n=this;return l(this.configuration).readEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ze.prototype.searchEmailProfile=function(e,t,n,r,i,a){var s=this;return l(this.configuration).searchEmailProfile(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},ze.prototype.testEmailProfile=function(e,t){var n=this;return l(this.configuration).testEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ze.prototype.updateEmailProfile=function(e,t,n){var r=this;return l(this.configuration).updateEmailProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Je,Ve=ze;function ze(){return null!==Je&&Je.apply(this,arguments)||this}function $e(m){var e=this;return{deleteEmail:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling deleteEmail.");if(null==c)throw new O("etag","Required parameter etag was null or undefined when calling deleteEmail.");return(t="/contacts/{contact_id}/emails/{etag}".replace("{contact_id}",encodeURIComponent(String(u))).replace("{etag}",encodeURIComponent(String(c))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return l&&(a.fields=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},deleteEmails:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling deleteEmails.");if(null==c)throw new O("etag","Required parameter etag was null or undefined when calling deleteEmails.");return(t="/contacts/{contact_id}/emails".replace("{contact_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return l&&(a.fields=l),c&&(a.etag=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},listEmails:function(u,c,l,d,_,h,p,f,g,v,y,b,w){return void 0===w&&(w={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling listEmails.");return(t="/contacts/{contact_id}/emails".replace("{contact_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),w),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),void 0!==f&&(a.primary=f),void 0!==g&&(a.verified=g),void 0!==v&&(a["type.id"]=v),void 0!==y&&(a["type.type"]=y),void 0!==b&&(a["type.name"]=b),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),w.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),w.headers),[2,{url:se.format(t),options:r}]}})})},locateEmail:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling locateEmail.");if(null==c)throw new O("etag","Required parameter etag was null or undefined when calling locateEmail.");return(t="/contacts/{contact_id}/emails/{etag}".replace("{contact_id}",encodeURIComponent(String(u))).replace("{etag}",encodeURIComponent(String(c))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return l&&(a.fields=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},mergeEmails:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling mergeEmails.");if(null==l)throw new O("input","Required parameter input was null or undefined when calling mergeEmails.");return(t="/contacts/{contact_id}/emails".replace("{contact_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),_),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return d&&(a.fields=d),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},resetEmails:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling resetEmails.");if(null==l)throw new O("input","Required parameter input was null or undefined when calling resetEmails.");return(t="/contacts/{contact_id}/emails".replace("{contact_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return d&&(a.fields=d),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},updateEmail:function(c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling updateEmail.");if(null==l)throw new O("etag","Required parameter etag was null or undefined when calling updateEmail.");if(null==d)throw new O("input","Required parameter input was null or undefined when calling updateEmail.");return(t="/contacts/{contact_id}/emails/{etag}".replace("{contact_id}",encodeURIComponent(String(c))).replace("{etag}",encodeURIComponent(String(l))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),h),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return _&&(a.fields=_),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})},updateEmail2:function(c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling updateEmail2.");if(null==l)throw new O("etag","Required parameter etag was null or undefined when calling updateEmail2.");if(null==d)throw new O("input","Required parameter input was null or undefined when calling updateEmail2.");return(t="/contacts/{contact_id}/emails/{etag}".replace("{contact_id}",encodeURIComponent(String(c))).replace("{etag}",encodeURIComponent(String(l))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),h),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return _&&(a.fields=_),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function y(f){return{deleteEmail:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,$e(f).deleteEmail(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteEmails:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,$e(f).deleteEmails(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},listEmails:function(t,r,i,a,s,o,u,c,l,d,_,h,p){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,$e(f).listEmails(t,r,i,a,s,o,u,c,l,d,_,h,p)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},locateEmail:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,$e(f).locateEmail(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},mergeEmails:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,$e(f).mergeEmails(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},resetEmails:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,$e(f).resetEmails(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateEmail:function(t,r,i,a,s){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,$e(f).updateEmail(t,r,i,a,s)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateEmail2:function(t,r,i,a,s){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,$e(f).updateEmail2(t,r,i,a,s)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Ye=e,ae.__extends(et,Ye),et.prototype.deleteEmail=function(e,t,n,r){var i=this;return y(this.configuration).deleteEmail(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},et.prototype.deleteEmails=function(e,t,n,r){var i=this;return y(this.configuration).deleteEmails(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},et.prototype.listEmails=function(e,t,n,r,i,a,s,o,u,c,l,d,_){var h=this;return y(this.configuration).listEmails(e,t,n,r,i,a,s,o,u,c,l,d,_).then(function(e){return e(h.axios,h.basePath)})},et.prototype.locateEmail=function(e,t,n,r){var i=this;return y(this.configuration).locateEmail(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},et.prototype.mergeEmails=function(e,t,n,r){var i=this;return y(this.configuration).mergeEmails(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},et.prototype.resetEmails=function(e,t,n,r){var i=this;return y(this.configuration).resetEmails(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},et.prototype.updateEmail=function(e,t,n,r,i){var a=this;return y(this.configuration).updateEmail(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},et.prototype.updateEmail2=function(e,t,n,r,i){var a=this;return y(this.configuration).updateEmail2(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})};var Ye,Ze=et;function et(){return null!==Ye&&Ye.apply(this,arguments)||this}function tt(d){var e=this;return{deleteFiles:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling deleteFiles.");return(t=se.parse("/storage/file",!0),d&&(n=d.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},d&&d.apiKey)?"function"!=typeof d.apiKey?[3,2]:[4,d.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,d.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})}}}function nt(i){return{deleteFiles:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,tt(i).deleteFiles(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}rt=e,ae.__extends(at,rt),at.prototype.deleteFiles=function(e,t){var n=this;return nt(this.configuration).deleteFiles(e,t).then(function(e){return e(n.axios,n.basePath)})};var rt,it=at;function at(){return null!==rt&&rt.apply(this,arguments)||this}function st(_){var e=this;return{createFileTranscript:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createFileTranscript.");return(t=se.parse("/storage/transcript_file",!0),_&&(n=_.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteFileTranscript:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling deleteFileTranscript.");return(t=se.parse("/storage/transcript_file",!0),_&&(n=_.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},getFileTranscriptPhrases:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling getFileTranscriptPhrases.");return(t="/storage/transcript_file/{id}/phrases".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),_&&(n=_.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})}}}function ot(s){return{createFileTranscript:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,st(s).createFileTranscript(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteFileTranscript:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,st(s).deleteFileTranscript(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},getFileTranscriptPhrases:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,st(s).getFileTranscriptPhrases(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ut=e,ae.__extends(lt,ut),lt.prototype.createFileTranscript=function(e,t){var n=this;return ot(this.configuration).createFileTranscript(e,t).then(function(e){return e(n.axios,n.basePath)})},lt.prototype.deleteFileTranscript=function(e,t){var n=this;return ot(this.configuration).deleteFileTranscript(e,t).then(function(e){return e(n.axios,n.basePath)})},lt.prototype.getFileTranscriptPhrases=function(e,t,n,r){var i=this;return ot(this.configuration).getFileTranscriptPhrases(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var ut,ct=lt;function lt(){return null!==ut&&ut.apply(this,arguments)||this}function dt(f){var e=this;return{createImportTemplate:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createImportTemplate.");return(t=se.parse("/storage/import_templates",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteImportTemplate:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},patchImportTemplate:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchImportTemplate.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readImportTemplate:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchImportTemplate:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/storage/import_templates",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},updateImportTemplate:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateImportTemplate.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function _t(c){return{createImportTemplate:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,dt(c).createImportTemplate(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteImportTemplate:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,dt(c).deleteImportTemplate(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchImportTemplate:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,dt(c).patchImportTemplate(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readImportTemplate:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,dt(c).readImportTemplate(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchImportTemplate:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,dt(c).searchImportTemplate(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateImportTemplate:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,dt(c).updateImportTemplate(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ht=e,ae.__extends(ft,ht),ft.prototype.createImportTemplate=function(e,t){var n=this;return _t(this.configuration).createImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},ft.prototype.deleteImportTemplate=function(e,t){var n=this;return _t(this.configuration).deleteImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},ft.prototype.patchImportTemplate=function(e,t,n){var r=this;return _t(this.configuration).patchImportTemplate(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ft.prototype.readImportTemplate=function(e,t){var n=this;return _t(this.configuration).readImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},ft.prototype.searchImportTemplate=function(e,t,n,r,i,a,s){var o=this;return _t(this.configuration).searchImportTemplate(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},ft.prototype.updateImportTemplate=function(e,t,n){var r=this;return _t(this.configuration).updateImportTemplate(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var ht,pt=ft;function ft(){return null!==ht&&ht.apply(this,arguments)||this}function gt(g){var e=this;return{deleteLabels:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling deleteLabels.");if(null==c)throw new O("etag","Required parameter etag was null or undefined when calling deleteLabels.");return(t="/contacts/{contact_id}/labels".replace("{contact_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return l&&(a.fields=l),c&&(a.etag=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},getLabels:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/contacts/labels",!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},listLabels:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling listLabels.");return(t="/contacts/{contact_id}/labels".replace("{contact_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},mergeLabels:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling mergeLabels.");if(null==l)throw new O("input","Required parameter input was null or undefined when calling mergeLabels.");return(t="/contacts/{contact_id}/labels".replace("{contact_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return d&&(a.fields=d),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},resetLabels:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling resetLabels.");if(null==l)throw new O("input","Required parameter input was null or undefined when calling resetLabels.");return(t="/contacts/{contact_id}/labels".replace("{contact_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return d&&(a.fields=d),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function vt(l){return{deleteLabels:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,gt(l).deleteLabels(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},getLabels:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,gt(l).getLabels(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},listLabels:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,gt(l).listLabels(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},mergeLabels:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,gt(l).mergeLabels(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},resetLabels:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,gt(l).resetLabels(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}yt=e,ae.__extends(wt,yt),wt.prototype.deleteLabels=function(e,t,n,r){var i=this;return vt(this.configuration).deleteLabels(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},wt.prototype.getLabels=function(e,t,n,r){var i=this;return vt(this.configuration).getLabels(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},wt.prototype.listLabels=function(e,t,n,r,i,a,s,o){var u=this;return vt(this.configuration).listLabels(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},wt.prototype.mergeLabels=function(e,t,n,r){var i=this;return vt(this.configuration).mergeLabels(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},wt.prototype.resetLabels=function(e,t,n,r){var i=this;return vt(this.configuration).resetLabels(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var yt,bt=wt;function wt(){return null!==yt&&yt.apply(this,arguments)||this}function mt(y){var e=this;return{createList:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createList.");return(t=se.parse("/call_center/list",!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},createListCommunication:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("listId","Required parameter listId was null or undefined when calling createListCommunication.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createListCommunication.");return(t="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteList:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteList.");return(t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},deleteListCommunication:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("listId","Required parameter listId was null or undefined when calling deleteListCommunication.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteListCommunication.");return(t="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},readList:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readList.");return(t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},readListCommunication:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("listId","Required parameter listId was null or undefined when calling readListCommunication.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readListCommunication.");return(t="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},searchList:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/list",!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},searchListCommunication:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("listId","Required parameter listId was null or undefined when calling searchListCommunication.");return(t="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),v),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),void 0!==f&&(a["expire_at.from"]=f),void 0!==g&&(a["expire_at.to"]=g),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),v.headers),[2,{url:se.format(t),options:r}]}})})},updateList:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateList.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateList.");return(t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},updateListCommunication:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("listId","Required parameter listId was null or undefined when calling updateListCommunication.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateListCommunication.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateListCommunication.");return(t="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function h(_){return{createList:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).createList(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createListCommunication:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).createListCommunication(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteList:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).deleteList(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteListCommunication:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).deleteListCommunication(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readList:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).readList(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readListCommunication:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).readListCommunication(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchList:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).searchList(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchListCommunication:function(t,r,i,a,s,o,u,c,l,d){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).searchListCommunication(t,r,i,a,s,o,u,c,l,d)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateList:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).updateList(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateListCommunication:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,mt(_).updateListCommunication(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}qt=e,ae.__extends(Ct,qt),Ct.prototype.createList=function(e,t){var n=this;return h(this.configuration).createList(e,t).then(function(e){return e(n.axios,n.basePath)})},Ct.prototype.createListCommunication=function(e,t,n){var r=this;return h(this.configuration).createListCommunication(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ct.prototype.deleteList=function(e,t,n){var r=this;return h(this.configuration).deleteList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ct.prototype.deleteListCommunication=function(e,t,n,r){var i=this;return h(this.configuration).deleteListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Ct.prototype.readList=function(e,t,n){var r=this;return h(this.configuration).readList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ct.prototype.readListCommunication=function(e,t,n,r){var i=this;return h(this.configuration).readListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Ct.prototype.searchList=function(e,t,n,r,i,a,s){var o=this;return h(this.configuration).searchList(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Ct.prototype.searchListCommunication=function(e,t,n,r,i,a,s,o,u,c){var l=this;return h(this.configuration).searchListCommunication(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},Ct.prototype.updateList=function(e,t,n){var r=this;return h(this.configuration).updateList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ct.prototype.updateListCommunication=function(e,t,n,r){var i=this;return h(this.configuration).updateListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var qt,At=Ct;function Ct(){return null!==qt&&qt.apply(this,arguments)||this}function Rt(m){var e=this;return{searchLogByConfigId:function(u,c,l,d,_,h,p,f,g,v,y,b,w){return void 0===w&&(w={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("configId","Required parameter configId was null or undefined when calling searchLogByConfigId.");return(t="/logger/config/{config_id}/logs".replace("{config_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),w),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),void 0!==p&&(a["user.id"]=p),void 0!==f&&(a["user.name"]=f),void 0!==g&&(a.action=g),void 0!==v&&(a.user_ip=v),void 0!==y&&(a.date_from=y),void 0!==b&&(a.date_to=b),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),w.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),w.headers),[2,{url:se.format(t),options:r}]}})})},searchLogByUserId:function(u,c,l,d,_,h,p,f,g,v,y,b,w){return void 0===w&&(w={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("userId","Required parameter userId was null or undefined when calling searchLogByUserId.");return(t="/logger/user/{user_id}/logs".replace("{user_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),m&&(n=m.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),w),i={},a={},m&&m.apiKey)?"function"!=typeof m.apiKey?[3,2]:[4,m.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,m.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),void 0!==p&&(a["object.id"]=p),void 0!==f&&(a["object.name"]=f),void 0!==g&&(a.action=g),void 0!==v&&(a.user_ip=v),void 0!==y&&(a.date_from=y),void 0!==b&&(a.date_to=b),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),w.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),w.headers),[2,{url:se.format(t),options:r}]}})})}}}function St(f){return{searchLogByConfigId:function(t,r,i,a,s,o,u,c,l,d,_,h,p){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Rt(f).searchLogByConfigId(t,r,i,a,s,o,u,c,l,d,_,h,p)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchLogByUserId:function(t,r,i,a,s,o,u,c,l,d,_,h,p){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Rt(f).searchLogByUserId(t,r,i,a,s,o,u,c,l,d,_,h,p)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Kt=e,ae.__extends(Tt,Kt),Tt.prototype.searchLogByConfigId=function(e,t,n,r,i,a,s,o,u,c,l,d,_){var h=this;return St(this.configuration).searchLogByConfigId(e,t,n,r,i,a,s,o,u,c,l,d,_).then(function(e){return e(h.axios,h.basePath)})},Tt.prototype.searchLogByUserId=function(e,t,n,r,i,a,s,o,u,c,l,d,_){var h=this;return St(this.configuration).searchLogByUserId(e,t,n,r,i,a,s,o,u,c,l,d,_).then(function(e){return e(h.axios,h.basePath)})};var Kt,Pt=Tt;function Tt(){return null!==Kt&&Kt.apply(this,arguments)||this}function Ot(g){var e=this;return{deleteManager:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling deleteManager.");if(null==c)throw new O("etag","Required parameter etag was null or undefined when calling deleteManager.");return(t="/contacts/{contact_id}/managers/{etag}".replace("{contact_id}",encodeURIComponent(String(u))).replace("{etag}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return l&&(a.fields=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},deleteManagers:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling deleteManagers.");if(null==c)throw new O("etag","Required parameter etag was null or undefined when calling deleteManagers.");return(t="/contacts/{contact_id}/managers".replace("{contact_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return l&&(a.fields=l),c&&(a.etag=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},listManagers:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling listManagers.");return(t="/contacts/{contact_id}/managers".replace("{contact_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},locateManager:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling locateManager.");if(null==c)throw new O("etag","Required parameter etag was null or undefined when calling locateManager.");return(t="/contacts/{contact_id}/managers/{etag}".replace("{contact_id}",encodeURIComponent(String(u))).replace("{etag}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return l&&(a.fields=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},mergeManagers:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling mergeManagers.");if(null==l)throw new O("input","Required parameter input was null or undefined when calling mergeManagers.");return(t="/contacts/{contact_id}/managers".replace("{contact_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return d&&(a.fields=d),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},resetManagers:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling resetManagers.");if(null==l)throw new O("input","Required parameter input was null or undefined when calling resetManagers.");return(t="/contacts/{contact_id}/managers".replace("{contact_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return d&&(a.fields=d),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},updateManager:function(c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling updateManager.");if(null==l)throw new O("etag","Required parameter etag was null or undefined when calling updateManager.");if(null==d)throw new O("input","Required parameter input was null or undefined when calling updateManager.");return(t="/contacts/{contact_id}/managers/{etag}".replace("{contact_id}",encodeURIComponent(String(c))).replace("{etag}",encodeURIComponent(String(l))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),h),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return _&&(a.fields=_),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})},updateManager2:function(c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling updateManager2.");if(null==l)throw new O("etag","Required parameter etag was null or undefined when calling updateManager2.");if(null==d)throw new O("input","Required parameter input was null or undefined when calling updateManager2.");return(t="/contacts/{contact_id}/managers/{etag}".replace("{contact_id}",encodeURIComponent(String(c))).replace("{etag}",encodeURIComponent(String(l))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),h),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return _&&(a.fields=_),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function d(l){return{deleteManager:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ot(l).deleteManager(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteManagers:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ot(l).deleteManagers(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},listManagers:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ot(l).listManagers(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},locateManager:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ot(l).locateManager(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},mergeManagers:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ot(l).mergeManagers(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},resetManagers:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ot(l).resetManagers(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateManager:function(t,r,i,a,s){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ot(l).updateManager(t,r,i,a,s)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateManager2:function(t,r,i,a,s){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Ot(l).updateManager2(t,r,i,a,s)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}It=e,ae.__extends(Wt,It),Wt.prototype.deleteManager=function(e,t,n,r){var i=this;return d(this.configuration).deleteManager(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Wt.prototype.deleteManagers=function(e,t,n,r){var i=this;return d(this.configuration).deleteManagers(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Wt.prototype.listManagers=function(e,t,n,r,i,a,s,o){var u=this;return d(this.configuration).listManagers(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},Wt.prototype.locateManager=function(e,t,n,r){var i=this;return d(this.configuration).locateManager(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Wt.prototype.mergeManagers=function(e,t,n,r){var i=this;return d(this.configuration).mergeManagers(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Wt.prototype.resetManagers=function(e,t,n,r){var i=this;return d(this.configuration).resetManagers(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Wt.prototype.updateManager=function(e,t,n,r,i){var a=this;return d(this.configuration).updateManager(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},Wt.prototype.updateManager2=function(e,t,n,r,i){var a=this;return d(this.configuration).updateManager2(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})};var It,kt=Wt;function Wt(){return null!==It&&It.apply(this,arguments)||this}function Et(f){var e=this;return{deleteMediaFile:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteMediaFile.");return(t="/storage/media/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},readMediaFile:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readMediaFile.");return(t="/storage/media/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchMediaFile:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/storage/media",!0),f&&(n=f.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})}}}function Xt(c){return{deleteMediaFile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Et(c).deleteMediaFile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readMediaFile:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Et(c).readMediaFile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchMediaFile:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Et(c).searchMediaFile(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}xt=e,ae.__extends(Ut,xt),Ut.prototype.deleteMediaFile=function(e,t,n){var r=this;return Xt(this.configuration).deleteMediaFile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ut.prototype.readMediaFile=function(e,t,n){var r=this;return Xt(this.configuration).readMediaFile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ut.prototype.searchMediaFile=function(e,t,n,r,i,a,s){var o=this;return Xt(this.configuration).searchMediaFile(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})};var xt,jt=Ut;function Ut(){return null!==xt&&xt.apply(this,arguments)||this}function R(T){var e=this;return{attemptCallback:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("attemptId","Required parameter attemptId was null or undefined when calling attemptCallback.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling attemptCallback.");return(t="/call_center/attempts/{attempt_id}".replace("{attempt_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},attemptResult:function(c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling attemptResult.");if(null==l)throw new O("memberId","Required parameter memberId was null or undefined when calling attemptResult.");if(null==d)throw new O("attemptId","Required parameter attemptId was null or undefined when calling attemptResult.");if(null==_)throw new O("body","Required parameter body was null or undefined when calling attemptResult.");return(t="/call_center/queues/{queue_id}/members/{member_id}/attempts/{attempt_id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{member_id}",encodeURIComponent(String(l))).replace("{attempt_id}",encodeURIComponent(String(d))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),h),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),u="string"!=typeof _||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:se.format(t),options:r}]}})})},attemptsRenewalResult:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("attemptId","Required parameter attemptId was null or undefined when calling attemptsRenewalResult.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling attemptsRenewalResult.");return(t="/call_center/queues/attempts/{attempt_id}/renewal".replace("{attempt_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},createAttempt:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createAttempt.");if(null==l)throw new O("memberId","Required parameter memberId was null or undefined when calling createAttempt.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling createAttempt.");return(t="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(c))).replace("{member_id}",encodeURIComponent(String(l))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),_),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})},createMember:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createMember.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createMember.");return(t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},createMemberBulk:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createMemberBulk.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createMemberBulk.");return(t="/call_center/queues/{queue_id}/members/bulk".replace("{queue_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteMember:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling deleteMember.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},deleteMembers:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling deleteMembers.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling deleteMembers.");return(t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},patchMember:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling patchMember.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling patchMember.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling patchMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),_),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})},readMember:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling readMember.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},resetMembers:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling resetMembers.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling resetMembers.");return(t="/call_center/queues/{queue_id}/members/reset".replace("{queue_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},searchAttempts:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K){return void 0===K&&(K={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/queues/attempts/active",!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),K),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),void 0!==h&&(a["joined_at.from"]=h),void 0!==p&&(a["joined_at.to"]=p),f&&(a.id=f),g&&(a.queue_id=g),v&&(a.bucket_id=v),y&&(a.member_id=y),b&&(a.agent_id=b),w&&(a.result=w),void 0!==m&&(a["leaving_at.from"]=m),void 0!==q&&(a["leaving_at.to"]=q),void 0!==A&&(a["offering_at.from"]=A),void 0!==C&&(a["offering_at.to"]=C),void 0!==R&&(a["duration.from"]=R),void 0!==S&&(a["duration.to"]=S),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),K.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),K.headers),[2,{url:se.format(t),options:r}]}})})},searchAttemptsHistory:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K){return void 0===K&&(K={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/queues/attempts/history",!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),K),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),void 0!==h&&(a["joined_at.from"]=h),void 0!==p&&(a["joined_at.to"]=p),f&&(a.id=f),g&&(a.queue_id=g),v&&(a.bucket_id=v),y&&(a.member_id=y),b&&(a.agent_id=b),w&&(a.result=w),void 0!==m&&(a["leaving_at.from"]=m),void 0!==q&&(a["leaving_at.to"]=q),void 0!==A&&(a["offering_at.from"]=A),void 0!==C&&(a["offering_at.to"]=C),void 0!==R&&(a["duration.from"]=R),void 0!==S&&(a["duration.to"]=S),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),K.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),K.headers),[2,{url:se.format(t),options:r}]}})})},searchMemberAttempts:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling searchMemberAttempts.");if(null==c)throw new O("memberId","Required parameter memberId was null or undefined when calling searchMemberAttempts.");return(t="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(u))).replace("{member_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},searchMemberInQueue:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P){return void 0===P&&(P={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling searchMemberInQueue.");return(t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),P),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),f&&(a.bucket_id=f),void 0!==g&&(a.destination=g),void 0!==v&&(a["created_at.from"]=v),void 0!==y&&(a["created_at.to"]=y),void 0!==b&&(a["offering_at.from"]=b),void 0!==w&&(a["offering_at.to"]=w),m&&(a.stop_cause=m),void 0!==q&&(a["priority.from"]=q),void 0!==A&&(a["priority.to"]=A),void 0!==C&&(a.name=C),void 0!==R&&(a["attempts.from"]=R),void 0!==S&&(a["attempts.to"]=S),K&&(a.agent_id=K),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),P.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),P.headers),[2,{url:se.format(t),options:r}]}})})},searchMembers:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P){return void 0===P&&(P={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/members",!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),P),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.queue_id=p),f&&(a.bucket_id=f),void 0!==g&&(a.destination=g),void 0!==v&&(a["created_at.from"]=v),void 0!==y&&(a["created_at.to"]=y),void 0!==b&&(a["offering_at.from"]=b),void 0!==w&&(a["offering_at.to"]=w),m&&(a.stop_cause=m),void 0!==q&&(a["priority.from"]=q),void 0!==A&&(a["priority.to"]=A),void 0!==C&&(a.name=C),void 0!==R&&(a["attempts.from"]=R),void 0!==S&&(a["attempts.to"]=S),K&&(a.agent_id=K),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),P.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),P.headers),[2,{url:se.format(t),options:r}]}})})},updateMember:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling updateMember.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateMember.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),T&&(n=T.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function S(A){return{attemptCallback:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).attemptCallback(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},attemptResult:function(t,r,i,a,s){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).attemptResult(t,r,i,a,s)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},attemptsRenewalResult:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).attemptsRenewalResult(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createAttempt:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).createAttempt(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createMember:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).createMember(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createMemberBulk:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).createMemberBulk(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteMember:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).deleteMember(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteMembers:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).deleteMembers(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchMember:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).patchMember(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readMember:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).readMember(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},resetMembers:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).resetMembers(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAttempts:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).searchAttempts(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAttemptsHistory:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).searchAttemptsHistory(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchMemberAttempts:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).searchMemberAttempts(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchMemberInQueue:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).searchMemberInQueue(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchMembers:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).searchMembers(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateMember:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,R(A).updateMember(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Qt=e,ae.__extends(r,Qt),r.prototype.attemptCallback=function(e,t,n){var r=this;return S(this.configuration).attemptCallback(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.attemptResult=function(e,t,n,r,i){var a=this;return S(this.configuration).attemptResult(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},r.prototype.attemptsRenewalResult=function(e,t,n){var r=this;return S(this.configuration).attemptsRenewalResult(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.createAttempt=function(e,t,n,r){var i=this;return S(this.configuration).createAttempt(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.createMember=function(e,t,n){var r=this;return S(this.configuration).createMember(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.createMemberBulk=function(e,t,n){var r=this;return S(this.configuration).createMemberBulk(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.deleteMember=function(e,t,n,r){var i=this;return S(this.configuration).deleteMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.deleteMembers=function(e,t,n){var r=this;return S(this.configuration).deleteMembers(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.patchMember=function(e,t,n,r){var i=this;return S(this.configuration).patchMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.readMember=function(e,t,n,r){var i=this;return S(this.configuration).readMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.resetMembers=function(e,t,n){var r=this;return S(this.configuration).resetMembers(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.searchAttempts=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b){var w=this;return S(this.configuration).searchAttempts(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b).then(function(e){return e(w.axios,w.basePath)})},r.prototype.searchAttemptsHistory=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b){var w=this;return S(this.configuration).searchAttemptsHistory(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b).then(function(e){return e(w.axios,w.basePath)})},r.prototype.searchMemberAttempts=function(e,t,n,r){var i=this;return S(this.configuration).searchMemberAttempts(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.searchMemberInQueue=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){var m=this;return S(this.configuration).searchMemberInQueue(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w).then(function(e){return e(m.axios,m.basePath)})},r.prototype.searchMembers=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){var m=this;return S(this.configuration).searchMembers(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w).then(function(e){return e(m.axios,m.basePath)})},r.prototype.updateMember=function(e,t,n,r){var i=this;return S(this.configuration).updateMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var Qt,Mt=r;function r(){return null!==Qt&&Qt.apply(this,arguments)||this}function Lt(g){var e=this;return{createOutboundResourceGroup:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createOutboundResourceGroup.");return(t=se.parse("/call_center/resource_group",!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},createOutboundResourceInGroup:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("groupId","Required parameter groupId was null or undefined when calling createOutboundResourceInGroup.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteOutboundResourceGroup:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteOutboundResourceGroup.");return(t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},deleteOutboundResourceInGroup:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("groupId","Required parameter groupId was null or undefined when calling deleteOutboundResourceInGroup.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},readOutboundResourceGroup:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readOutboundResourceGroup.");return(t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},readOutboundResourceInGroup:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("groupId","Required parameter groupId was null or undefined when calling readOutboundResourceInGroup.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},searchOutboundResourceGroup:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/resource_group",!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},searchOutboundResourceInGroup:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("groupId","Required parameter groupId was null or undefined when calling searchOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},updateOutboundResourceGroup:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateOutboundResourceGroup.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateOutboundResourceGroup.");return(t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},updateOutboundResourceInGroup:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("groupId","Required parameter groupId was null or undefined when calling updateOutboundResourceInGroup.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateOutboundResourceInGroup.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function p(l){return{createOutboundResourceGroup:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Lt(l).createOutboundResourceGroup(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createOutboundResourceInGroup:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Lt(l).createOutboundResourceInGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResourceGroup:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Lt(l).deleteOutboundResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResourceInGroup:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Lt(l).deleteOutboundResourceInGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResourceGroup:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Lt(l).readOutboundResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResourceInGroup:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Lt(l).readOutboundResourceInGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResourceGroup:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Lt(l).searchOutboundResourceGroup(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResourceInGroup:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Lt(l).searchOutboundResourceInGroup(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResourceGroup:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Lt(l).updateOutboundResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResourceInGroup:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Lt(l).updateOutboundResourceInGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Ft=e,ae.__extends(Bt,Ft),Bt.prototype.createOutboundResourceGroup=function(e,t){var n=this;return p(this.configuration).createOutboundResourceGroup(e,t).then(function(e){return e(n.axios,n.basePath)})},Bt.prototype.createOutboundResourceInGroup=function(e,t,n){var r=this;return p(this.configuration).createOutboundResourceInGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Bt.prototype.deleteOutboundResourceGroup=function(e,t,n){var r=this;return p(this.configuration).deleteOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Bt.prototype.deleteOutboundResourceInGroup=function(e,t,n,r){var i=this;return p(this.configuration).deleteOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Bt.prototype.readOutboundResourceGroup=function(e,t,n){var r=this;return p(this.configuration).readOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Bt.prototype.readOutboundResourceInGroup=function(e,t,n,r){var i=this;return p(this.configuration).readOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Bt.prototype.searchOutboundResourceGroup=function(e,t,n,r,i,a,s){var o=this;return p(this.configuration).searchOutboundResourceGroup(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Bt.prototype.searchOutboundResourceInGroup=function(e,t,n,r,i,a,s,o){var u=this;return p(this.configuration).searchOutboundResourceInGroup(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},Bt.prototype.updateOutboundResourceGroup=function(e,t,n){var r=this;return p(this.configuration).updateOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Bt.prototype.updateOutboundResourceInGroup=function(e,t,n,r){var i=this;return p(this.configuration).updateOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var Ft,Gt=Bt;function Bt(){return null!==Ft&&Ft.apply(this,arguments)||this}function Dt(g){var e=this;return{createOutboundResource:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createOutboundResource.");return(t=se.parse("/call_center/resources",!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},createOutboundResourceDisplay:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("resourceId","Required parameter resourceId was null or undefined when calling createOutboundResourceDisplay.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},createOutboundResourceDisplayBulk:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("resourceId","Required parameter resourceId was null or undefined when calling createOutboundResourceDisplayBulk.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createOutboundResourceDisplayBulk.");return(t="/call_center/resources/{resource_id}/display/bulk".replace("{resource_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteOutboundResource:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},deleteOutboundResourceDisplay:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("resourceId","Required parameter resourceId was null or undefined when calling deleteOutboundResourceDisplay.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},deleteOutboundResourceDisplays:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("resourceId","Required parameter resourceId was null or undefined when calling deleteOutboundResourceDisplays.");return(t="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return c&&(a.items=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},patchOutboundResource:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchOutboundResource.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readOutboundResource:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},readOutboundResourceDisplay:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("resourceId","Required parameter resourceId was null or undefined when calling readOutboundResourceDisplay.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},searchOutboundResource:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/resources",!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},searchOutboundResourceDisplay:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("resourceId","Required parameter resourceId was null or undefined when calling searchOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},updateOutboundResource:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateOutboundResource.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},updateOutboundResourceDisplay:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("resourceId","Required parameter resourceId was null or undefined when calling updateOutboundResourceDisplay.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateOutboundResourceDisplay.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function f(l){return{createOutboundResource:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(l).createOutboundResource(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createOutboundResourceDisplay:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(l).createOutboundResourceDisplay(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createOutboundResourceDisplayBulk:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(l).createOutboundResourceDisplayBulk(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResource:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(l).deleteOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResourceDisplay:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(l).deleteOutboundResourceDisplay(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResourceDisplays:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(l).deleteOutboundResourceDisplays(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchOutboundResource:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(l).patchOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResource:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(l).readOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResourceDisplay:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(l).readOutboundResourceDisplay(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResource:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(l).searchOutboundResource(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResourceDisplay:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(l).searchOutboundResourceDisplay(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResource:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(l).updateOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResourceDisplay:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(l).updateOutboundResourceDisplay(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Ht=e,ae.__extends(i,Ht),i.prototype.createOutboundResource=function(e,t){var n=this;return f(this.configuration).createOutboundResource(e,t).then(function(e){return e(n.axios,n.basePath)})},i.prototype.createOutboundResourceDisplay=function(e,t,n){var r=this;return f(this.configuration).createOutboundResourceDisplay(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.createOutboundResourceDisplayBulk=function(e,t,n){var r=this;return f(this.configuration).createOutboundResourceDisplayBulk(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.deleteOutboundResource=function(e,t,n){var r=this;return f(this.configuration).deleteOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.deleteOutboundResourceDisplay=function(e,t,n,r){var i=this;return f(this.configuration).deleteOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},i.prototype.deleteOutboundResourceDisplays=function(e,t,n){var r=this;return f(this.configuration).deleteOutboundResourceDisplays(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.patchOutboundResource=function(e,t,n){var r=this;return f(this.configuration).patchOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.readOutboundResource=function(e,t,n){var r=this;return f(this.configuration).readOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.readOutboundResourceDisplay=function(e,t,n,r){var i=this;return f(this.configuration).readOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},i.prototype.searchOutboundResource=function(e,t,n,r,i,a,s){var o=this;return f(this.configuration).searchOutboundResource(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},i.prototype.searchOutboundResourceDisplay=function(e,t,n,r,i,a,s,o){var u=this;return f(this.configuration).searchOutboundResourceDisplay(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},i.prototype.updateOutboundResource=function(e,t,n){var r=this;return f(this.configuration).updateOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.updateOutboundResourceDisplay=function(e,t,n,r){var i=this;return f(this.configuration).updateOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var Ht,Nt=i;function i(){return null!==Ht&&Ht.apply(this,arguments)||this}function Jt(g){var e=this;return{createPresetQuery:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createPresetQuery.");return(t=se.parse("/call_center/preset/query",!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deletePresetQuery:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deletePresetQuery.");return(t="/call_center/preset/query/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},patchPresetQuery:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchPresetQuery.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchPresetQuery.");return(t="/call_center/preset/query/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readPresetQuery:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readPresetQuery.");return(t="/call_center/preset/query/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchPresetQuery:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/preset/query",!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.section=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},updatePresetQuery:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updatePresetQuery.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updatePresetQuery.");return(t="/call_center/preset/query/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function Vt(l){return{createPresetQuery:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(l).createPresetQuery(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deletePresetQuery:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(l).deletePresetQuery(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchPresetQuery:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(l).patchPresetQuery(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readPresetQuery:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(l).readPresetQuery(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchPresetQuery:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(l).searchPresetQuery(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updatePresetQuery:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(l).updatePresetQuery(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}zt=e,ae.__extends(Yt,zt),Yt.prototype.createPresetQuery=function(e,t){var n=this;return Vt(this.configuration).createPresetQuery(e,t).then(function(e){return e(n.axios,n.basePath)})},Yt.prototype.deletePresetQuery=function(e,t){var n=this;return Vt(this.configuration).deletePresetQuery(e,t).then(function(e){return e(n.axios,n.basePath)})},Yt.prototype.patchPresetQuery=function(e,t,n){var r=this;return Vt(this.configuration).patchPresetQuery(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Yt.prototype.readPresetQuery=function(e,t){var n=this;return Vt(this.configuration).readPresetQuery(e,t).then(function(e){return e(n.axios,n.basePath)})},Yt.prototype.searchPresetQuery=function(e,t,n,r,i,a,s,o){var u=this;return Vt(this.configuration).searchPresetQuery(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},Yt.prototype.updatePresetQuery=function(e,t,n){var r=this;return Vt(this.configuration).updatePresetQuery(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var zt,$t=Yt;function Yt(){return null!==zt&&zt.apply(this,arguments)||this}function Zt(g){var e=this;return{createQueueBucket:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createQueueBucket.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteQueueBucket:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling deleteQueueBucket.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},patchQueueBucket:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling patchQueueBucket.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling patchQueueBucket.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling patchQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})},readQueueBucket:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling readQueueBucket.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchQueueBucket:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling searchQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},updateQueueBucket:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling updateQueueBucket.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateQueueBucket.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function en(l){return{createQueueBucket:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Zt(l).createQueueBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueBucket:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Zt(l).deleteQueueBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueueBucket:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Zt(l).patchQueueBucket(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueBucket:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Zt(l).readQueueBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueBucket:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Zt(l).searchQueueBucket(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueBucket:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Zt(l).updateQueueBucket(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}tn=e,ae.__extends(rn,tn),rn.prototype.createQueueBucket=function(e,t,n){var r=this;return en(this.configuration).createQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},rn.prototype.deleteQueueBucket=function(e,t,n){var r=this;return en(this.configuration).deleteQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},rn.prototype.patchQueueBucket=function(e,t,n,r){var i=this;return en(this.configuration).patchQueueBucket(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},rn.prototype.readQueueBucket=function(e,t,n){var r=this;return en(this.configuration).readQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},rn.prototype.searchQueueBucket=function(e,t,n,r,i,a,s,o){var u=this;return en(this.configuration).searchQueueBucket(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},rn.prototype.updateQueueBucket=function(e,t,n,r){var i=this;return en(this.configuration).updateQueueBucket(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var tn,nn=rn;function rn(){return null!==tn&&tn.apply(this,arguments)||this}function an(y){var e=this;return{createQueueHook:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createQueueHook.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createQueueHook.");return(t="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteQueueHook:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling deleteQueueHook.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},patchQueueHook:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling patchQueueHook.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling patchQueueHook.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling patchQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),_),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})},readQueueHook:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling readQueueHook.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchQueueHook:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling searchQueueHook.");return(t="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),v),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),f&&(a.schema_id=f),g&&(a.event=g),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),v.headers),[2,{url:se.format(t),options:r}]}})})},updateQueueHook:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling updateQueueHook.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateQueueHook.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function sn(_){return{createQueueHook:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,an(_).createQueueHook(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueHook:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,an(_).deleteQueueHook(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueueHook:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,an(_).patchQueueHook(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueHook:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,an(_).readQueueHook(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueHook:function(t,r,i,a,s,o,u,c,l,d){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,an(_).searchQueueHook(t,r,i,a,s,o,u,c,l,d)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueHook:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,an(_).updateQueueHook(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}on=e,ae.__extends(cn,on),cn.prototype.createQueueHook=function(e,t,n){var r=this;return sn(this.configuration).createQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},cn.prototype.deleteQueueHook=function(e,t,n){var r=this;return sn(this.configuration).deleteQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},cn.prototype.patchQueueHook=function(e,t,n,r){var i=this;return sn(this.configuration).patchQueueHook(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},cn.prototype.readQueueHook=function(e,t,n){var r=this;return sn(this.configuration).readQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},cn.prototype.searchQueueHook=function(e,t,n,r,i,a,s,o,u,c){var l=this;return sn(this.configuration).searchQueueHook(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},cn.prototype.updateQueueHook=function(e,t,n,r){var i=this;return sn(this.configuration).updateQueueHook(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var on,un=cn;function cn(){return null!==on&&on.apply(this,arguments)||this}function ln(g){var e=this;return{createQueueResourceGroup:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createQueueResourceGroup.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteQueueResourceGroup:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling deleteQueueResourceGroup.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},readQueueResourceGroup:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling readQueueResourceGroup.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},searchQueueResourceGroup:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling searchQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},updateQueueResourceGroup:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling updateQueueResourceGroup.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateQueueResourceGroup.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function dn(l){return{createQueueResourceGroup:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ln(l).createQueueResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueResourceGroup:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ln(l).deleteQueueResourceGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueResourceGroup:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ln(l).readQueueResourceGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueResourceGroup:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ln(l).searchQueueResourceGroup(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueResourceGroup:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ln(l).updateQueueResourceGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}_n=e,ae.__extends(pn,_n),pn.prototype.createQueueResourceGroup=function(e,t,n){var r=this;return dn(this.configuration).createQueueResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},pn.prototype.deleteQueueResourceGroup=function(e,t,n,r){var i=this;return dn(this.configuration).deleteQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},pn.prototype.readQueueResourceGroup=function(e,t,n,r){var i=this;return dn(this.configuration).readQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},pn.prototype.searchQueueResourceGroup=function(e,t,n,r,i,a,s,o){var u=this;return dn(this.configuration).searchQueueResourceGroup(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},pn.prototype.updateQueueResourceGroup=function(e,t,n,r){var i=this;return dn(this.configuration).updateQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var _n,hn=pn;function pn(){return null!==_n&&_n.apply(this,arguments)||this}function fn(w){var e=this;return{createQueue:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createQueue.");return(t=se.parse("/call_center/queues",!0),w&&(n=w.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteQueue:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),w&&(n=w.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},patchQueue:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchQueue.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),w&&(n=w.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readQueue:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),w&&(n=w.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchQueue:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/queues",!0),w&&(n=w.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.type=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},searchQueueReportGeneral:function(u,c,l,d,_,h,p,f,g,v,y,b){return void 0===b&&(b={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/queues/reports/general",!0),w&&(n=w.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),b),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a["joined_at.from"]=l),void 0!==d&&(a["joined_at.to"]=d),void 0!==_&&(a.domain_id=_),h&&(a.fields=h),void 0!==p&&(a.sort=p),void 0!==f&&(a.q=f),g&&(a.queue_id=g),v&&(a.team_id=v),y&&(a.type=y),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),b.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),b.headers),[2,{url:se.format(t),options:r}]}})})},updateQueue:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateQueue.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),w&&(n=w.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function b(p){return{createQueue:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,fn(p).createQueue(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueue:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,fn(p).deleteQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueue:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,fn(p).patchQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueue:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,fn(p).readQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueue:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,fn(p).searchQueue(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueReportGeneral:function(t,r,i,a,s,o,u,c,l,d,_,h){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,fn(p).searchQueueReportGeneral(t,r,i,a,s,o,u,c,l,d,_,h)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueue:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,fn(p).updateQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}gn=e,ae.__extends(yn,gn),yn.prototype.createQueue=function(e,t){var n=this;return b(this.configuration).createQueue(e,t).then(function(e){return e(n.axios,n.basePath)})},yn.prototype.deleteQueue=function(e,t,n){var r=this;return b(this.configuration).deleteQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},yn.prototype.patchQueue=function(e,t,n){var r=this;return b(this.configuration).patchQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},yn.prototype.readQueue=function(e,t,n){var r=this;return b(this.configuration).readQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},yn.prototype.searchQueue=function(e,t,n,r,i,a,s,o){var u=this;return b(this.configuration).searchQueue(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},yn.prototype.searchQueueReportGeneral=function(e,t,n,r,i,a,s,o,u,c,l,d){var _=this;return b(this.configuration).searchQueueReportGeneral(e,t,n,r,i,a,s,o,u,c,l,d).then(function(e){return e(_.axios,_.basePath)})},yn.prototype.updateQueue=function(e,t,n){var r=this;return b(this.configuration).updateQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var gn,vn=yn;function yn(){return null!==gn&&gn.apply(this,arguments)||this}function bn(q){var e=this;return{createQueueSkill:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createQueueSkill.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createQueueSkill.");return(t="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteQueueSkill:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling deleteQueueSkill.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},patchQueueSkill:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling patchQueueSkill.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling patchQueueSkill.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling patchQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),_),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})},readQueueSkill:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling readQueueSkill.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchQueueSkill:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m){return void 0===m&&(m={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling searchQueueSkill.");return(t="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),m),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),f&&(a.skill_id=f),g&&(a.bucket_id=g),v&&(a.lvl=v),y&&(a.min_capacity=y),b&&(a.max_capacity=b),void 0!==w&&(a.enabled=w),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),m.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),m.headers),[2,{url:se.format(t),options:r}]}})})},updateQueueSkill:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling updateQueueSkill.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateQueueSkill.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function wn(g){return{createQueueSkill:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,bn(g).createQueueSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueSkill:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,bn(g).deleteQueueSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueueSkill:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,bn(g).patchQueueSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueSkill:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,bn(g).readQueueSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueSkill:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,bn(g).searchQueueSkill(t,r,i,a,s,o,u,c,l,d,_,h,p,f)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueSkill:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,bn(g).updateQueueSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}mn=e,ae.__extends(An,mn),An.prototype.createQueueSkill=function(e,t,n){var r=this;return wn(this.configuration).createQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},An.prototype.deleteQueueSkill=function(e,t,n){var r=this;return wn(this.configuration).deleteQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},An.prototype.patchQueueSkill=function(e,t,n,r){var i=this;return wn(this.configuration).patchQueueSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},An.prototype.readQueueSkill=function(e,t,n){var r=this;return wn(this.configuration).readQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},An.prototype.searchQueueSkill=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){var p=this;return wn(this.configuration).searchQueueSkill(e,t,n,r,i,a,s,o,u,c,l,d,_,h).then(function(e){return e(p.axios,p.basePath)})},An.prototype.updateQueueSkill=function(e,t,n,r){var i=this;return wn(this.configuration).updateQueueSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var mn,qn=An;function An(){return null!==mn&&mn.apply(this,arguments)||this}function Cn(y){var e=this;return{createRegion:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createRegion.");return(t=se.parse("/regions",!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteRegion:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},patchRegion:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchRegion.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readRegion:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchRegion:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/regions",!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),v),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),void 0!==f&&(a.description=f),g&&(a.timezone_id=g),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),v.headers),[2,{url:se.format(t),options:r}]}})})},updateRegion:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateRegion.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),y&&(n=y.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function Rn(_){return{createRegion:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Cn(_).createRegion(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRegion:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Cn(_).deleteRegion(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchRegion:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Cn(_).patchRegion(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRegion:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Cn(_).readRegion(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRegion:function(t,r,i,a,s,o,u,c,l,d){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Cn(_).searchRegion(t,r,i,a,s,o,u,c,l,d)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRegion:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Cn(_).updateRegion(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Sn=e,ae.__extends(Pn,Sn),Pn.prototype.createRegion=function(e,t){var n=this;return Rn(this.configuration).createRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},Pn.prototype.deleteRegion=function(e,t){var n=this;return Rn(this.configuration).deleteRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},Pn.prototype.patchRegion=function(e,t,n){var r=this;return Rn(this.configuration).patchRegion(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Pn.prototype.readRegion=function(e,t){var n=this;return Rn(this.configuration).readRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},Pn.prototype.searchRegion=function(e,t,n,r,i,a,s,o,u,c){var l=this;return Rn(this.configuration).searchRegion(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},Pn.prototype.updateRegion=function(e,t,n){var r=this;return Rn(this.configuration).updateRegion(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Sn,Kn=Pn;function Pn(){return null!==Sn&&Sn.apply(this,arguments)||this}function Tn(v){var e=this;return{createChatPlan:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createChatPlan.");return(t=se.parse("/routing/outbound/chat",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteChatPlan:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},patchChatPlan:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchChatPlan.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readChatPlan:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchChatPlan:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/routing/outbound/chat",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),void 0!==f&&(a.enabled=f),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),g.headers),[2,{url:se.format(t),options:r}]}})})},updateChatPlan:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateChatPlan.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function On(d){return{createChatPlan:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Tn(d).createChatPlan(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteChatPlan:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Tn(d).deleteChatPlan(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchChatPlan:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Tn(d).patchChatPlan(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readChatPlan:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Tn(d).readChatPlan(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchChatPlan:function(t,r,i,a,s,o,u,c,l){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Tn(d).searchChatPlan(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateChatPlan:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Tn(d).updateChatPlan(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}In=e,ae.__extends(Wn,In),Wn.prototype.createChatPlan=function(e,t){var n=this;return On(this.configuration).createChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},Wn.prototype.deleteChatPlan=function(e,t){var n=this;return On(this.configuration).deleteChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},Wn.prototype.patchChatPlan=function(e,t,n){var r=this;return On(this.configuration).patchChatPlan(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Wn.prototype.readChatPlan=function(e,t){var n=this;return On(this.configuration).readChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},Wn.prototype.searchChatPlan=function(e,t,n,r,i,a,s,o,u){var c=this;return On(this.configuration).searchChatPlan(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},Wn.prototype.updateChatPlan=function(e,t,n){var r=this;return On(this.configuration).updateChatPlan(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var In,kn=Wn;function Wn(){return null!==In&&In.apply(this,arguments)||this}function En(b){var e=this;return{createRoutingOutboundCall:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createRoutingOutboundCall.");return(t=se.parse("/routing/outbound/calls",!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteRoutingOutboundCall:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},movePositionRoutingOutboundCall:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("fromId","Required parameter fromId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==l)throw new O("toId","Required parameter toId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling movePositionRoutingOutboundCall.");return(t="/routing/outbound/calls/{from_id}/to/{to_id}".replace("{from_id}",encodeURIComponent(String(c))).replace("{to_id}",encodeURIComponent(String(l))),t=se.parse(t,!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),_),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})},patchRoutingOutboundCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchRoutingOutboundCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readRoutingOutboundCall:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchRoutingOutboundCall:function(u,c,l,d,_,h,p,f,g,v,y){return void 0===y&&(y={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/routing/outbound/calls",!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),y),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),f&&(a.schema_id=f),void 0!==g&&(a.pattern=g),void 0!==v&&(a.description=v),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),y.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),y.headers),[2,{url:se.format(t),options:r}]}})})},updateRoutingOutboundCall:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateRoutingOutboundCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function Xn(h){return{createRoutingOutboundCall:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,En(h).createRoutingOutboundCall(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRoutingOutboundCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,En(h).deleteRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},movePositionRoutingOutboundCall:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,En(h).movePositionRoutingOutboundCall(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchRoutingOutboundCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,En(h).patchRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRoutingOutboundCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,En(h).readRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRoutingOutboundCall:function(t,r,i,a,s,o,u,c,l,d,_){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,En(h).searchRoutingOutboundCall(t,r,i,a,s,o,u,c,l,d,_)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRoutingOutboundCall:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,En(h).updateRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}xn=e,ae.__extends(Un,xn),Un.prototype.createRoutingOutboundCall=function(e,t){var n=this;return Xn(this.configuration).createRoutingOutboundCall(e,t).then(function(e){return e(n.axios,n.basePath)})},Un.prototype.deleteRoutingOutboundCall=function(e,t,n){var r=this;return Xn(this.configuration).deleteRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Un.prototype.movePositionRoutingOutboundCall=function(e,t,n,r){var i=this;return Xn(this.configuration).movePositionRoutingOutboundCall(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Un.prototype.patchRoutingOutboundCall=function(e,t,n){var r=this;return Xn(this.configuration).patchRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Un.prototype.readRoutingOutboundCall=function(e,t,n){var r=this;return Xn(this.configuration).readRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Un.prototype.searchRoutingOutboundCall=function(e,t,n,r,i,a,s,o,u,c,l){var d=this;return Xn(this.configuration).searchRoutingOutboundCall(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(d.axios,d.basePath)})},Un.prototype.updateRoutingOutboundCall=function(e,t,n){var r=this;return Xn(this.configuration).updateRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var xn,jn=Un;function Un(){return null!==xn&&xn.apply(this,arguments)||this}function Qn(b){var e=this;return{createRoutingSchema:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createRoutingSchema.");return(t=se.parse("/routing/schema",!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteRoutingSchema:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},patchRoutingSchema:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchRoutingSchema.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readRoutingSchema:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchRoutingSchema:function(u,c,l,d,_,h,p,f,g,v,y){return void 0===y&&(y={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/routing/schema",!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),y),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),f&&(a.type=f),void 0!==g&&(a.editor=g),v&&(a.tags=v),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),y.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),y.headers),[2,{url:se.format(t),options:r}]}})})},searchRoutingSchemaTags:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/routing/schema/tags",!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.type=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},updateRoutingSchema:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateRoutingSchema.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),b&&(n=b.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function Mn(h){return{createRoutingSchema:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Qn(h).createRoutingSchema(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRoutingSchema:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Qn(h).deleteRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchRoutingSchema:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Qn(h).patchRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRoutingSchema:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Qn(h).readRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRoutingSchema:function(t,r,i,a,s,o,u,c,l,d,_){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Qn(h).searchRoutingSchema(t,r,i,a,s,o,u,c,l,d,_)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRoutingSchemaTags:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Qn(h).searchRoutingSchemaTags(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRoutingSchema:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Qn(h).updateRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Ln=e,ae.__extends(Gn,Ln),Gn.prototype.createRoutingSchema=function(e,t){var n=this;return Mn(this.configuration).createRoutingSchema(e,t).then(function(e){return e(n.axios,n.basePath)})},Gn.prototype.deleteRoutingSchema=function(e,t,n){var r=this;return Mn(this.configuration).deleteRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Gn.prototype.patchRoutingSchema=function(e,t,n){var r=this;return Mn(this.configuration).patchRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Gn.prototype.readRoutingSchema=function(e,t,n){var r=this;return Mn(this.configuration).readRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Gn.prototype.searchRoutingSchema=function(e,t,n,r,i,a,s,o,u,c,l){var d=this;return Mn(this.configuration).searchRoutingSchema(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(d.axios,d.basePath)})},Gn.prototype.searchRoutingSchemaTags=function(e,t,n,r,i,a,s){var o=this;return Mn(this.configuration).searchRoutingSchemaTags(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Gn.prototype.updateRoutingSchema=function(e,t,n){var r=this;return Mn(this.configuration).updateRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Ln,Fn=Gn;function Gn(){return null!==Ln&&Ln.apply(this,arguments)||this}function Bn(_){var e=this;return{createRoutingVariable:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createRoutingVariable.");return(t=se.parse("/routing/variables",!0),_&&(n=_.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},deleteRoutingVariable:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteRoutingVariable.");return(t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),_&&(n=_.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},readRoutingVariable:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readRoutingVariable.");return(t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),_&&(n=_.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchRoutingVariable:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/routing/variables",!0),_&&(n=_.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),d),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.domain_id=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},updateRoutingVariable:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateRoutingVariable.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateRoutingVariable.");return(t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),_&&(n=_.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function Dn(s){return{createRoutingVariable:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Bn(s).createRoutingVariable(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRoutingVariable:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Bn(s).deleteRoutingVariable(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRoutingVariable:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Bn(s).readRoutingVariable(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRoutingVariable:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Bn(s).searchRoutingVariable(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRoutingVariable:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Bn(s).updateRoutingVariable(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Hn=e,ae.__extends(Jn,Hn),Jn.prototype.createRoutingVariable=function(e,t){var n=this;return Dn(this.configuration).createRoutingVariable(e,t).then(function(e){return e(n.axios,n.basePath)})},Jn.prototype.deleteRoutingVariable=function(e,t,n){var r=this;return Dn(this.configuration).deleteRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Jn.prototype.readRoutingVariable=function(e,t,n){var r=this;return Dn(this.configuration).readRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Jn.prototype.searchRoutingVariable=function(e,t,n,r){var i=this;return Dn(this.configuration).searchRoutingVariable(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Jn.prototype.updateRoutingVariable=function(e,t,n){var r=this;return Dn(this.configuration).updateRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Hn,Nn=Jn;function Jn(){return null!==Hn&&Hn.apply(this,arguments)||this}function Vn(v){var e=this;return{createSkill:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createSkill.");return(t=se.parse("/call_center/skills",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},createSkillAgent:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("skillId","Required parameter skillId was null or undefined when calling createSkillAgent.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createSkillAgent.");return(t="/call_center/skills/{skill_id}/agents".replace("{skill_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteSkill:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteSkill.");return(t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},deleteSkillAgent:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("skillId","Required parameter skillId was null or undefined when calling deleteSkillAgent.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling deleteSkillAgent.");return(t="/call_center/skills/{skill_id}/agents".replace("{skill_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},patchSkillAgent:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("skillId","Required parameter skillId was null or undefined when calling patchSkillAgent.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchSkillAgent.");return(t="/call_center/skills/{skill_id}/agents".replace("{skill_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readSkill:function(u,c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readSkill.");return(t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),[2,{url:se.format(t),options:r}]}})})},searchSkill:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/call_center/skills",!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),p),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),p.headers),[2,{url:se.format(t),options:r}]}})})},searchSkillAgent:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("skillId","Required parameter skillId was null or undefined when calling searchSkillAgent.");return(t="/call_center/skills/{skill_id}/agents".replace("{skill_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),f&&(a.agent_id=f),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),g.headers),[2,{url:se.format(t),options:r}]}})})},updateSkill:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateSkill.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateSkill.");return(t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),v&&(n=v.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function w(d){return{createSkill:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Vn(d).createSkill(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createSkillAgent:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Vn(d).createSkillAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteSkill:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Vn(d).deleteSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteSkillAgent:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Vn(d).deleteSkillAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchSkillAgent:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Vn(d).patchSkillAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readSkill:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Vn(d).readSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchSkill:function(t,r,i,a,s,o,u){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Vn(d).searchSkill(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchSkillAgent:function(t,r,i,a,s,o,u,c,l){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Vn(d).searchSkillAgent(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateSkill:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Vn(d).updateSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}zn=e,ae.__extends(Yn,zn),Yn.prototype.createSkill=function(e,t){var n=this;return w(this.configuration).createSkill(e,t).then(function(e){return e(n.axios,n.basePath)})},Yn.prototype.createSkillAgent=function(e,t,n){var r=this;return w(this.configuration).createSkillAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Yn.prototype.deleteSkill=function(e,t,n){var r=this;return w(this.configuration).deleteSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Yn.prototype.deleteSkillAgent=function(e,t,n){var r=this;return w(this.configuration).deleteSkillAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Yn.prototype.patchSkillAgent=function(e,t,n){var r=this;return w(this.configuration).patchSkillAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Yn.prototype.readSkill=function(e,t,n){var r=this;return w(this.configuration).readSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Yn.prototype.searchSkill=function(e,t,n,r,i,a,s){var o=this;return w(this.configuration).searchSkill(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Yn.prototype.searchSkillAgent=function(e,t,n,r,i,a,s,o,u){var c=this;return w(this.configuration).searchSkillAgent(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},Yn.prototype.updateSkill=function(e,t,n){var r=this;return w(this.configuration).updateSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var zn,$n=Yn;function Yn(){return null!==zn&&zn.apply(this,arguments)||this}function Zn(q){var e=this;return{createTrigger:function(c,l){return void 0===l&&(l={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createTrigger.");return(t=se.parse("/trigger",!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),l),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),l.headers),u="string"!=typeof c||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==c?c:{}):c||"",[2,{url:se.format(t),options:r}]}})})},createTriggerJob:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("triggerId","Required parameter triggerId was null or undefined when calling createTriggerJob.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createTriggerJob.");return(t="/trigger/{trigger_id}/job".replace("{trigger_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),d),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},deleteTrigger:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteTrigger.");return(t="/trigger/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),c),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},patchTrigger:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchTrigger.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchTrigger.");return(t="/trigger/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),d),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},readTrigger:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readTrigger.");return(t="/trigger/{id}".replace("{id}",encodeURIComponent(String(u))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})},searchTrigger:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:return(t=se.parse("/trigger",!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.schema_id=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},searchTriggerJob:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m){return void 0===m&&(m={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("triggerId","Required parameter triggerId was null or undefined when calling searchTriggerJob.");return(t="/trigger/{trigger_id}/job".replace("{trigger_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),m),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),void 0!==p&&(a["created_at.from"]=p),void 0!==f&&(a["created_at.to"]=f),void 0!==g&&(a["started_at.from"]=g),void 0!==v&&(a["started_at.to"]=v),void 0!==y&&(a["duration.from"]=y),void 0!==b&&(a["duration.to"]=b),w&&(a.state=w),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),m.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),m.headers),[2,{url:se.format(t),options:r}]}})})},updateTrigger:function(c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateTrigger.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateTrigger.");return(t="/trigger/{id}".replace("{id}",encodeURIComponent(String(c))),t=se.parse(t,!0),q&&(n=q.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),d),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})}}}function m(g){return{createTrigger:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Zn(g).createTrigger(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createTriggerJob:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Zn(g).createTriggerJob(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteTrigger:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Zn(g).deleteTrigger(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchTrigger:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Zn(g).patchTrigger(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readTrigger:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Zn(g).readTrigger(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchTrigger:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Zn(g).searchTrigger(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchTriggerJob:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Zn(g).searchTriggerJob(t,r,i,a,s,o,u,c,l,d,_,h,p,f)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateTrigger:function(t,r,i){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,Zn(g).updateTrigger(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}er=e,ae.__extends(nr,er),nr.prototype.createTrigger=function(e,t){var n=this;return m(this.configuration).createTrigger(e,t).then(function(e){return e(n.axios,n.basePath)})},nr.prototype.createTriggerJob=function(e,t,n){var r=this;return m(this.configuration).createTriggerJob(e,t,n).then(function(e){return e(r.axios,r.basePath)})},nr.prototype.deleteTrigger=function(e,t){var n=this;return m(this.configuration).deleteTrigger(e,t).then(function(e){return e(n.axios,n.basePath)})},nr.prototype.patchTrigger=function(e,t,n){var r=this;return m(this.configuration).patchTrigger(e,t,n).then(function(e){return e(r.axios,r.basePath)})},nr.prototype.readTrigger=function(e,t){var n=this;return m(this.configuration).readTrigger(e,t).then(function(e){return e(n.axios,n.basePath)})},nr.prototype.searchTrigger=function(e,t,n,r,i,a,s,o){var u=this;return m(this.configuration).searchTrigger(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},nr.prototype.searchTriggerJob=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){var p=this;return m(this.configuration).searchTriggerJob(e,t,n,r,i,a,s,o,u,c,l,d,_,h).then(function(e){return e(p.axios,p.basePath)})},nr.prototype.updateTrigger=function(e,t,n){var r=this;return m(this.configuration).updateTrigger(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var er,tr=nr;function nr(){return null!==er&&er.apply(this,arguments)||this}function rr(l){var e=this;return{defaultDeviceConfig:function(u,c){return void 0===c&&(c={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("type","Required parameter type was null or undefined when calling defaultDeviceConfig.");return(t="/user/device/config/{type}".replace("{type}",encodeURIComponent(String(u))),t=se.parse(t,!0),l&&(n=l.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),c),i={},a={},l&&l.apiKey)?"function"!=typeof l.apiKey?[3,2]:[4,l.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,l.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),c.headers),[2,{url:se.format(t),options:r}]}})})}}}function ir(i){return{defaultDeviceConfig:function(t,r){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,rr(i).defaultDeviceConfig(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ar=e,ae.__extends(or,ar),or.prototype.defaultDeviceConfig=function(e,t){var n=this;return ir(this.configuration).defaultDeviceConfig(e,t).then(function(e){return e(n.axios,n.basePath)})};var ar,sr=or;function or(){return null!==ar&&ar.apply(this,arguments)||this}function ur(g){var e=this;return{deleteVariable:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling deleteVariable.");if(null==c)throw new O("etag","Required parameter etag was null or undefined when calling deleteVariable.");return(t="/contacts/{contact_id}/variables/{etag}".replace("{contact_id}",encodeURIComponent(String(u))).replace("{etag}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return l&&(a.fields=l),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},deleteVariables:function(u,c,l,d){return void 0===d&&(d={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling deleteVariables.");if(null==c)throw new O("etag","Required parameter etag was null or undefined when calling deleteVariables.");return(t="/contacts/{contact_id}/variables".replace("{contact_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return l&&(a.fields=l),c&&(a.etag=c),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),d.headers),[2,{url:se.format(t),options:r}]}})})},listVariables:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("contactId","Required parameter contactId was null or undefined when calling listVariables.");return(t="/contacts/{contact_id}/variables".replace("{contact_id}",encodeURIComponent(String(u))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),f.headers),[2,{url:se.format(t),options:r}]}})})},mergeVariables:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling mergeVariables.");if(null==l)throw new O("input","Required parameter input was null or undefined when calling mergeVariables.");return(t="/contacts/{contact_id}/variables".replace("{contact_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"POST"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return d&&(a.fields=d),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},resetVariables:function(c,l,d,_){return void 0===_&&(_={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling resetVariables.");if(null==l)throw new O("input","Required parameter input was null or undefined when calling resetVariables.");return(t="/contacts/{contact_id}/variables".replace("{contact_id}",encodeURIComponent(String(c))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return d&&(a.fields=d),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),_.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:se.format(t),options:r}]}})})},updateVariable:function(c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling updateVariable.");if(null==l)throw new O("etag","Required parameter etag was null or undefined when calling updateVariable.");if(null==d)throw new O("input","Required parameter input was null or undefined when calling updateVariable.");return(t="/contacts/{contact_id}/variables/{etag}".replace("{contact_id}",encodeURIComponent(String(c))).replace("{etag}",encodeURIComponent(String(l))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PUT"},n),h),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return _&&(a.fields=_),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})},updateVariable2:function(c,l,d,_,h){return void 0===h&&(h={}),ae.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return ae.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("contactId","Required parameter contactId was null or undefined when calling updateVariable2.");if(null==l)throw new O("etag","Required parameter etag was null or undefined when calling updateVariable2.");if(null==d)throw new O("input","Required parameter input was null or undefined when calling updateVariable2.");return(t="/contacts/{contact_id}/variables/{etag}".replace("{contact_id}",encodeURIComponent(String(c))).replace("{etag}",encodeURIComponent(String(l))),t=se.parse(t,!0),g&&(n=g.baseOptions),r=ae.__assign(ae.__assign({method:"PATCH"},n),h),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return _&&(a.fields=_),i["Content-Type"]="application/json",t.query=ae.__assign(ae.__assign(ae.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=ae.__assign(ae.__assign(ae.__assign({},i),o),h.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:se.format(t),options:r}]}})})}}}function cr(l){return{deleteVariable:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ur(l).deleteVariable(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteVariables:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ur(l).deleteVariables(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},listVariables:function(t,r,i,a,s,o,u,c){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ur(l).listVariables(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},mergeVariables:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ur(l).mergeVariables(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},resetVariables:function(t,r,i,a){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ur(l).resetVariables(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateVariable:function(t,r,i,a,s){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ur(l).updateVariable(t,r,i,a,s)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateVariable2:function(t,r,i,a,s){return ae.__awaiter(this,void 0,void 0,function(){var n;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,ur(l).updateVariable2(t,r,i,a,s)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=Z),void 0===t&&(t=ee);t=ae.__assign(ae.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}lr=e,ae.__extends(_r,lr),_r.prototype.deleteVariable=function(e,t,n,r){var i=this;return cr(this.configuration).deleteVariable(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},_r.prototype.deleteVariables=function(e,t,n,r){var i=this;return cr(this.configuration).deleteVariables(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},_r.prototype.listVariables=function(e,t,n,r,i,a,s,o){var u=this;return cr(this.configuration).listVariables(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},_r.prototype.mergeVariables=function(e,t,n,r){var i=this;return cr(this.configuration).mergeVariables(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},_r.prototype.resetVariables=function(e,t,n,r){var i=this;return cr(this.configuration).resetVariables(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},_r.prototype.updateVariable=function(e,t,n,r,i){var a=this;return cr(this.configuration).updateVariable(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},_r.prototype.updateVariable2=function(e,t,n,r,i){var a=this;return cr(this.configuration).updateVariable2(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})};var lr,dr=_r;function _r(){return null!==lr&&lr.apply(this,arguments)||this}function hr(e){this.apiKey=(e=void 0===e?{}:e).apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions}(K=g.EngineAuditQuestionType||(g.EngineAuditQuestionType={})).Default="question_default",K.Score="question_score",K.Option="question_option",(K=g.EngineBoolFilter||(g.EngineBoolFilter={})).Undefined="undefined",K.True="true",K.False="false",(K=g.EngineCommunicationChannels||(g.EngineCommunicationChannels={})).Undefined="Undefined",K.Phone="Phone",K.Email="Email",K.Messaging="Messaging",(K=g.EnginePresetQuerySection||(g.EnginePresetQuerySection={})).Default="section_default",K.Calls="section_calls",(K=g.EngineRoutingSchemaType||(g.EngineRoutingSchemaType={})).Default="default",K.Voice="voice",K.Chat="chat",K.Processing="processing",K.Service="service",(K=g.EngineTriggerJobState||(g.EngineTriggerJobState={})).Idle="idle",K.Active="active",K.Done="done",K.Error="error",(K=g.EngineTriggerType||(g.EngineTriggerType={})).DefaultTriggerType="default_trigger_type",K.Cron="cron",(g.GoogleProtobufNullValue||(g.GoogleProtobufNullValue={})).NULLVALUE="NULL_VALUE",(K=g.HistoryFileJobHistoryFileJobAction||(g.HistoryFileJobHistoryFileJobAction={})).Undefined="undefined",K.STT="STT",K.Delete="delete",(K=g.HistoryFileJobHistoryFileJobState||(g.HistoryFileJobHistoryFileJobState={})).Idle="idle",K.Active="active",K.Finished="finished",K.Error="error",(K=g.LoggerAction||(g.LoggerAction={})).DefaultNoAction="default_no_action",K.Create="create",K.Update="update",K.Read="read",K.Delete="delete",(g.ProtobufNullValue||(g.ProtobufNullValue={})).NULLVALUE="NULL_VALUE",(K=g.StorageImportSourceType||(g.StorageImportSourceType={})).DefaultSourceType="DefaultSourceType",K.Dialer="Dialer",(K=g.StorageProviderType||(g.StorageProviderType={})).DefaultProvider="DefaultProvider",K.Microsoft="Microsoft",K.Google="Google",(K=g.StorageServiceType||(g.StorageServiceType={})).DefaultService="DefaultService",K.STT="STT",K.TTS="TTS",(K=g.StorageUploadStatusCode||(g.StorageUploadStatusCode={})).Unknown="Unknown",K.Ok="Ok",K.Failed="Failed",(K=g.WebitelContactsAccessMode||(g.WebitelContactsAccessMode={})).READ="READ",K.WRITE="WRITE",K.DELETE="DELETE",fr.prototype.debug=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("debug",e,t)},fr.prototype.info=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("info",e,t)},fr.prototype.warn=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("warn",e,t)},fr.prototype.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("error",e,t)},fr.prototype.emitLogMessage=function(e,t,n){0<n.length?console[e].apply(console,ae.__spreadArrays([t],n)):console[e](t)};var pr=fr;function fr(){}Object.defineProperty(vr.prototype,"id",{get:function(){return this.session.id},enumerable:!1,configurable:!0}),vr.prototype.getLocalMedia=function(){if(this.session.connection){var e=this.session.connection.getLocalStreams();if(e.length)return e}return[]},vr.prototype.getPeerMedia=function(){if(this.session.connection){var e=this.session.connection.getRemoteStreams();if(e.length)return e}return[]},vr.prototype.answer=function(e){var t=this;return new Promise(function(){t.session.answer(e)})};var gr=vr;function vr(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")}yr=T.EventEmitter,ae.__extends(a,yr),a.prototype.callOption=function(n){return void 0===n&&(n={}),ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.getUserCallStream(n)];case 1:return t=e.sent(),[2,{sessionTimersExpires:120,pcConfig:n.disableStun?void 0:{iceServers:[{urls:["stun:stun.l.google.com:19302"]}]},mediaStream:t}]}})})},a.prototype.answer=function(r,i){return ae.__awaiter(this,void 0,void 0,function(){var t,n;return ae.__generator(this,function(e){switch(e.label){case 0:return this.sessionCache.has(r)?(t=this.sessionCache.get(r),[4,this.callOption(i)]):[3,2];case 1:return n=e.sent(),[2,t.answer(n)];case 2:return[2,!1]}})})},a.prototype.call=function(r){return ae.__awaiter(this,void 0,void 0,function(){var t,n;return ae.__generator(this,function(e){switch(e.label){case 0:if(n={},t=null,r.params&&(n.audio=r.params.audio,n.video=r.params.video||!1,n.screen=r.params.screen||!1,n.disableStun=r.params.disableStun||!1),"string"!=typeof r.destination)throw new Error("bad destination type");return[4,this.callOption(n)];case 1:return n=e.sent(),r.params&&r.params.display&&(t={extraHeaders:["X-Webitel-Display: "+r.params.display]}),[4,this.ua.call(r.destination,ae.__assign(ae.__assign({},n),t))];case 2:return e.sent(),[2]}})})},a.prototype.register=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t,i=this;return ae.__generator(this,function(e){return t=new I.WebSocketInterface(n.server),t={realm:n.realm,uri:n.uri,authorization_user:n.authorization_user,ha1:n.ha1,user_agent:a.userAgent,sockets:[t],session_timers:!0,display_name:n.display_name,register_expires:n.register_expires||90,connection_recovery_min_interval:5,connection_recovery_max_interval:60},(t=this.ua=new I.UA(t)).on("newRTCSession",function(e){var t=e.session,n=t.id,r=new gr(e);i.storeSession(n,r),t.on("connecting",function(){i.emit("localStreams",r,t.connection.getLocalStreams())}),t.connection&&t.connection.addEventListener("addstream",function(e){i.emit("peerStreams",r,new Array(e.stream))}),t.on("peerconnection",function(e){e.peerconnection.addEventListener("addstream",function(t){return ae.__awaiter(i,void 0,void 0,function(){return ae.__generator(this,function(e){return this.emit("peerStreams",r,new Array(t.stream)),[2]})})})}),t.on("ended",function(){i.removeSession(n,t.connection)}),t.on("failed",function(){i.removeSession(n,t.connection)}),t.on("accepted",function(){r.incoming||i.emit("peerStreams",r,t.connection.getRemoteStreams())}),t.on("confirmed",function(){}),i.emit("newSession",r)}),t.on("disconnected",function(e){i.emit("unregistered")}),t.on("unregistered",function(e){i.emit("unregistered")}),t.on("registrationFailed",function(e){i.log.error("registrationFailed",e)}),t.on("registered",function(e){i.emit("registered")}),t.start(),[2]})})},a.prototype.unregister=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){switch(e.label){case 0:return this.ua?(this.ua.terminateSessions(),this.ua.removeAllListeners(),[4,this.ua.stop()]):[3,2];case 1:e.sent(),delete this.ua,e.label=2;case 2:return[2]}})})},a.prototype.isRegistered=function(){return!!this.ua&&this.ua.isRegistered()},a.prototype.sipSessionByCallId=function(e){for(var t=0,n=this.allSession;t<n.length;t++){var r=n[t];if(r.callId===e)return r}return null},a.prototype.sipSessionBySipId=function(e){for(var t=0,n=this.allSession;t<n.length;t++){var r=n[t];if(r.id.startsWith(e))return r}return null},a.prototype.removeSession=function(e,t){var n;return t&&(n=t.getLocalStreams(),t=t.getRemoteStreams(),n&&n.forEach(function(e){e.getTracks().forEach(function(e){e.stop()})}),t)&&t.forEach(function(e){e.getTracks().forEach(function(e){e.stop()})}),!!this.sessionCache.has(e)&&(this.sessionCache.delete(e),!0)},a.prototype.storeSession=function(e,t){if(this.sessionCache.has(e))throw new Error("Session already store");this.sessionCache.set(e,t)},Object.defineProperty(a.prototype,"allSession",{get:function(){return Array.from(this.sessionCache.values())},enumerable:!1,configurable:!0}),a.prototype.getMediaConstraints=function(e){return e.screen?{video:!1,audio:!1,screen:!0}:{video:e.video||!1,audio:!0}},a.prototype.getSession=function(e){return this.sessionCache.has(e)?this.sessionCache.get(e):null},a.prototype.hasSession=function(e){return this.sessionCache.has(e)},a.prototype.getUserScreen=function(){return ae.__awaiter(this,void 0,void 0,function(){var t=this;return ae.__generator(this,function(e){return[2,new Promise(function(n,r){return ae.__awaiter(t,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,navigator.mediaDevices.getDisplayMedia()];case 1:return t=e.sent(),n(t),[3,3];case 2:return t=e.sent(),r(t),[3,3];case 3:return[2]}})})})]})})},a.prototype.getUserCallStream=function(r){return ae.__awaiter(this,void 0,void 0,function(){var t,n;return ae.__generator(this,function(e){switch(e.label){case 0:return!0!==r.screen?[3,2]:[4,this.getUserScreen()];case 1:t=e.sent(),e.label=2;case 2:return!1!==r.audio||r.video?[4,this.getUserMedia(r.audio,r.video)]:[3,4];case 3:n=e.sent(),t?n.getTracks().forEach(function(e){t.addTrack(e)}):t=n,e.label=4;case 4:if(t)return[2,t];throw new Error("bad stream request")}})})},a.prototype.getUserMedia=function(i,a){return ae.__awaiter(this,void 0,void 0,function(){var t=this;return ae.__generator(this,function(e){return[2,new Promise(function(n,r){return ae.__awaiter(t,void 0,void 0,function(){var t;return ae.__generator(this,function(e){return t={audio:!(!1===i),video:void 0},a&&(t.video={width:{min:10,ideal:1280,max:1920},height:{min:10,ideal:720,max:1080},frameRate:{ideal:10,max:15}}),[2,function(r){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,new Promise(function(t,n){navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia(r).then(function(e){return t(e)}).catch(function(e){return n(e)}):(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)(r,function(e){return t(e)},function(e){return n(e)})})]})})}(t).then(n).catch(r)]})})})]})})},a.userAgent="Webitel-Phone/"+I.version,a.sipVersion=I.version;var yr,br=a;function a(e,t){var n=yr.call(this)||this;return n.instanceId=e,n.type="webrtc",n.sessionCache=new Map,n.log=new pr,t?(n.log.info("JsSip version: "+I.version),I.debug.enable("*")):I.debug.disable(),n.on("unregistered",function(){n.sessionCache.clear()}),n}(K=g.TypeErrors||(g.TypeErrors={})).RolePermission="api.context.permissions.app_error",K.LicencePermission="api.context.permissions.license",K.PauseNotAllow="app.agent.set_pause.not_allow",wr=Error,ae.__extends(qr,wr),qr.id="device_not_found";var wr,mr=qr;function qr(e){e=wr.call(this,e)||this;return e.id=qr.id,e}Ar=Error,ae.__extends(Rr,Ar),Rr.id="device_not_allow";var Ar,Cr=Rr;function Rr(e){e=Ar.call(this,e)||this;return e.id=Rr.id,e}Sr=Error,ae.__extends(Pr,Sr),Pr.id=g.TypeErrors.RolePermission;var Sr,Kr=Pr;function Pr(e){e=Sr.call(this,e)||this;return e.id=Pr.id,e}Tr=Error,ae.__extends(Ir,Tr),Ir.id=g.TypeErrors.LicencePermission;var Tr,Or=Ir;function Ir(e){e=Tr.call(this,e)||this;return e.id=Ir.id,e}kr=Error,ae.__extends(Xr,kr),Xr.id=g.TypeErrors.PauseNotAllow;var kr,Wr,Er=Xr;function Xr(e){e=kr.call(this,e)||this;return e.id=Xr.id,e}(K=g.JobState||(g.JobState={})).Distribute="distribute",K.Offering="offering",K.Bridged="bridged",K.Missed="missed",K.Processing="processing",K.Closed="closed",K.Destroy="destroy",(K=Wr=Wr||{}).Call="call",K.Chat="chat",K.Task="task";Object.defineProperty(s.prototype,"queue",{get:function(){return{id:this.distribute.queue_id,name:this.distribute.queue_name}},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"duration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"hasForm",{get:function(){return this.distribute.has_form||!1},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"channel",{get:function(){return this.distribute.channel},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"allowAccept",{get:function(){return this.channel===Wr.Task&&0===this.bridgedAt&&0===this.closedAt},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"allowDecline",{get:function(){return this.allowAccept},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"allowClose",{get:function(){return this.channel===Wr.Task&&0===this.closedAt&&0<this.bridgedAt},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"memberId",{get:function(){return this.distribute.member_id},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"queueId",{get:function(){return this.distribute.queue_id},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"hasReporting",{get:function(){return this.distribute.has_reporting},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"allowReporting",{get:function(){return this.hasReporting&&0<this.bridgedAt},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"agentChannelId",{get:function(){return this.distribute.agent_channel_id},enumerable:!1,configurable:!0}),s.prototype.setState=function(e){this.state=e},s.prototype.setAnswered=function(e){this.answeredAt=e,this.lastStatusChange=Date.now(),this._autoAnswerTimerId&&(clearTimeout(this._autoAnswerTimerId),this._autoAnswerTimerId=null)},s.prototype.setOffering=function(e){var t=this;this.offeringAt=e.timestamp,e.offering.auto_answer&&this.channel===g.ChannelType.Job&&(this._autoAnswerParam=e.offering.auto_answer,this.acceptDelay().catch(function(e){t.client.emit("error",e)}))},s.prototype.setBridged=function(e){this.bridgedAt=e.timestamp,this.lastStatusChange=Date.now(),e.form&&(this.form=e.form),this._autoAnswerTimerId&&(clearTimeout(this._autoAnswerTimerId),this._autoAnswerTimerId=null)},s.prototype.setProcessing=function(e,t){this.state=g.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},s.prototype.setClosed=function(e){this.stopAt=e,this.state=g.JobState.Closed},s.prototype.setTransferred=function(e){this.distribute=e,this.history.push(e)},s.prototype.setMissed=function(){this.state=g.JobState.Missed},Object.defineProperty(s.prototype,"processingTimeoutAt",{get:function(){return this._processing&&this._processing.timeout?this._processing.timeout:null},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"processingSec",{get:function(){return this._processing&&this._processing.sec?this._processing.sec:null},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"attempt",{get:function(){return this},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"variables",{get:function(){var e,t={};for(e in this.distribute.variables)e.startsWith("cc_")||(t[e]=this.distribute.variables[e]);return t},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"isMember",{get:function(){return!!this.memberId},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"displayNumber",{get:function(){return this.communication.destination},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"displayName",{get:function(){return this.distribute.member_name||null},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"display",{get:function(){return this.displayName+" ("+this.displayNumber+")"},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"renewalSec",{get:function(){return this._processing&&this._processing.renewal_sec?this._processing.renewal_sec:null},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"autoAnswer",{get:function(){return 0<this.autoAnswerDelay},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"autoAnswerDelay",{get:function(){return this._autoAnswerParam&&""+this._autoAnswerParam!="false"?isFinite(+this._autoAnswerParam)?+this._autoAnswerParam:this.client.autoAnswerDelayTime:0},enumerable:!1,configurable:!0}),s.prototype.accept=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("cc_agent_task_accept",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})]})})},s.prototype.acceptDelay=function(){return ae.__awaiter(this,void 0,void 0,function(){var t=this;return ae.__generator(this,function(e){return this._autoAnswerTimerId=setTimeout(function(){return ae.__awaiter(t,void 0,void 0,function(){return ae.__generator(this,function(e){switch(e.label){case 0:return this.autoAnswered?[2]:this.answeredAt?[3,2]:(this.autoAnswered=!0,[4,this.accept()]);case 1:e.sent(),e.label=2;case 2:return[2]}})})},this.autoAnswerDelay),[2]})})},s.prototype.close=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("cc_agent_task_close",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})]})})},s.prototype.decline=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("cc_agent_task_close",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})]})})},s.prototype.reporting=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.request("cc_reporting",ae.__assign({attempt_id:this.id},n))];case 1:return t=e.sent(),this.reportedAt=Date.now(),[2,t]}})})},s.prototype.renew=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("cc_renewal",{attempt_id:this.id,renewal_sec:t||this.processingSec})]})})},s.prototype.formAction=function(s,o){return ae.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a;return ae.__generator(this,function(e){if(!this.form)throw new Error("not found active form");for(t={},n=0,r=Object.entries(o);n<r.length;n++)a=r[n],i=a[0],a=a[1],t[i]="object"==typeof a?JSON.stringify(a):a;return[2,this.client.request("cc_form_action",{attempt_id:this.id,app_id:this.distribute.app_id,action:s,fields:t})]})})};var xr=s;function s(e,t,n){this.client=e,this.distribute=n,this.id=t.attempt_id,this.state=g.JobState.Offering,this.setState(t.status),this.lastStatusChange=t.timestamp,this.createdAt=t.timestamp,this._processing=null,this.offeringAt=0,this.answeredAt=0,this.bridgedAt=0,this.reportedAt=0,this.startProcessingAt=0,this.stopAt=0,this.closedAt=0,this.form=null,this.autoAnswered=!1,this._autoAnswerParam=!1,this._autoAnswerTimerId=null,this.communication=n.communication,this.history=[n]}(K=g.AgentStatus||(g.AgentStatus={})).Online="online",K.Offline="offline",K.Pause="pause",K.BreakOut="break_out",(K=g.ChannelState||(g.ChannelState={})).Waiting="waiting",K.Distribute="distribute",K.Offering="offering",K.Answered="answered",K.Active="active",K.Bridged="bridged",K.Hold="hold",K.Missed="missed",K.WrapTime="wrap_time",K.Processing="processing",K.Transfer="transfer",K.Form="form",(K=g.ChannelType||(g.ChannelType={})).Call="call",K.Email="email",K.Chat="chat",K.Job="task";Object.defineProperty(o.prototype,"agentId",{get:function(){return this.info.agent_id},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"onDemand",{get:function(){return this.info.on_demand},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"status",{get:function(){return this.info.status},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"statusPayload",{get:function(){return this.info.status_payload},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"isAdmin",{get:function(){return this.info.is_admin},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"isSupervisor",{get:function(){return this.info.is_supervisor},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"team",{get:function(){return this.info.team},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"supervisor",{get:function(){return this.info.supervisor},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"auditor",{get:function(){return this.info.auditor},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"channels",{get:function(){return Array.from(this._channels.values())},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"channel",{get:function(){return this._channels.get(g.ChannelType.Call)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"stateDuration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!1,configurable:!0}),o.prototype.setWaitingList=function(e){if(e){e=e.list;this.waitingListCalls.length=0;for(var t=this.waitingListChats.length=0,n=e;t<n.length;t++){var r=n[t];switch(r.channel){case g.ChannelType.Call:this.waitingListCalls.push(r);break;case g.ChannelType.Chat:this.waitingListChats.push(r)}}}},o.prototype.deleteWaitingAttempt=function(e){e&&(e=e.attempt_id,Ur(this.waitingListCalls,e)||Ur(this.waitingListChats,e))},o.prototype.interceptAttempt=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("cc_intercept_attempt",{attempt_id:t,agent_id:this.agentId})]})})},o.prototype.onChannelEvent=function(e){switch(e.status){case g.ChannelState.Distribute:var t=e;if(!t)throw new Error("bad event");if(r=new xr(this.client,e,t.distribute),this.task.set(r.id,r),r.agentChannelId)switch(r.channel){case g.ChannelType.Call:var n=this.client.callById(r.agentChannelId);n&&!n.task&&(n.task=r);break;case g.ChannelType.Chat:n=this.client.conversationById(r.agentChannelId);n&&!n.task&&(n.task=r)}break;case g.ChannelState.Offering:var r,t=e;(r=this.task.get(e.attempt_id))&&r.setOffering(t);break;case g.ChannelState.Bridged:t=e;(r=this.task.get(t.attempt_id))&&r.setBridged(t);break;case g.ChannelState.Transfer:t=e;(r=this.task.get(t.to_attempt_id))&&(this.task.delete(r.id),r.id=t.attempt_id,r.setTransferred(t.distribute),this.task.set(r.id,r));break;case g.ChannelState.Answered:(r=this.task.get(e.attempt_id))&&(r.answeredAt=e.timestamp);break;case g.ChannelState.Form:t=e;return void((r=this.task.get(e.attempt_id))&&(r.form=t.form||null));case g.ChannelState.Missed:if(e.attempt_id&&(r=this.task.get(e.attempt_id))){r.stopAt=e.timestamp;t=e;if(t)return r.setMissed(),this.setChannelStateTimeout(e,t.missed.timeout),this.task.delete(e.attempt_id),this.client.reportingChannelTask(r),r;throw new Error("bad event")}break;case g.ChannelState.WrapTime:if(e.attempt_id){if(!e)throw new Error("bad event");r=this.task.get(e.attempt_id),this.task.delete(e.attempt_id),this.client.reportingChannelTask(r)}break;case g.ChannelState.Processing:if(e.attempt_id){t=e;if(!t)throw new Error("bad event");if(r=this.task.get(e.attempt_id))return r.setProcessing(e.timestamp,t.processing),this.setChannelStateTimeout(e,t.processing.timeout||0),r}break;case g.ChannelState.Waiting:e.attempt_id&&(r=this.task.get(e.attempt_id))&&(r.setClosed(e.timestamp),this.task.delete(e.attempt_id),this.client.reportingChannelTask(r))}if(this.setChannelState(e),r)return r.setState(e.status),r},o.prototype.online=function(t,n){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.agentSetOnline(this.agentId,t,n)]})})},o.prototype.waiting=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.agentSetWaiting(this.agentId,t)]})})},o.prototype.pause=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.client.agentSetPause(this.agentId,n)];case 1:return[2,e.sent()];case 2:return(t=e.sent()).id===g.TypeErrors.PauseNotAllow?[2,new Er(t.detail)]:[2,t];case 3:return[2]}})})},o.prototype.offline=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.agentSetOffline(this.agentId)]})})},o.prototype.setStatus=function(e){e.status===g.AgentStatus.Online&&(this.info.on_demand=e.on_demand||!1,this.initChannels(e.channels)),this.info.status=e.status,this.info.status_payload=e.status_payload||null,this.lastStatusChange=Date.now()},o.prototype.directMember=function(t,n){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("cc_member_direct",{agent_id:this.agentId,member_id:t,communication_id:n})]})})},o.prototype.offlineMembers=function(n,r,i){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,(t=this).client.request("cc_fetch_offline_members",{agent_id:this.agentId,page:r,q:n,per_page:i})];case 1:return t._listOfflineMembers=e.sent(),[2,this._listOfflineMembers]}})})},o.prototype.hasTask=function(e){return this.task.has(e.id)},o.prototype.initChannels=function(e){for(var t=0,n=e;t<n.length;t++){var r=n[t];this._channels.set(r.channel,r)}},o.prototype.getChannel=function(e){return this._channels.get(e)},o.prototype.setChannelState=function(e){var t=this.getChannel(e.channel);t&&(t.state=e.status,t.joined_at=e.timestamp,t.timeout=void 0)},o.prototype.setChannelStateTimeout=function(e,t){var n=this.getChannel(e.channel);n&&(n.state=e.status,n.timeout=t,n.joined_at=e.timestamp)};var jr=o;function o(e,t){this.client=e,this.info=t,this.task=new Map,this._channels=new Map,this.initChannels(t.channels),this._listOfflineMembers=null,this.waitingListChats=[],this.waitingListCalls=[],this.lastStatusChange=Date.now()-1e3*this.info.status_duration}function Ur(e,t){for(var n=0;n<e.length;n++)if(e[n].attempt_id===t)return e.splice(n,1),1}(K=g.CallReportingStatus||(g.CallReportingStatus={})).Abandoned="abandoned",K.Cancel="cancel",K.Success="success",K.Failed="failed",K.Missed="missed",K.Timeout="timeout",K.Endless="endless",K.Transferred="transferred",(K=g.EavesdropState||(g.EavesdropState={})).Muted="muted",K.Conference="conference",K.Prompt="prompt",(K=g.EavesdropType||(g.EavesdropType={})).Joined="joined",K.Leave="leave",K.Hide="hide",(K=g.CallActions||(g.CallActions={})).Ringing="ringing",K.Active="active",K.Bridge="bridge",K.Hold="hold",K.DTMF="dtmf",K.Voice="voice",K.Silence="silence",K.Execute="execute",K.Update="update",K.Hangup="hangup",K.Reporting="reporting",K.PeerStream="peerStream",K.LocalStream="localStream",K.Destroy="destroy",K.Eavesdrop="eavesdrop",(K=g.CallDirection||(g.CallDirection={})).Inbound="inbound",K.Outbound="outbound";u.prototype.setState=function(e){this.state=e.event},u.prototype.setSip=function(e){e&&!this.sip&&(this.sip=e,this.localStreams=e.getLocalMedia(),this.peerStreams=e.getPeerMedia())},Object.defineProperty(u.prototype,"duration",{get:function(){return 0===this.hangupAt?Math.round((Date.now()-this.createdAt)/1e3):Math.round((this.hangupAt-this.createdAt)/1e3)},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"allowDtmf",{get:function(){return 0<this.answeredAt&&this.allowHangup},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"allowHangup",{get:function(){return 0===this.hangupAt},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"allowHold",{get:function(){return 0===this.hangupAt&&("active"===this.state||"bridge"===this.state)},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"allowAnswer",{get:function(){return this.client.phone&&0===this.hangupAt&&0===this.answeredAt&&(this.queue||this.direction===g.CallDirection.Inbound||this.params&&!this.params.autoAnswer)},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"allowUnHold",{get:function(){return 0===this.hangupAt&&"hold"===this.state},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"memberCommunication",{get:function(){return this.task?this.task.communication:null},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"isEavesdrop",{get:function(){return!!this._eavesdrop},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"eavesdropName",{get:function(){return this.isEavesdrop?this._eavesdrop.name:""},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"eavesdropNumber",{get:function(){return this.isEavesdrop?this._eavesdrop.number:""},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"eavesdropDuration",{get:function(){return this.isEavesdrop?this._eavesdrop.duration:0},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"eavesdropState",{get:function(){return this.isEavesdrop?this._eavesdrop.state:null},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"eavesdropIsMuted",{get:function(){return this.eavesdropState===g.EavesdropState.Muted},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"eavesdropIsConference",{get:function(){return this.eavesdropState===g.EavesdropState.Conference},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"eavesdropIsPrompt",{get:function(){return this.eavesdropState===g.EavesdropState.Prompt},enumerable:!1,configurable:!0}),u.prototype.getMember=function(e){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.isMember)return[2,this.client.request("cc_member_page",{queue_id:this.task.queueId,member_id:this.task.memberId})];throw new Error("call is not from outbound queue")})})},Object.defineProperty(u.prototype,"isMember",{get:function(){return!(!this.task||!this.task.isMember)},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"firstActive",{get:function(){return 1===this._activeCounter},enumerable:!1,configurable:!0}),u.prototype.setActive=function(e){this._activeCounter++,this._autoAnswerTimerId&&(clearTimeout(this._autoAnswerTimerId),this._autoAnswerTimerId=null),this.answeredAt||(this.direction===g.CallDirection.Inbound&&(this.bridgedAt=+e.timestamp,this.parentId)&&(this.bridgedId=this.parentId),this.answeredAt=+e.timestamp),this.setState(e)},u.prototype.setBridged=function(e){var t=e.data;this.bridgedAt||(this.bridgedAt=+e.timestamp),this.bridgedId=t.bridged_id,t.to&&(this.direction===g.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)},u.prototype.setHold=function(e){this.setState(e)},u.prototype.setInfo=function(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},u.prototype.setPeerStreams=function(e){this.peerStreams=e||[]},u.prototype.setLocalStreams=function(e){this.localStreams=e||[]},u.prototype.setVoice=function(){this.voice=!0},u.prototype.setSilence=function(){this.voice=!1},u.prototype.setExecute=function(e){this.applications.push(e.application)},u.prototype.addDigit=function(e){this.digits.push(e.digit)},u.prototype.setEavesdropState=function(e){e.type===g.EavesdropType.Joined?this._eavesdrop=e:e.type===g.EavesdropType.Leave?this._eavesdrop=null:this._eavesdrop.state=e.state},u.prototype.setHangup=function(e){var 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)},Object.defineProperty(u.prototype,"allowReporting",{get:function(){return 0<this.answeredAt&&this.hasReporting},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"hasReporting",{get:function(){return!!this.task&&this.task.hasReporting},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"display",{get:function(){return this.displayNumber+" ("+this.displayName+")"},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"muted",{get:function(){return this._muted},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"isHold",{get:function(){return this.state===g.CallActions.Hold},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"allowInboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"allowOutboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"active",{get:function(){return 0===this.hangupAt},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"displayNumber",{get:function(){return"inbound"===this.direction?this.from.number:this.to?this.to.number:this.destination},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"displayName",{get:function(){return"inbound"===this.direction?this.from.name:this.to?this.to.name:this.destination},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"autoAnswer",{get:function(){return this.queue&&"offline"===this.queue.queue_type||0<this.autoAnswerDelay},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"autoAnswerDelay",{get:function(){return this.params&&this.params.autoAnswer&&""+this.params.autoAnswer!="false"?isFinite(+this.params.autoAnswer)?+this.params.autoAnswer:this.client.autoAnswerDelayTime:0},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"attempt",{get:function(){return this.task},enumerable:!1,configurable:!0}),u.prototype.answer=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:if(!this.sip||!this.client.phone)return[3,6];e.label=1;case 1:return e.trys.push([1,4,,5]),[4,this.client.phone.callOption(n)];case 2:return t=e.sent(),[4,this.sip.answer(t)];case 3:return e.sent(),[3,5];case 4:return t=e.sent(),this.client.handleError(t),[3,5];case 5:return[2,!0];case 6:return[2,!1]}})})},u.prototype.answerDelay=function(n){var e=this;this.autoAnswered||(this._autoAnswerTimerId=setTimeout(function(){return ae.__awaiter(e,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return this.autoAnswered?[2]:[4,(t=this).answer(n)];case 1:return t.autoAnswered=e.sent(),[2]}})})},this.autoAnswerDelay))},u.prototype.hangup=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){return t=n,0!==this.answeredAt||n||(t=this.direction===g.CallDirection.Inbound?"USER_BUSY":"ORIGINATOR_CANCEL"),[2,this.client.request("call_hangup",{id:this.id,app_id:this.appId,cause:t})]})})},u.prototype.eavesdrop=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return t.id=this.id,[2,this.client.request("call_eavesdrop",t)]})})},u.prototype.changeEavesdropState=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(!this.isEavesdrop)throw new Error("this call not in eavesdrop");if(this.eavesdropState===t)throw new Error("this call already eavesdrop state: "+t);return[2,this.client.request("call_eavesdrop_state",{id:this.id,state:t})]})})},u.prototype.toggleHold=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return this.state===g.CallActions.Hold?[2,this.unHold()]:[2,this.hold()]})})},u.prototype.hold=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.state===g.CallActions.Hold)throw new Error("Call is hold");return[2,this.client.request("call_hold",{id:this.id,app_id:this.appId})]})})},u.prototype.unHold=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.state!==g.CallActions.Hold)throw new Error("Call is active");return[2,this.client.request("call_unhold",{id:this.id,app_id:this.appId})]})})},u.prototype.sendDTMF=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("call_dtmf",{id:this.id,app_id:this.appId,dtmf:t})]})})},u.prototype.blindTransfer=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("call_blind_transfer",{id:this.id,app_id:this.appId,destination:t})]})})},u.prototype.mute=function(n){return void 0===n&&(n=!1),ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.request("call_mute",{id:this.id,app_id:this.appId,mute:n})];case 1:return t=e.sent(),this._muted=n,[2,t]}})})},u.prototype.bridgeTo=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("call_bridge",{from_id:this.id,from_app_id:this.appId,to_id:t.id,to_app_id:t.appId})]})})},u.prototype.reporting=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.task)return[2,this.task.reporting(t)];throw new Error("this call not in queue")})})},u.prototype.renew=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.task)return[2,this.task.renew(t)];throw new Error("this conversation not in queue")})})},u.prototype.callToUser=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return t.nodeId=this.appId,t.parentCallId=this.id||null,t.sendToCallId=this.parentId||null,[2,this.client.inviteToUser(t)]})})};var Qr=u;function u(e,t){this.client=e;var n=t.data;this._muted=!1,this.voice=!0,this.createdAt=+t.timestamp,this.task=null,this.data=null,this._eavesdrop=null,this._autoAnswerTimerId=null,this._activeCounter=0,this.answeredAt=0,this.hangupAt=0,this.bridgedAt=0,this.reportingAt=0,this.autoAnswered=!1,this.peerStreams=[],this.localStreams=[],n.eavesdrop&&(this._eavesdrop=n.eavesdrop),e.phone&&(n.sip_id?this.setSip(e.phone.sipSessionBySipId(n.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(n),this.queue&&this.client.agent&&(this.task=this.client.agent.task.get(+this.queue.attempt_id)||null)}(K=g.DeclineCause||(g.DeclineCause={})).Timeout="TIMEOUT",K.Busy="BUSY",K.Cancel="CANCEL",K.Transfer="TRANSFER",(K=g.ChatActions||(g.ChatActions={})).Message="message",K.UserInvite="user_invite",K.Invite="invite_conversation",K.Joined="join_conversation",K.Close="close_conversation",K.Leave="leave_conversation",K.Decline="decline_invite",K.Update="update_channel",K.Destroy="destroy",K.MessageDeleted="message_deleted",(K=g.ConversationState||(g.ConversationState={})).Init="init",K.Invite="invite",K.Active="active",K.Pending="pending",K.Closed="closed",q.prototype.setInvite=function(e,t){var n=this;this.inviteId=e,this.invitedAt=t,this.autoAnswer&&this.joinDelay().catch(function(e){n.client.emit("error",e)})},Object.defineProperty(q.prototype,"autoAnswer",{get:function(){return 0<this.autoAnswerDelay},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"autoAnswerDelay",{get:function(){return this._autoAnswerParam&&""+this._autoAnswerParam!="false"?isFinite(+this._autoAnswerParam)?+this._autoAnswerParam:this.client.autoAnswerDelayTime:0},enumerable:!1,configurable:!0}),q.prototype.setAnswered=function(e,t,n){this.state=g.ConversationState.Active,this.answeredAt=t,this.channelId=e,this._autoAnswerTimerId&&(clearTimeout(this._autoAnswerTimerId),this._autoAnswerTimerId=null),this.member=Fr(n),this.inviteId=null},q.prototype.setClosed=function(e){this.state=g.ConversationState.Closed,this.closedAt=e},q.prototype.setDecline=function(e){this.setClosed(e.timestamp),this._cause=e.cause||null},q.prototype.setLeave=function(e){e.cause&&(this._cause=e.cause),this.setClosed(e.timestamp)},q.prototype.setDeletedMessage=function(e){for(var t=this._messages,n=0;n<t.length;n++)t[n].id===e.id&&(e.created_at=t[n].created_at,t.splice(n,1,e))},Object.defineProperty(q.prototype,"id",{get:function(){return this.channelId||this.inviteId||this.conversationId},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"cause",{get:function(){return this._cause},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"messages",{get:function(){return this.getMessages()},enumerable:!1,configurable:!0}),q.prototype.getMessages=function(){var n=this;return this._messages.map(function(e){var t={id:e.id,type:e.type,member:n.messageMember(e),channelId:e.channel_id,createdAt:e.created_at,updatedAt:e.updated_at,contact:null};return e.hasOwnProperty("file")&&(e.file&&0<e.file.id&&(e.file.url=n.client.fileUrlDownload(e.file.id),e.file.streamUrl=n.client.fileUrlStream(e.file.id)),t.file=e.file),e.hasOwnProperty("text")&&(t.text=e.text),e.hasOwnProperty("contact")&&(t.contact=e.contact),t})},q.prototype.next=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){throw new Error("TODO")})})},q.prototype.pagination=function(e,t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){throw new Error("TODO")})})},q.prototype.newMessage=function(e){this._messages.push(e)},Object.defineProperty(q.prototype,"allowDecline",{get:function(){return!!this.inviteId},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"allowJoin",{get:function(){return!!this.inviteId},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"allowLeave",{get:function(){return!(!this.channelId||0!==this.closedAt&&this.hasReporting)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"allowReporting",{get:function(){return 0<this.answeredAt&&this.hasReporting},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"hasReporting",{get:function(){return this._hasReporting},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"membersId",{get:function(){for(var e=[this.id],t=0,n=this.members;t<n.length;t++){var r=n[t];e.push(r.id)}return e},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"attempt",{get:function(){return this.task},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isTransferred",{get:function(){return(this._cause&&this._cause.toUpperCase())===g.DeclineCause.Transfer},enumerable:!1,configurable:!0}),q.prototype.decline=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){if(this.inviteId)return(t=n)||0!==this.answeredAt||(t=g.DeclineCause.Busy),[2,this.client.request("decline_chat",{invite_id:this.inviteId,cause:t})];throw new Error("This conversation is joined")})})},q.prototype.joinDelay=function(){return ae.__awaiter(this,void 0,void 0,function(){var t=this;return ae.__generator(this,function(e){return this.autoAnswered||(this.autoAnswered=!0,this._autoAnswerTimerId=setTimeout(function(){return ae.__awaiter(t,void 0,void 0,function(){return ae.__generator(this,function(e){switch(e.label){case 0:return this.answeredAt?[3,2]:[4,this.join()];case 1:e.sent(),e.label=2;case 2:return[2]}})})},this.autoAnswerDelay)),[2]})})},q.prototype.join=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.inviteId)return[2,this.client.request("join_chat",{invite_id:this.inviteId})];throw new Error("This conversation is joined")})})},q.prototype.close=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.channelId)return[2,this.client.request("close_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:t})];throw new Error("This conversation not active")})})},q.prototype.leave=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.channelId)return 0===this.closedAt||this.hasReporting||this.cause===g.DeclineCause.Busy?[2,this.client.request("leave_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:t})]:[2,this.client.destroyConversation(this)];throw new Error("This conversation not active")})})},q.prototype.sendText=function(r){return ae.__awaiter(this,void 0,void 0,function(){var t,n;return ae.__generator(this,function(e){switch(e.label){case 0:if(!this.channelId)throw new Error("conversation not active");if(!r.length)throw new Error("empty message");t=function(e,t){for(var n=Math.ceil(e.length/t),r=new Array(n),i=0,a=0;a<n;a++)r[a]=e.substring(i,i+t),i+=t;return r}(r,4096),n=0,e.label=1;case 1:return n<t.length?n+1>=t.length?[2,this.sendMessageTextChunk(t[n])]:[4,this.sendMessageTextChunk(t[n])]:[3,4];case 2:e.sent(),e.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},q.prototype.sendFile=function(n,r){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.storeFile(this.conversationId,[n],r)];case 1:return t=e.sent(),t=t[0],[2,this.client.request("send_file_chat",{channel_id:this.channelId,conversation_id:this.conversationId,id:t.id,name:n.name,mime:t.mime,url:t.shared,size:t.size})]}})})},q.prototype.send=function(t,n){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if("string"==typeof t)return[2,this.sendText(t)];if(t instanceof File)return[2,this.sendFile(t,n)];throw new Error("unknown send data")})})},q.prototype.addToChat=function(t,n){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("add_to_chat",{channel_id:this.channelId,conversation_id:this.conversationId,user_id:t,title:n})]})})},q.prototype.startChat=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("start_chat",{user_id:t})]})})},q.prototype.updateChannel=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("update_channel_chat",{channel_id:this.channelId})]})})},q.prototype.reporting=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.task)return[2,this.task.reporting(t)];throw new Error("this conversation not in queue")})})},q.prototype.renew=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){if(this.task)return[2,this.task.renew(t)];throw new Error("this conversation not in queue")})})},q.prototype.transferToPlan=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("blind_transfer_chat",{conversation_id:this.conversationId,channel_id:this.channelId,plan_id:t})]})})},q.prototype.transferToUser=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.client.request("transfer_user_chat",{conversation_id:this.conversationId,channel_id:this.channelId,user_id:t})]})})},q.prototype.sendMessageTextChunk=function(e){return this.client.request("send_text_chat",{channel_id:this.channelId,conversation_id:this.conversationId,text:e})},q.prototype.messageMember=function(e){if(this.member&&e.channel_id===this.channelId)return{self:!0};for(var t=0,n=this.members;t<n.length;t++){var r=n[t];if(r.id===e.channel_id)return r}return null};var Mr,Lr=q;function q(e,t,n,r,i,a){for(var s in this.client=e,this.conversationId=t,this.title=n,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=(r||[]).map(Fr),this._messages=i||[],this.state=g.ConversationState.Invite,this.variables={},this._hasReporting=!(!a||"true"!==a.cc_reporting),this.autoAnswered=!1,this._autoAnswerParam=!1,this._autoAnswerTimerId=null,this._cause=null,this.lastAction=null,a)!s.startsWith("cc_")&&a.hasOwnProperty(s)&&("wbt_auto_answer"===s?this._autoAnswerParam=a.wbt_auto_answer:this.variables[s]=a[s]);a&&a.hasOwnProperty("cc_attempt_id")&&this.client.agent&&(this.queue={id:+a.cc_queue_id||null,name:a.cc_queue_name||""},this.task=this.client.agent.task.get(+a.cc_attempt_id)||null)}function Fr(e){return e.messenger=e.type,e}(K=Mr=Mr||{}).HideMember="hide_member",K.HideAttempt="hide_attempt",K.WaitingList="waiting_list";Gr=T.EventEmitter,ae.__extends(Dr,Gr),Dr.prototype.connect=function(e){var t=this;this.socket=new WebSocket(this.host.replace(/^http/,"ws")+"/websocket"),this.socket.onclose=function(e){return t.onClose(e.code)},this.socket.onmessage=function(e){return t.onMessage(e.data)},this.socket.onopen=function(){return t.onOpen()}},Dr.prototype.send=function(e){return this.socket.send(JSON.stringify(e)),null},Dr.prototype.close=function(e){this.socket.close(e||1e3),delete this.socket,this.onClose(e||1e3)},Dr.prototype.onOpen=function(){this.emit("open")},Dr.prototype.onClose=function(e){this.emit("close",e),this.off("*")},Dr.prototype.onMessage=function(e){"\0\0\0\0"!==e&&(e=JSON.parse(e),this.emit("message",e))};var Gr,Br=Dr;function Dr(e){var t=Gr.call(this)||this;return t.host=e,t}var Hr,Nr,Jr="call",Vr="chat",zr="user_state",$r="agent_status",K=((K=Hr=Hr||{}).NotFoundError="NotFoundError",K.NotAllowedError="NotAllowedError",(K=g.Response||(g.Response={})).STATUS_FAIL="FAIL",K.STATUS_OK="OK",Nr=T.EventEmitter,ae.__extends(P,Nr),P.prototype.connect=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.connectToSocket()];case 1:return e.sent(),[2]}})})},P.prototype.disconnect=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return this.socket.close(),[2]})})},P.prototype.subscribeCall=function(s,o){return ae.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("subscribe_call",o)];case 1:if(t=e.sent(),this.eventHandler.on(Jr,s),t.items&&t.items.length)for(n=0,r=t.items;n<r.length;n++)(i=r[n]).hangup_at&&0<i.hangup_at&&!i.task||(a={cc_app_id:"",app_id:i.app_id,event:i.state,id:i.id,timestamp:Date.now(),data:{app_id:i.app_id,event:i.state,id:i.id,timestamp:Date.now(),cc_app_id:"",sip_id:"",parent_id:i.parent_id,direction:i.direction,destination:i.destination,queue:i.queue,from:i.from,to:i.to,payload:i.variables}},(a=new Qr(this,a)).createdAt=i.created_at,a.answeredAt=i.answered_at||0,a.bridgedAt=i.bridged_at||0,a.hangupAt=i.hangup_at||0,i.task&&(a.task=new xr(this,{attempt_id:i.task.attempt_id,channel:i.task.channel,status:i.task.status,timestamp:Date.now()},i.task),a.queue.reporting="true",a.task.form=i.task.form||null,i.leaving_at)&&i.task.processing_sec&&(a.task.startProcessingAt=i.leaving_at,a.task.setProcessing(i.leaving_at,{sec:i.task.processing_sec||0,timeout:i.task.processing_timeout_at||null,renewal_sec:i.task.processing_renewal_sec||0})),this.callStore.set(a.id,a));return[2,t]}})})},P.prototype.subscribeChat=function(s,o){return ae.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("subscribe_chat",o)];case 1:if(t=e.sent(),this.eventHandler.on(Vr,s),t&&t.items)for(n=0,r=t.items;n<r.length;n++){if(i=r[n],a=i.messages.reverse(),(a=new Lr(this,i.id,i.title,i.members,a,i.variables)).createdAt=i.created_at,a.closedAt=i.closed_at,i.task&&(a.task=new xr(this,{attempt_id:i.task.attempt_id,channel:i.task.channel,status:i.task.status,timestamp:Date.now()},i.task),i.leaving_at&&i.task.processing_sec&&(a.task.startProcessingAt=i.leaving_at,a.task.setProcessing(i.leaving_at,{sec:i.task.processing_sec||0,timeout:i.task.processing_timeout_at||null,renewal_sec:i.task.processing_renewal_sec||0})),a.task.form=i.task.form||null),i.invite_id)a.setInvite(i.invite_id,i.created_at);else{if(!i.channel_id){this.log.error("conversation "+i.id+" not valid");continue}a.setAnswered(i.channel_id,i.joined_at,{id:i.channel_id,name:"TODO",type:"webitel"})}this.conversationStore.set(a.id,a)}return[2,t]}})})},P.prototype.subscribeUsersStatus=function(n,r){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("subscribe_users_status",r)];case 1:return t=e.sent(),this.eventHandler.on(zr,n),[2,t]}})})},P.prototype.subscribeAgentsStatus=function(n,r){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("cc_agent_subscribe_status",r)];case 1:return t=e.sent(),this.eventHandler.on($r,n),[2,t]}})})},P.prototype.subscribeTask=function(e){this.eventHandler.on("task",e)},P.prototype.subscribeJob=function(e){this.eventHandler.on("job",e)},P.prototype.unSubscribe=function(t,e,n){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("un_subscribe_"+t,n)]})})},P.prototype.destroy=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){switch(e.label){case 0:return[4,this.disconnect()];case 1:return(e.sent(),this.phone)?[4,this.phone.unregister()]:[3,3];case 2:e.sent(),this.phone.off("*"),delete this.phone,e.label=3;case 3:return this.eventHandler.off("*"),[2]}})})},P.prototype.allCall=function(){return Array.from(this.callStore.values())},P.prototype.allConversations=function(){return Array.from(this.conversationStore.values())},P.prototype.allTask=function(){return this.agent?Array.from(this.agent.task.values()):[]},P.prototype.allJob=function(){return this.allTask().filter(Yr)},P.prototype.callById=function(e){if(this.callStore.has(e))return this.callStore.get(e)},P.prototype.conversationById=function(e){if(this.conversationStore.has(e))return this.conversationStore.get(e)},P.prototype.callBySipId=function(e){for(var t=0,n=this.allCall();t<n.length;t++){var r=n[t];if(r.sipId&&e.startsWith(r.sipId))return r}},P.prototype.reportingTask=function(t,n){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("cc_reporting",ae.__assign({attempt_id:t},n))]})})},P.prototype.agentActiveTasks=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("cc_agent_tasks",{agent_id:t})]})})},P.prototype.auth=function(){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,4]),[4,this.request("authentication_challenge",{token:this._config.token})];case 1:return[2,e.sent()];case 2:return t=e.sent(),this.handleError(t),[4,this.disconnect()];case 3:throw e.sent(),t;case 4:return[2]}})})},P.prototype.ping=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("ping",{ping:1})]})})},P.prototype.sessionInfo=function(){return this.connectionInfo.session},Object.defineProperty(P.prototype,"version",{get:function(){return this.connectionInfo.server_version},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"buildVersion",{get:function(){return"0.0.2"},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"instanceId",{get:function(){return this.connectionInfo.sock_id},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"autoAnswerDelayTime",{get:function(){return this._config.autoAnswerDelayTime||400},enumerable:!1,configurable:!0}),P.prototype.agentSession=function(){return ae.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l,d;return ae.__generator(this,function(e){switch(e.label){case 0:return this.agent?[2,this.agent]:[4,this.request("cc_agent_session")];case 1:return t=e.sent(),this.agent=new jr(this,t),[4,this.agentActiveTasks(this.agent.agentId)];case 2:for(t=e.sent(),n=0,r=t.items;n<r.length;n++)i=r[n],(a=new xr(this,{status:i.status,timestamp:Date.now(),channel:i.channel,attempt_id:i.attempt_id},i)).postProcessData={},a.setState(i.state),i.bridged_at&&(a.bridgedAt=i.bridged_at,a.answeredAt=i.bridged_at),i.leaving_at&&(a.closedAt=i.leaving_at),i.leaving_at&&i.processing_sec&&(a.startProcessingAt=i.leaving_at,a.setProcessing(i.leaving_at,{sec:i.processing_sec||0,timeout:i.processing_timeout_at||null,renewal_sec:i.processing_renewal_sec||0})),a.form=i.form||null,this.agent.task.set(a.id,a);for(s=0,o=this.allCall();s<o.length;s++)(u=o[s]).task&&this.agent.task.set(u.task.id,u.task);for(c=0,l=this.allConversations();c<l.length;c++)(d=l[c]).task&&this.agent.task.set(d.task.id,d.task);return[2,this.agent]}})})},P.prototype.invite=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("call_invite",t)]})})},P.prototype.call=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:if(!this.phone)return[3,5];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.phone.call(n)];case 2:return e.sent(),[3,4];case 3:return t=e.sent(),this.handleError(t),[3,4];case 4:return[3,7];case 5:return[4,this.invite(n)];case 6:e.sent(),e.label=7;case 7:return[2]}})})},P.prototype.callRecordId=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("call_recordings",{id:t})]})})},P.prototype.eavesdrop=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("call_eavesdrop",t)]})})},P.prototype.agentSetOnline=function(t,n,r){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("cc_agent_online",{agent_id:t,channels:n,on_demand:r})]})})},P.prototype.agentSetWaiting=function(t,n){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("cc_agent_waiting",{agent_id:t,channel:n})]})})},P.prototype.agentSetPause=function(t,n){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("cc_agent_pause",{agent_id:t,payload:n})]})})},P.prototype.agentSetOffline=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("cc_agent_offline",{agent_id:t})]})})},P.prototype.inviteToUser=function(e){return this.request("call_user",e)},P.prototype.answer=function(n,r){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){return(t=this.callById(n))?[2,t.answer(r)]:[2]})})},P.prototype.request=function(n,r){var i=this;return new Promise(function(e,t){i.queueRequest.set(++i.reqSeq,{resolve:e,reject:t}),i.socket.send({seq:i.reqSeq,action:n,data:r})})},P.prototype.useWebPhone=function(){return this._config.registerWebDevice||!1},P.prototype.callDestroyed=function(e){return 0<e.hangupAt&&!this.hasAgentTask(e.task)},P.prototype.conversationDestroyed=function(e){return 0<e.closedAt&&(!this.hasAgentTask(e.task)||!e.hasReporting)&&(e.hasReporting||!(e.lastAction===g.ChatActions.Close&&0<e.answeredAt))},P.prototype.reportingChannelTask=function(e){switch(e.channel){case Wr.Call:for(var t=0,n=this.allCall();t<n.length;t++){var r=n[t];if(this.callDestroyed(r))return void this.destroyCall(r)}break;case Wr.Chat:if(e.agentChannelId){var i=this.conversationById(e.agentChannelId);if(i&&this.conversationDestroyed(i))return void this.destroyConversation(i)}}},P.prototype.registerCallClient=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(e.label){case 0:this.phone=n,this.subscribePhone(n),e.label=1;case 1:return e.trys.push([1,4,,5]),[4,this.deviceConfig(this.phone.type)];case 2:return t=e.sent(),[4,this.phone.register(t)];case 3:return e.sent(),[3,5];case 4:return t=e.sent(),this.log.error(t),[3,5];case 5:return[2]}})})},P.prototype.subscribePhone=function(e){var n=this;e.on("peerStreams",function(e,t){e=n.callBySession(e);e&&!e.peerStreams.length&&(e.setPeerStreams(t),n.eventHandler.emit(Jr,g.CallActions.PeerStream,e))}),e.on("localStreams",function(e,t){e=n.callBySession(e);e&&!e.localStreams.length&&(e.setLocalStreams(t),n.eventHandler.emit(Jr,g.CallActions.LocalStream,e))}),e.on("newSession",this.onNewCallSession.bind(this)),e.on("registered",function(){return n.emit("phone_registered",!0)}),e.on("unregistered",function(){return n.emit("phone_registered",!1)})},P.prototype.phoneIsRegister=function(){return!(!this.phone||!this.phone.isRegistered)&&this.phone.isRegistered()},P.prototype.deviceConfig=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,this.request("user_default_device",{name:t})]})})},P.prototype.storeFile=function(l,d,_){return ae.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return ae.__generator(this,function(e){switch(e.label){case 0:if(!d||d.length<1)throw new Error("no files");for(t=new FormData,n=0,r=d;n<r.length;n++)i=r[n],t.append(i.name,i);return[4,Z.post(this.basePath+"/api/storage/file/"+l+"/upload",t,{headers:((c={})["X-Webitel-Access"]=this._config.token,c),onUploadProgress:_})];case 1:for(c=e.sent(),a=c.data,s=0,o=a;s<o.length;s++)(u=o[s]).shared=this.basePath+u.shared;return[2,a]}})})},P.prototype.fileUrlDownload=function(e){return this.basePath+"/api/storage/file/"+e+"/download?access_token="+this._config.token},P.prototype.fileUrlStream=function(e){return this.basePath+"/api/storage/file/"+e+"/stream?access_token="+this._config.token},P.prototype.handleError=function(e){if(e)switch(e.name){case Hr.NotFoundError:this.emit("error",new mr(e.message));break;case Hr.NotAllowedError:this.emit("error",new Cr(e.message));break;default:this.emit("error",e)}},P.prototype.destroyConversation=function(e){this.conversationStore.delete(e.id),this.eventHandler.emit(Vr,g.ChatActions.Destroy,e)},P.prototype.onMessage=function(r){return ae.__awaiter(this,void 0,void 0,function(){var t,n;return ae.__generator(this,function(e){switch(e.label){case 0:return(this.log.debug("receive message: ",r),0<r.seq_reply)?(this.queueRequest.has(r.seq_reply)&&(t=this.queueRequest.get(r.seq_reply),this.queueRequest.delete(r.seq_reply),r.status===g.Response.STATUS_OK?t.resolve(r.data):(n=r.error)&&n.id===g.TypeErrors.RolePermission?t.reject(new Kr(n.detail)):n&&n.id===g.TypeErrors.LicencePermission?t.reject(new Or(n.detail)):t.reject(r.error)),[3,15]):[3,1];case 1:switch(r.event){case"hello":return[3,2];case Jr:return[3,4];case Vr:return[3,6];case zr:return[3,8];case"sip":return[3,9];case $r:return[3,10];case"channel":return[3,11];case"error":return[3,12];case"notification":return[3,13]}return[3,14];case 2:return[4,this.connected(r.data)];case 3:return e.sent(),this.log.debug("opened session "+this.connectionInfo.sock_id+" for userId="+this.connectionInfo.session.user_id),[3,15];case 4:return[4,this.handleCallEvents(r.data.call)];case 5:return e.sent(),[3,15];case 6:return[4,this.handleChatEvents(r.data)];case 7:return e.sent(),[3,15];case 8:return this.handleUserStateEvent(r.data.state),[3,15];case 9:return this.eventHandler.emit("sip",r.data),[3,15];case 10:return this.handleAgentStatus(r.data),[3,15];case 11:return this.handleChannelEvents(r.data),[3,15];case 12:return this.lastError=r.data.error,[3,15];case 13:return this.handleNotification(r.data.notification),[3,15];case 14:this.log.error("event "+r.event+" not handler"),e.label=15;case 15:return[2]}})})},P.prototype.handleNotification=function(e){switch(e.action){case Mr.HideMember:if(this.agent&&this.agent._listOfflineMembers){var t=this.agent._listOfflineMembers;if(t.items)for(var n=0;n<t.items.length;n++)if(t.items[n].id===e.body.member_id){t.items.splice(n,1);break}}break;case Mr.WaitingList:this.agent&&this.agent.setWaitingList(e.body);break;case Mr.HideAttempt:this.agent&&this.agent.deleteWaitingAttempt(e.body);break;default:this.log.error('notification "'+e.action+'" not handled')}},P.prototype.handleAgentStatus=function(e){this.agent&&e.agent_id===this.agent.agentId&&this.agent.setStatus(e),this.eventHandler.emit($r,e,this.agent)},P.prototype.handleChannelEvents=function(e){var t;this.agent&&(e.timestamp=Date.now(),t=this.agent.onChannelEvent(e)||void 0,this.eventHandler.emit("task",e.status,t),t)&&Yr(t)&&(this.eventHandler.emit("job",t.state,t),e=t.state,-1<[g.ChannelState.Missed.toString(),g.ChannelState.Waiting,g.ChannelState.WrapTime,g.JobState.Closed].indexOf(e))&&this.eventHandler.emit("job",g.JobState.Destroy,t)},P.prototype.pingServer=function(){return ae.__awaiter(this,void 0,void 0,function(){var t,n=this;return ae.__generator(this,function(e){switch(e.label){case 0:return this.pingTimer&&this.connectionInfo.ping_interval?(t=setTimeout(function(){return ae.__awaiter(n,void 0,void 0,function(){return ae.__generator(this,function(e){return this.log.error("close socket without pong"),this.socket.close(3005),[2]})})},2e3),[4,this.ping()]):[3,2];case 1:e.sent(),clearTimeout(t),e.label=2;case 2:return this.connectionInfo.ping_interval&&(this.pingTimer=setTimeout(this.pingServer.bind(this),+this.connectionInfo.ping_interval)),[2]}})})},P.prototype.connected=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){switch(e.label){case 0:return(this.connectionInfo=t).ping_interval?[4,this.pingServer()]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.useWebPhone()?[2,this.registerCallClient(new br(this.instanceId,this._config.debug))]:[2]}})})},P.prototype.callBySession=function(e){for(var t=0,n=this.allCall();t<n.length;t++){var r=n[t];if(r.sip&&r.sip.id===e.id)return r}},P.prototype.onNewCallSession=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){return(t=n.callId?this.callById(n.callId):this.callBySipId(n.id))&&(t.setSip(n),this.checkAutoAnswer(t)),[2]})})},P.prototype.checkAutoAnswer=function(e){e.autoAnswer&&e.answerDelay({video:e.params.video,screen:e.params.screen,disableStun:e.params.disableStun})},P.prototype.connectToSocket=function(){var n=this;return new Promise(function(e,t){try{n.socket=new Br(n._config.endpoint),n.socket.connect(n._config.token)}catch(e){return void t(e)}n.socket.on("message",n.onMessage.bind(n)),n.socket.on("close",function(e){n.pingTimer&&clearTimeout(n.pingTimer),n.log.error("socket close code: ",e),1e3!==e&&(n.emit("disconnected",e,n.lastError),t(new Error("close socket code: "+e))),n.eventHandler.off("*")}),n.socket.on("open",function(){e(null),n.emit("connected")})})},P.prototype.handleUserStateEvent=function(e){this.eventHandler.emit(zr,e)},P.prototype.handleCallEvents=function(n){return ae.__awaiter(this,void 0,void 0,function(){var t;return ae.__generator(this,function(e){switch(n.timestamp=Date.now(),n.event){case g.CallActions.Ringing:t=new Qr(this,n),this.callStore.set(t.id,t),this.checkAutoAnswer(t);break;case g.CallActions.Active:(t=this.callById(n.id))&&t.setActive(n);break;case g.CallActions.Bridge:(t=this.callById(n.id))&&t.setBridged(n);break;case g.CallActions.Execute:(t=this.callById(n.id))&&t.setExecute(n.data);break;case g.CallActions.DTMF:(t=this.callById(n.id))&&t.addDigit(n.data);break;case g.CallActions.Eavesdrop:(t=this.callById(n.id))&&t.setEavesdropState(n.data);break;case g.CallActions.Voice:(t=this.callById(n.id))&&t.setVoice();break;case g.CallActions.Silence:(t=this.callById(n.id))&&t.setSilence();break;case g.CallActions.Hold:(t=this.callById(n.id))&&t.setHold(n);break;case g.CallActions.Hangup:(t=this.callById(n.id))&&t.setHangup(n);break;default:throw new Error("Unhandled action")}return t&&(this.eventHandler.emit(Jr,n.event,t),this.callDestroyed(t))&&this.destroyCall(t),[2]})})},P.prototype.handleChatEvents=function(f){return ae.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l,d,_,h,p;return ae.__generator(this,function(e){switch(n=Date.now(),f.action){case g.ChatActions.UserInvite:s=f.data,(t=new Lr(this,s.conversation_id,s.title,s.members,s.messages,s.variables)).setInvite(s.invite_id,n),this.conversationStore.set(t.id,t);break;case g.ChatActions.MessageDeleted:for(r=f.data,i=0,a=this.allConversations();i<a.length;i++)if(!(h=a[i]).closedAt&&-1<h.membersId.indexOf(r.channel_id)){t=h;break}return t&&t.setDeletedMessage(r),[2];case g.ChatActions.Joined:s=f.data,(t=this.conversationById(s.member.id))&&t.setAnswered(s.member.id,n,s.member);break;case g.ChatActions.Message:for((o=f.data).timestamp=n,u=0,c=this.allConversations();u<c.length;u++)!(h=c[u]).closedAt&&-1<h.membersId.indexOf(o.channel_id)&&(t=h);t&&t.newMessage(o);break;case g.ChatActions.Close:for(l=f.data,d=0,_=this.allConversations();d<_.length;d++)!(h=_[d]).closedAt&&-1<h.membersId.indexOf(l.from_channel_id)&&(t=h);t&&t.setClosed(n);break;case g.ChatActions.Leave:p=f.data,(t=this.conversationById(p.leaved_channel_id))&&t.setLeave(p);break;case g.ChatActions.Decline:p=f.data,(t=this.conversationById(p.invite_id))&&t.setDecline(p)}return t&&(t.lastAction=f.action,this.eventHandler.emit(Vr,f.action,t),this.conversationDestroyed(t))&&this.destroyConversation(t),[2]})})},P.prototype.hasAgentTask=function(e){return!(!this.agent||!e)&&this.agent.hasTask(e)},P.prototype.destroyCall=function(e){this.callStore.delete(e.id),this.eventHandler.emit(Jr,g.CallActions.Destroy,e)},P);function P(e){var t=Nr.call(this)||this;return t._config=e,t.reqSeq=0,t.queueRequest=new Map,t.log=new pr,t.eventHandler=new T.EventEmitter,t.callStore=new Map,t.conversationStore=new Map,t.pingTimer=null,t.basePath=""+(e=(e=(e=(e=e.storageEndpoint||e.endpoint).replace(/^ws/,"http")).endsWith("/")?e.slice(0,-1):e).endsWith("/ws")?e.slice(0,-3):e),t.lastError=null,t}function Yr(e){return e.channel===Wr.Task}Zr=T.EventEmitter,ae.__extends(ti,Zr);var Zr,ei=ti;function ti(){return null!==Zr&&Zr.apply(this,arguments)||this}var ni="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(function(c){var e=ni&&ni.__generator||function(r,i){var a,s,o,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(n){return function(e){var t=[n,e];if(a)throw new TypeError("Generator is already executing.");for(;u;)try{if(a=1,s&&(o=2&t[0]?s.return:t[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,t[1])).done)return o;switch(s=0,(t=o?[2&t[0],o.value]:t)[0]){case 0:case 1:o=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,s=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(o=0<(o=u.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3]))u.label=t[1];else if(6===t[0]&&u.label<o[1])u.label=o[1],o=t;else{if(!(o&&u.label<o[2])){o[2]&&u.ops.pop(),u.trys.pop();continue}u.label=o[2],u.ops.push(t)}}t=i.call(r,u)}catch(e){t=[6,e],s=0}finally{a=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},t=(Object.defineProperty(c,"__esModule",{value:!0}),c.$listeners=Symbol("EventEmitter.listeners"),c.$addListener=Symbol("EventEmitter.addListener"),n.count=function(e,t){var n=0,e=e[c.$listeners][t];if(e)for(var r=e.first;++n&&r.next;)r=r.next;return n},n.has=function(e,t){if("*"!=t)return void 0!==e[c.$listeners][t];for(t in e[c.$listeners])return!0;return!1},n.keys=function(e){return Object.keys(e[c.$listeners])},n.unhandle=function(n,r,i,e){return n.on(r,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!n[c.$listeners][r].first.next)return i.apply(void 0,e)},e)},n.prototype.on=function(e,t,n){return"function"==typeof t?this[c.$addListener](e,t,n):this[c.$addListener](e,void 0,t)},n.prototype.one=function(e,t,n){return"function"==typeof t?this[c.$addListener](e,t,n,!0):this[c.$addListener](e,void 0,t,!0)},n.prototype.off=function(e,t){if("*"==e){var n=this[c.$listeners];if(this[c.$listeners]={},this._onEventUnhandled)for(var r in n)this._onEventUnhandled(r)}else{if("function"==typeof t){n=this[c.$listeners][e];if(n&&function(e,t){var n=null,r=e.first;for(;;)if(t(r))if(n){if(n.next=r.next,!r.next)break;r=r.next}else{if(!r.next)return;e.first=r=r.next}else{if(!(n=r).next)break;r=r.next}return e.last=n,e}(n,function(e){return e.fn==t}))return this}delete this[c.$listeners][e],this._onEventUnhandled&&this._onEventUnhandled(e)}return this},n.prototype.emit=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];for(var i=this.listeners(e);;){var a=i.next(),s=a.value;if(a.done)return t;a=s.apply(void 0,n);void 0!==a&&(t=a)}},n.prototype.listeners=function(t){var n,r,i;return e(this,function(e){switch(e.label){case 0:if(!(n=this[c.$listeners][t]))return[2];r=null,i=n.first,e.label=1;case 1:return[4,i.fn];case 2:if(e.sent(),i.once){if(!r)return i.next?(n.first=i=i.next,[3,1]):(delete this[c.$listeners][t],this._onEventUnhandled&&this._onEventUnhandled(t),[2]);r.next=i.next}else r=i;return i.next?(i=i.next,[3,1]):(n.last=i,[2]);case 3:return[2]}})},n.prototype[c.$addListener]=function(n,e,r,i){var t,a,s=this;if(void 0===i&&(i=!1),"object"!=typeof n)return"function"==typeof e&&(a=l(this[c.$listeners],t=n,{fn:e,once:i,next:null}),r&&r.push({dispose:function(){return s.off(t,e)}}),e==a.first.fn)&&this._onEventHandled&&this._onEventHandled(n),e;var o,u=this;for(o in n)!function(){var e,t;"function"==typeof n[o]&&(e=n[o],t=l(u[c.$listeners],o,{fn:e,once:i,next:null}),r&&r.push({dispose:function(){return s.off(o,e)}}),e==t.first.fn)&&u._onEventHandled&&u._onEventHandled(o)}();return this},n.ev=c.$listeners,n);function n(){this[c.$listeners]={}}function l(e,t,n){var r=e[t];return r?(r.last.next=n,r.last=n):e[t]=r={first:n,last:n},r}c.EventEmitter=t})((ri={exports:{}},ri.exports));var ri=ri.exports,ii=((ii=ri)&&ii.__esModule&&Object.prototype.hasOwnProperty.call(ii,"default")&&ii.default,ri.$listeners,ri.$addListener,ri.EventEmitter),ai=(Object.defineProperty(si.prototype,"id",{get:function(){return this.callId},enumerable:!1,configurable:!0}),si.prototype.getLocalMedia=function(){return[]},si.prototype.getPeerMedia=function(){return[]},si.prototype.answer=function(e){var t=this;return new Promise(function(e){t.client.answer(t.id),e()})},si);function si(e,t){this.client=e,this.callId=t,this.incoming=!1,this.instanceId="fixme"}oi=ii,ae.__extends(ui,oi),ui.prototype.callOption=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2,t]})})},ui.prototype.register=function(e){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2]})})},ui.prototype.unregister=function(){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return[2]})})},ui.prototype.call=function(t){return ae.__awaiter(this,void 0,void 0,function(){return ae.__generator(this,function(e){return t.destination&&this.exec(t.destination),[2]})})},ui.prototype.answer=function(e){this.exec(e,"answer")},ui.prototype.isRegistered=function(){return!1},ui.prototype.sipSessionByCallId=function(e){return new ai(this,e)},ui.prototype.sipSessionBySipId=function(e){return null},ui.prototype.open=function(e){this.exec(encodeURIComponent(JSON.stringify(ae.__assign({token:e},this.config))),"open")},ui.prototype.exec=function(e,t){e=""+this.schema+e,t&&(e+=" "+t),t=document.createElement("a");t.download="File name",t.href=e,t.click()};var oi,ri=ui;function ui(e){var t=oi.call(this)||this;return t.config=e,t.type="external",t.schema="wtel://",t}g.AgentPauseCauseServiceApiAxiosParamCreator=E,g.AgentPauseCauseServiceApiFp=X,g.AgentPauseCauseServiceApiFactory=function(o,u,c){return{createAgentPauseCause:function(e,t){return X(o).createAgentPauseCause(e,t).then(function(e){return e(c,u)})},deleteAgentPauseCause:function(e,t){return X(o).deleteAgentPauseCause(e,t).then(function(e){return e(c,u)})},patchAgentPauseCause:function(e,t,n){return X(o).patchAgentPauseCause(e,t,n).then(function(e){return e(c,u)})},readAgentPauseCause:function(e,t){return X(o).readAgentPauseCause(e,t).then(function(e){return e(c,u)})},searchAgentPauseCause:function(e,t,n,r,i,a,s){return X(o).searchAgentPauseCause(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateAgentPauseCause:function(e,t,n){return X(o).updateAgentPauseCause(e,t,n).then(function(e){return e(c,u)})}}},g.AgentPauseCauseServiceApi=j,g.AgentServiceApiAxiosParamCreator=A,g.AgentServiceApiFp=C,g.AgentServiceApiFactory=function(w,m,q){return{agentSetState:function(e,t,n){return C(w).agentSetState(e,t,n).then(function(e){return e(q,m)})},agentStateHistory:function(e,t,n,r,i,a,s,o){return C(w).agentStateHistory(e,t,n,r,i,a,s,o).then(function(e){return e(q,m)})},agentTodayStatistics:function(e,t,n){return C(w).agentTodayStatistics(e,t,n).then(function(e){return e(q,m)})},createAgent:function(e,t){return C(w).createAgent(e,t).then(function(e){return e(q,m)})},deleteAgent:function(e,t,n){return C(w).deleteAgent(e,t,n).then(function(e){return e(q,m)})},patchAgent:function(e,t,n){return C(w).patchAgent(e,t,n).then(function(e){return e(q,m)})},readAgent:function(e,t,n){return C(w).readAgent(e,t,n).then(function(e){return e(q,m)})},searchAgent:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b){return C(w).searchAgent(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b).then(function(e){return e(q,m)})},searchAgentCallStatistics:function(e,t,n,r,i,a,s,o,u,c){return C(w).searchAgentCallStatistics(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(q,m)})},searchAgentInQueue:function(e,t,n,r,i,a,s){return C(w).searchAgentInQueue(e,t,n,r,i,a,s).then(function(e){return e(q,m)})},searchAgentInQueueStatistics:function(e,t,n){return C(w).searchAgentInQueueStatistics(e,t,n).then(function(e){return e(q,m)})},searchAgentInTeam:function(e,t,n,r,i,a){return C(w).searchAgentInTeam(e,t,n,r,i,a).then(function(e){return e(q,m)})},searchAgentStateHistory:function(e,t,n,r,i,a,s,o,u){return C(w).searchAgentStateHistory(e,t,n,r,i,a,s,o,u).then(function(e){return e(q,m)})},searchAgentStatusStatistic:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y){return C(w).searchAgentStatusStatistic(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y).then(function(e){return e(q,m)})},searchAgentStatusStatisticItem:function(e,t,n,r){return C(w).searchAgentStatusStatisticItem(e,t,n,r).then(function(e){return e(q,m)})},searchLookupUsersAgentNotExists:function(e,t,n,r,i){return C(w).searchLookupUsersAgentNotExists(e,t,n,r,i).then(function(e){return e(q,m)})},searchPauseCauseForAgent:function(e,t,n){return C(w).searchPauseCauseForAgent(e,t,n).then(function(e){return e(q,m)})},updateAgent:function(e,t,n){return C(w).updateAgent(e,t,n).then(function(e){return e(q,m)})},updateAgentStatus:function(e,t,n){return C(w).updateAgentStatus(e,t,n).then(function(e){return e(q,m)})}}},g.AgentServiceApi=M,g.AgentSkillServiceApiAxiosParamCreator=L,g.AgentSkillServiceApiFp=_,g.AgentSkillServiceApiFactory=function(c,l,d){return{createAgentSkill:function(e,t,n){return _(c).createAgentSkill(e,t,n).then(function(e){return e(d,l)})},createAgentSkills:function(e,t,n){return _(c).createAgentSkills(e,t,n).then(function(e){return e(d,l)})},deleteAgentSkill:function(e,t,n,r){return _(c).deleteAgentSkill(e,t,n,r).then(function(e){return e(d,l)})},deleteAgentSkills:function(e,t,n,r){return _(c).deleteAgentSkills(e,t,n,r).then(function(e){return e(d,l)})},patchAgentSkill:function(e,t,n,r){return _(c).patchAgentSkill(e,t,n,r).then(function(e){return e(d,l)})},patchAgentSkills:function(e,t,n){return _(c).patchAgentSkills(e,t,n).then(function(e){return e(d,l)})},readAgentSkill:function(e,t,n,r){return _(c).readAgentSkill(e,t,n,r).then(function(e){return e(d,l)})},searchAgentSkill:function(e,t,n,r,i,a,s,o,u){return _(c).searchAgentSkill(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},searchLookupAgentNotExistsSkill:function(e,t,n,r,i,a){return _(c).searchLookupAgentNotExistsSkill(e,t,n,r,i,a).then(function(e){return e(d,l)})},updateAgentSkill:function(e,t,n,r){return _(c).updateAgentSkill(e,t,n,r).then(function(e){return e(d,l)})}}},g.AgentSkillServiceApi=G,g.AgentTeamServiceApiAxiosParamCreator=D,g.AgentTeamServiceApiFp=H,g.AgentTeamServiceApiFactory=function(c,l,d){return{createAgentTeam:function(e,t){return H(c).createAgentTeam(e,t).then(function(e){return e(d,l)})},deleteAgentTeam:function(e,t,n){return H(c).deleteAgentTeam(e,t,n).then(function(e){return e(d,l)})},readAgentTeam:function(e,t,n){return H(c).readAgentTeam(e,t,n).then(function(e){return e(d,l)})},searchAgentTeam:function(e,t,n,r,i,a,s,o,u){return H(c).searchAgentTeam(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateAgentTeam:function(e,t,n){return H(c).updateAgentTeam(e,t,n).then(function(e){return e(d,l)})}}},g.AgentTeamServiceApi=J,g.AuditFormServiceApiAxiosParamCreator=z,g.AuditFormServiceApiFp=v,g.AuditFormServiceApiFactory=function(h,p,f){return{createAuditForm:function(e,t){return v(h).createAuditForm(e,t).then(function(e){return e(f,p)})},createAuditFormRate:function(e,t){return v(h).createAuditFormRate(e,t).then(function(e){return e(f,p)})},deleteAuditForm:function(e,t){return v(h).deleteAuditForm(e,t).then(function(e){return e(f,p)})},patchAuditForm:function(e,t,n){return v(h).patchAuditForm(e,t,n).then(function(e){return e(f,p)})},readAuditForm:function(e,t){return v(h).readAuditForm(e,t).then(function(e){return e(f,p)})},readAuditRate:function(e,t){return v(h).readAuditRate(e,t).then(function(e){return e(f,p)})},searchAuditForm:function(e,t,n,r,i,a,s,o,u,c,l,d,_){return v(h).searchAuditForm(e,t,n,r,i,a,s,o,u,c,l,d,_).then(function(e){return e(f,p)})},searchAuditRate:function(e,t,n,r,i,a,s,o,u,c,l,d){return v(h).searchAuditRate(e,t,n,r,i,a,s,o,u,c,l,d).then(function(e){return e(f,p)})},updateAuditForm:function(e,t,n){return v(h).updateAuditForm(e,t,n).then(function(e){return e(f,p)})}}},g.AuditFormServiceApi=Y,g.BackendProfileServiceApiAxiosParamCreator=ie,g.BackendProfileServiceApiFp=oe,g.BackendProfileServiceApiFactory=function(o,u,c){return{createBackendProfile:function(e,t){return oe(o).createBackendProfile(e,t).then(function(e){return e(c,u)})},deleteBackendProfile:function(e,t,n){return oe(o).deleteBackendProfile(e,t,n).then(function(e){return e(c,u)})},patchBackendProfile:function(e,t,n){return oe(o).patchBackendProfile(e,t,n).then(function(e){return e(c,u)})},readBackendProfile:function(e,t,n){return oe(o).readBackendProfile(e,t,n).then(function(e){return e(c,u)})},searchBackendProfile:function(e,t,n,r,i,a,s){return oe(o).searchBackendProfile(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateBackendProfile:function(e,t,n){return oe(o).updateBackendProfile(e,t,n).then(function(e){return e(c,u)})}}},g.BackendProfileServiceApi=ce,g.BucketServiceApiAxiosParamCreator=de,g.BucketServiceApiFp=_e,g.BucketServiceApiFactory=function(o,u,c){return{createBucket:function(e,t){return _e(o).createBucket(e,t).then(function(e){return e(c,u)})},deleteBucket:function(e,t,n){return _e(o).deleteBucket(e,t,n).then(function(e){return e(c,u)})},readBucket:function(e,t,n){return _e(o).readBucket(e,t,n).then(function(e){return e(c,u)})},searchBucket:function(e,t,n,r,i,a,s){return _e(o).searchBucket(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateBucket:function(e,t,n){return _e(o).updateBucket(e,t,n).then(function(e){return e(c,u)})}}},g.BucketServiceApi=pe,g.CalendarServiceApiAxiosParamCreator=ge,g.CalendarServiceApiFp=ve,g.CalendarServiceApiFactory=function(o,u,c){return{createCalendar:function(e,t){return ve(o).createCalendar(e,t).then(function(e){return e(c,u)})},deleteCalendar:function(e,t,n){return ve(o).deleteCalendar(e,t,n).then(function(e){return e(c,u)})},readCalendar:function(e,t,n){return ve(o).readCalendar(e,t,n).then(function(e){return e(c,u)})},searchCalendar:function(e,t,n,r,i,a,s){return ve(o).searchCalendar(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},searchTimezones:function(e,t,n,r,i,a,s){return ve(o).searchTimezones(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateCalendar:function(e,t,n){return ve(o).updateCalendar(e,t,n).then(function(e){return e(c,u)})}}},g.CalendarServiceApi=be,g.CallServiceApiAxiosParamCreator=te,g.CallServiceApiFp=ne,g.CallServiceApiFactory=function(z,$,Y){return{aggregateHistoryCall:function(e,t){return ne(z).aggregateHistoryCall(e,t).then(function(e){return e(Y,$)})},blindTransferCall:function(e,t,n){return ne(z).blindTransferCall(e,t,n).then(function(e){return e(Y,$)})},confirmPush:function(e,t){return ne(z).confirmPush(e,t).then(function(e){return e(Y,$)})},createCall:function(e,t){return ne(z).createCall(e,t).then(function(e){return e(Y,$)})},createCallAnnotation:function(e,t,n){return ne(z).createCallAnnotation(e,t,n).then(function(e){return e(Y,$)})},deleteCallAnnotation:function(e,t,n){return ne(z).deleteCallAnnotation(e,t,n).then(function(e){return e(Y,$)})},dtmfCall:function(e,t,n){return ne(z).dtmfCall(e,t,n).then(function(e){return e(Y,$)})},eavesdropCall:function(e,t,n){return ne(z).eavesdropCall(e,t,n).then(function(e){return e(Y,$)})},hangupCall:function(e,t,n){return ne(z).hangupCall(e,t,n).then(function(e){return e(Y,$)})},holdCall:function(e,t,n){return ne(z).holdCall(e,t,n).then(function(e){return e(Y,$)})},patchHistoryCall:function(e,t,n){return ne(z).patchHistoryCall(e,t,n).then(function(e){return e(Y,$)})},readCall:function(e,t,n){return ne(z).readCall(e,t,n).then(function(e){return e(Y,$)})},searchActiveCall:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T){return ne(z).searchActiveCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T).then(function(e){return e(Y,$)})},searchHistoryCall:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I,k,W,E,X,x,j,U,Q,M,L,F,G,B,D,H,N,J,V){return ne(z).searchHistoryCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,I,k,W,E,X,x,j,U,Q,M,L,F,G,B,D,H,N,J,V).then(function(e){return e(Y,$)})},searchHistoryCallPost:function(e,t){return ne(z).searchHistoryCallPost(e,t).then(function(e){return e(Y,$)})},setVariablesCall:function(e,t,n){return ne(z).setVariablesCall(e,t,n).then(function(e){return e(Y,$)})},unHoldCall:function(e,t,n){return ne(z).unHoldCall(e,t,n).then(function(e){return e(Y,$)})},updateCallAnnotation:function(e,t,n,r){return ne(z).updateCallAnnotation(e,t,n,r).then(function(e){return e(Y,$)})}}},g.CallServiceApi=qe,g.ChatHelperServiceApiAxiosParamCreator=Ae,g.ChatHelperServiceApiFp=Ce,g.ChatHelperServiceApiFactory=function(r,i,a){return{broadcast:function(e,t,n){return Ce(r).broadcast(e,t,n).then(function(e){return e(a,i)})}}},g.ChatHelperServiceApi=Se,g.CognitiveProfileServiceApiAxiosParamCreator=Pe,g.CognitiveProfileServiceApiFp=Te,g.CognitiveProfileServiceApiFactory=function(c,l,d){return{createCognitiveProfile:function(e,t){return Te(c).createCognitiveProfile(e,t).then(function(e){return e(d,l)})},deleteCognitiveProfile:function(e,t){return Te(c).deleteCognitiveProfile(e,t).then(function(e){return e(d,l)})},patchCognitiveProfile:function(e,t,n){return Te(c).patchCognitiveProfile(e,t,n).then(function(e){return e(d,l)})},readCognitiveProfile:function(e,t){return Te(c).readCognitiveProfile(e,t).then(function(e){return e(d,l)})},searchCognitiveProfile:function(e,t,n,r,i,a,s,o,u){return Te(c).searchCognitiveProfile(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateCognitiveProfile:function(e,t,n){return Te(c).updateCognitiveProfile(e,t,n).then(function(e){return e(d,l)})}}},g.CognitiveProfileServiceApi=Ie,g.CommunicationTypeServiceApiAxiosParamCreator=We,g.CommunicationTypeServiceApiFp=Ee,g.CommunicationTypeServiceApiFactory=function(u,c,l){return{createCommunicationType:function(e,t){return Ee(u).createCommunicationType(e,t).then(function(e){return e(l,c)})},deleteCommunicationType:function(e,t,n){return Ee(u).deleteCommunicationType(e,t,n).then(function(e){return e(l,c)})},readCommunicationType:function(e,t,n){return Ee(u).readCommunicationType(e,t,n).then(function(e){return e(l,c)})},searchCommunicationType:function(e,t,n,r,i,a,s,o){return Ee(u).searchCommunicationType(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateCommunicationType:function(e,t,n){return Ee(u).updateCommunicationType(e,t,n).then(function(e){return e(l,c)})}}},g.CommunicationTypeServiceApi=xe,g.ConfigServiceApiAxiosParamCreator=Ue,g.ConfigServiceApiFp=c,g.ConfigServiceApiFactory=function(s,o,u){return{createConfig:function(e,t){return c(s).createConfig(e,t).then(function(e){return e(u,o)})},deleteConfig:function(e,t){return c(s).deleteConfig(e,t).then(function(e){return e(u,o)})},deleteConfigBulk:function(e,t){return c(s).deleteConfigBulk(e,t).then(function(e){return e(u,o)})},patchConfig:function(e,t,n){return c(s).patchConfig(e,t,n).then(function(e){return e(u,o)})},readConfig:function(e,t){return c(s).readConfig(e,t).then(function(e){return e(u,o)})},readSystemObjects:function(e,t){return c(s).readSystemObjects(e,t).then(function(e){return e(u,o)})},searchConfig:function(e,t,n,r,i,a){return c(s).searchConfig(e,t,n,r,i,a).then(function(e){return e(u,o)})},updateConfig:function(e,t,n){return c(s).updateConfig(e,t,n).then(function(e){return e(u,o)})}}},g.ConfigServiceApi=Me,g.ContactsApiAxiosParamCreator=Fe,g.ContactsApiFp=Ge,g.ContactsApiFactory=function(c,l,d){return{createContact:function(e,t,n){return Ge(c).createContact(e,t,n).then(function(e){return e(d,l)})},deleteContact:function(e,t,n){return Ge(c).deleteContact(e,t,n).then(function(e){return e(d,l)})},locateContact:function(e,t,n,r){return Ge(c).locateContact(e,t,n,r).then(function(e){return e(d,l)})},searchContacts:function(e,t,n,r,i,a,s,o,u){return Ge(c).searchContacts(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateContact:function(e,t,n,r){return Ge(c).updateContact(e,t,n,r).then(function(e){return e(d,l)})}}},g.ContactsApi=De,g.EmailProfileServiceApiAxiosParamCreator=Ne,g.EmailProfileServiceApiFp=l,g.EmailProfileServiceApiFactory=function(s,o,u){return{createEmailProfile:function(e,t){return l(s).createEmailProfile(e,t).then(function(e){return e(u,o)})},deleteEmailProfile:function(e,t){return l(s).deleteEmailProfile(e,t).then(function(e){return e(u,o)})},loginEmailProfile:function(e,t){return l(s).loginEmailProfile(e,t).then(function(e){return e(u,o)})},patchEmailProfile:function(e,t,n){return l(s).patchEmailProfile(e,t,n).then(function(e){return e(u,o)})},readEmailProfile:function(e,t){return l(s).readEmailProfile(e,t).then(function(e){return e(u,o)})},searchEmailProfile:function(e,t,n,r,i,a){return l(s).searchEmailProfile(e,t,n,r,i,a).then(function(e){return e(u,o)})},testEmailProfile:function(e,t){return l(s).testEmailProfile(e,t).then(function(e){return e(u,o)})},updateEmailProfile:function(e,t,n){return l(s).updateEmailProfile(e,t,n).then(function(e){return e(u,o)})}}},g.EmailProfileServiceApi=Ve,g.EmailsApiAxiosParamCreator=$e,g.EmailsApiFp=y,g.EmailsApiFactory=function(h,p,f){return{deleteEmail:function(e,t,n,r){return y(h).deleteEmail(e,t,n,r).then(function(e){return e(f,p)})},deleteEmails:function(e,t,n,r){return y(h).deleteEmails(e,t,n,r).then(function(e){return e(f,p)})},listEmails:function(e,t,n,r,i,a,s,o,u,c,l,d,_){return y(h).listEmails(e,t,n,r,i,a,s,o,u,c,l,d,_).then(function(e){return e(f,p)})},locateEmail:function(e,t,n,r){return y(h).locateEmail(e,t,n,r).then(function(e){return e(f,p)})},mergeEmails:function(e,t,n,r){return y(h).mergeEmails(e,t,n,r).then(function(e){return e(f,p)})},resetEmails:function(e,t,n,r){return y(h).resetEmails(e,t,n,r).then(function(e){return e(f,p)})},updateEmail:function(e,t,n,r,i){return y(h).updateEmail(e,t,n,r,i).then(function(e){return e(f,p)})},updateEmail2:function(e,t,n,r,i){return y(h).updateEmail2(e,t,n,r,i).then(function(e){return e(f,p)})}}},g.EmailsApi=Ze,g.FileServiceApiAxiosParamCreator=tt,g.FileServiceApiFp=nt,g.FileServiceApiFactory=function(n,r,i){return{deleteFiles:function(e,t){return nt(n).deleteFiles(e,t).then(function(e){return e(i,r)})}}},g.FileServiceApi=it,g.FileTranscriptServiceApiAxiosParamCreator=st,g.FileTranscriptServiceApiFp=ot,g.FileTranscriptServiceApiFactory=function(i,a,s){return{createFileTranscript:function(e,t){return ot(i).createFileTranscript(e,t).then(function(e){return e(s,a)})},deleteFileTranscript:function(e,t){return ot(i).deleteFileTranscript(e,t).then(function(e){return e(s,a)})},getFileTranscriptPhrases:function(e,t,n,r){return ot(i).getFileTranscriptPhrases(e,t,n,r).then(function(e){return e(s,a)})}}},g.FileTranscriptServiceApi=ct,g.ImportTemplateServiceApiAxiosParamCreator=dt,g.ImportTemplateServiceApiFp=_t,g.ImportTemplateServiceApiFactory=function(o,u,c){return{createImportTemplate:function(e,t){return _t(o).createImportTemplate(e,t).then(function(e){return e(c,u)})},deleteImportTemplate:function(e,t){return _t(o).deleteImportTemplate(e,t).then(function(e){return e(c,u)})},patchImportTemplate:function(e,t,n){return _t(o).patchImportTemplate(e,t,n).then(function(e){return e(c,u)})},readImportTemplate:function(e,t){return _t(o).readImportTemplate(e,t).then(function(e){return e(c,u)})},searchImportTemplate:function(e,t,n,r,i,a,s){return _t(o).searchImportTemplate(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateImportTemplate:function(e,t,n){return _t(o).updateImportTemplate(e,t,n).then(function(e){return e(c,u)})}}},g.ImportTemplateServiceApi=pt,g.LabelsApiAxiosParamCreator=gt,g.LabelsApiFp=vt,g.LabelsApiFactory=function(u,c,l){return{deleteLabels:function(e,t,n,r){return vt(u).deleteLabels(e,t,n,r).then(function(e){return e(l,c)})},getLabels:function(e,t,n,r){return vt(u).getLabels(e,t,n,r).then(function(e){return e(l,c)})},listLabels:function(e,t,n,r,i,a,s,o){return vt(u).listLabels(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},mergeLabels:function(e,t,n,r){return vt(u).mergeLabels(e,t,n,r).then(function(e){return e(l,c)})},resetLabels:function(e,t,n,r){return vt(u).resetLabels(e,t,n,r).then(function(e){return e(l,c)})}}},g.LabelsApi=bt,g.ListServiceApiAxiosParamCreator=mt,g.ListServiceApiFp=h,g.ListServiceApiFactory=function(l,d,_){return{createList:function(e,t){return h(l).createList(e,t).then(function(e){return e(_,d)})},createListCommunication:function(e,t,n){return h(l).createListCommunication(e,t,n).then(function(e){return e(_,d)})},deleteList:function(e,t,n){return h(l).deleteList(e,t,n).then(function(e){return e(_,d)})},deleteListCommunication:function(e,t,n,r){return h(l).deleteListCommunication(e,t,n,r).then(function(e){return e(_,d)})},readList:function(e,t,n){return h(l).readList(e,t,n).then(function(e){return e(_,d)})},readListCommunication:function(e,t,n,r){return h(l).readListCommunication(e,t,n,r).then(function(e){return e(_,d)})},searchList:function(e,t,n,r,i,a,s){return h(l).searchList(e,t,n,r,i,a,s).then(function(e){return e(_,d)})},searchListCommunication:function(e,t,n,r,i,a,s,o,u,c){return h(l).searchListCommunication(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},updateList:function(e,t,n){return h(l).updateList(e,t,n).then(function(e){return e(_,d)})},updateListCommunication:function(e,t,n,r){return h(l).updateListCommunication(e,t,n,r).then(function(e){return e(_,d)})}}},g.ListServiceApi=At,g.LoggerServiceApiAxiosParamCreator=Rt,g.LoggerServiceApiFp=St,g.LoggerServiceApiFactory=function(h,p,f){return{searchLogByConfigId:function(e,t,n,r,i,a,s,o,u,c,l,d,_){return St(h).searchLogByConfigId(e,t,n,r,i,a,s,o,u,c,l,d,_).then(function(e){return e(f,p)})},searchLogByUserId:function(e,t,n,r,i,a,s,o,u,c,l,d,_){return St(h).searchLogByUserId(e,t,n,r,i,a,s,o,u,c,l,d,_).then(function(e){return e(f,p)})}}},g.LoggerServiceApi=Pt,g.ManagersApiAxiosParamCreator=Ot,g.ManagersApiFp=d,g.ManagersApiFactory=function(u,c,l){return{deleteManager:function(e,t,n,r){return d(u).deleteManager(e,t,n,r).then(function(e){return e(l,c)})},deleteManagers:function(e,t,n,r){return d(u).deleteManagers(e,t,n,r).then(function(e){return e(l,c)})},listManagers:function(e,t,n,r,i,a,s,o){return d(u).listManagers(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},locateManager:function(e,t,n,r){return d(u).locateManager(e,t,n,r).then(function(e){return e(l,c)})},mergeManagers:function(e,t,n,r){return d(u).mergeManagers(e,t,n,r).then(function(e){return e(l,c)})},resetManagers:function(e,t,n,r){return d(u).resetManagers(e,t,n,r).then(function(e){return e(l,c)})},updateManager:function(e,t,n,r,i){return d(u).updateManager(e,t,n,r,i).then(function(e){return e(l,c)})},updateManager2:function(e,t,n,r,i){return d(u).updateManager2(e,t,n,r,i).then(function(e){return e(l,c)})}}},g.ManagersApi=kt,g.MediaFileServiceApiAxiosParamCreator=Et,g.MediaFileServiceApiFp=Xt,g.MediaFileServiceApiFactory=function(o,u,c){return{deleteMediaFile:function(e,t,n){return Xt(o).deleteMediaFile(e,t,n).then(function(e){return e(c,u)})},readMediaFile:function(e,t,n){return Xt(o).readMediaFile(e,t,n).then(function(e){return e(c,u)})},searchMediaFile:function(e,t,n,r,i,a,s){return Xt(o).searchMediaFile(e,t,n,r,i,a,s).then(function(e){return e(c,u)})}}},g.MediaFileServiceApi=jt,g.MemberServiceApiAxiosParamCreator=R,g.MemberServiceApiFp=S,g.MemberServiceApiFactory=function(m,q,A){return{attemptCallback:function(e,t,n){return S(m).attemptCallback(e,t,n).then(function(e){return e(A,q)})},attemptResult:function(e,t,n,r,i){return S(m).attemptResult(e,t,n,r,i).then(function(e){return e(A,q)})},attemptsRenewalResult:function(e,t,n){return S(m).attemptsRenewalResult(e,t,n).then(function(e){return e(A,q)})},createAttempt:function(e,t,n,r){return S(m).createAttempt(e,t,n,r).then(function(e){return e(A,q)})},createMember:function(e,t,n){return S(m).createMember(e,t,n).then(function(e){return e(A,q)})},createMemberBulk:function(e,t,n){return S(m).createMemberBulk(e,t,n).then(function(e){return e(A,q)})},deleteMember:function(e,t,n,r){return S(m).deleteMember(e,t,n,r).then(function(e){return e(A,q)})},deleteMembers:function(e,t,n){return S(m).deleteMembers(e,t,n).then(function(e){return e(A,q)})},patchMember:function(e,t,n,r){return S(m).patchMember(e,t,n,r).then(function(e){return e(A,q)})},readMember:function(e,t,n,r){return S(m).readMember(e,t,n,r).then(function(e){return e(A,q)})},resetMembers:function(e,t,n){return S(m).resetMembers(e,t,n).then(function(e){return e(A,q)})},searchAttempts:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b){return S(m).searchAttempts(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b).then(function(e){return e(A,q)})},searchAttemptsHistory:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b){return S(m).searchAttemptsHistory(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b).then(function(e){return e(A,q)})},searchMemberAttempts:function(e,t,n,r){return S(m).searchMemberAttempts(e,t,n,r).then(function(e){return e(A,q)})},searchMemberInQueue:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){return S(m).searchMemberInQueue(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w).then(function(e){return e(A,q)})},searchMembers:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){return S(m).searchMembers(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w).then(function(e){return e(A,q)})},updateMember:function(e,t,n,r){return S(m).updateMember(e,t,n,r).then(function(e){return e(A,q)})}}},g.MemberServiceApi=Mt,g.OutboundResourceGroupServiceApiAxiosParamCreator=Lt,g.OutboundResourceGroupServiceApiFp=p,g.OutboundResourceGroupServiceApiFactory=function(u,c,l){return{createOutboundResourceGroup:function(e,t){return p(u).createOutboundResourceGroup(e,t).then(function(e){return e(l,c)})},createOutboundResourceInGroup:function(e,t,n){return p(u).createOutboundResourceInGroup(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceGroup:function(e,t,n){return p(u).deleteOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceInGroup:function(e,t,n,r){return p(u).deleteOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})},readOutboundResourceGroup:function(e,t,n){return p(u).readOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},readOutboundResourceInGroup:function(e,t,n,r){return p(u).readOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})},searchOutboundResourceGroup:function(e,t,n,r,i,a,s){return p(u).searchOutboundResourceGroup(e,t,n,r,i,a,s).then(function(e){return e(l,c)})},searchOutboundResourceInGroup:function(e,t,n,r,i,a,s,o){return p(u).searchOutboundResourceInGroup(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateOutboundResourceGroup:function(e,t,n){return p(u).updateOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},updateOutboundResourceInGroup:function(e,t,n,r){return p(u).updateOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})}}},g.OutboundResourceGroupServiceApi=Gt,g.OutboundResourceServiceApiAxiosParamCreator=Dt,g.OutboundResourceServiceApiFp=f,g.OutboundResourceServiceApiFactory=function(u,c,l){return{createOutboundResource:function(e,t){return f(u).createOutboundResource(e,t).then(function(e){return e(l,c)})},createOutboundResourceDisplay:function(e,t,n){return f(u).createOutboundResourceDisplay(e,t,n).then(function(e){return e(l,c)})},createOutboundResourceDisplayBulk:function(e,t,n){return f(u).createOutboundResourceDisplayBulk(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResource:function(e,t,n){return f(u).deleteOutboundResource(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceDisplay:function(e,t,n,r){return f(u).deleteOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})},deleteOutboundResourceDisplays:function(e,t,n){return f(u).deleteOutboundResourceDisplays(e,t,n).then(function(e){return e(l,c)})},patchOutboundResource:function(e,t,n){return f(u).patchOutboundResource(e,t,n).then(function(e){return e(l,c)})},readOutboundResource:function(e,t,n){return f(u).readOutboundResource(e,t,n).then(function(e){return e(l,c)})},readOutboundResourceDisplay:function(e,t,n,r){return f(u).readOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})},searchOutboundResource:function(e,t,n,r,i,a,s){return f(u).searchOutboundResource(e,t,n,r,i,a,s).then(function(e){return e(l,c)})},searchOutboundResourceDisplay:function(e,t,n,r,i,a,s,o){return f(u).searchOutboundResourceDisplay(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateOutboundResource:function(e,t,n){return f(u).updateOutboundResource(e,t,n).then(function(e){return e(l,c)})},updateOutboundResourceDisplay:function(e,t,n,r){return f(u).updateOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})}}},g.OutboundResourceServiceApi=Nt,g.PresetQueryServiceApiAxiosParamCreator=Jt,g.PresetQueryServiceApiFp=Vt,g.PresetQueryServiceApiFactory=function(u,c,l){return{createPresetQuery:function(e,t){return Vt(u).createPresetQuery(e,t).then(function(e){return e(l,c)})},deletePresetQuery:function(e,t){return Vt(u).deletePresetQuery(e,t).then(function(e){return e(l,c)})},patchPresetQuery:function(e,t,n){return Vt(u).patchPresetQuery(e,t,n).then(function(e){return e(l,c)})},readPresetQuery:function(e,t){return Vt(u).readPresetQuery(e,t).then(function(e){return e(l,c)})},searchPresetQuery:function(e,t,n,r,i,a,s,o){return Vt(u).searchPresetQuery(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updatePresetQuery:function(e,t,n){return Vt(u).updatePresetQuery(e,t,n).then(function(e){return e(l,c)})}}},g.PresetQueryServiceApi=$t,g.QueueBucketServiceApiAxiosParamCreator=Zt,g.QueueBucketServiceApiFp=en,g.QueueBucketServiceApiFactory=function(u,c,l){return{createQueueBucket:function(e,t,n){return en(u).createQueueBucket(e,t,n).then(function(e){return e(l,c)})},deleteQueueBucket:function(e,t,n){return en(u).deleteQueueBucket(e,t,n).then(function(e){return e(l,c)})},patchQueueBucket:function(e,t,n,r){return en(u).patchQueueBucket(e,t,n,r).then(function(e){return e(l,c)})},readQueueBucket:function(e,t,n){return en(u).readQueueBucket(e,t,n).then(function(e){return e(l,c)})},searchQueueBucket:function(e,t,n,r,i,a,s,o){return en(u).searchQueueBucket(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateQueueBucket:function(e,t,n,r){return en(u).updateQueueBucket(e,t,n,r).then(function(e){return e(l,c)})}}},g.QueueBucketServiceApi=nn,g.QueueHookServiceApiAxiosParamCreator=an,g.QueueHookServiceApiFp=sn,g.QueueHookServiceApiFactory=function(l,d,_){return{createQueueHook:function(e,t,n){return sn(l).createQueueHook(e,t,n).then(function(e){return e(_,d)})},deleteQueueHook:function(e,t,n){return sn(l).deleteQueueHook(e,t,n).then(function(e){return e(_,d)})},patchQueueHook:function(e,t,n,r){return sn(l).patchQueueHook(e,t,n,r).then(function(e){return e(_,d)})},readQueueHook:function(e,t,n){return sn(l).readQueueHook(e,t,n).then(function(e){return e(_,d)})},searchQueueHook:function(e,t,n,r,i,a,s,o,u,c){return sn(l).searchQueueHook(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},updateQueueHook:function(e,t,n,r){return sn(l).updateQueueHook(e,t,n,r).then(function(e){return e(_,d)})}}},g.QueueHookServiceApi=un,g.QueueResourcesServiceApiAxiosParamCreator=ln,g.QueueResourcesServiceApiFp=dn,g.QueueResourcesServiceApiFactory=function(u,c,l){return{createQueueResourceGroup:function(e,t,n){return dn(u).createQueueResourceGroup(e,t,n).then(function(e){return e(l,c)})},deleteQueueResourceGroup:function(e,t,n,r){return dn(u).deleteQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})},readQueueResourceGroup:function(e,t,n,r){return dn(u).readQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})},searchQueueResourceGroup:function(e,t,n,r,i,a,s,o){return dn(u).searchQueueResourceGroup(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateQueueResourceGroup:function(e,t,n,r){return dn(u).updateQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})}}},g.QueueResourcesServiceApi=hn,g.QueueServiceApiAxiosParamCreator=fn,g.QueueServiceApiFp=b,g.QueueServiceApiFactory=function(_,h,p){return{createQueue:function(e,t){return b(_).createQueue(e,t).then(function(e){return e(p,h)})},deleteQueue:function(e,t,n){return b(_).deleteQueue(e,t,n).then(function(e){return e(p,h)})},patchQueue:function(e,t,n){return b(_).patchQueue(e,t,n).then(function(e){return e(p,h)})},readQueue:function(e,t,n){return b(_).readQueue(e,t,n).then(function(e){return e(p,h)})},searchQueue:function(e,t,n,r,i,a,s,o){return b(_).searchQueue(e,t,n,r,i,a,s,o).then(function(e){return e(p,h)})},searchQueueReportGeneral:function(e,t,n,r,i,a,s,o,u,c,l,d){return b(_).searchQueueReportGeneral(e,t,n,r,i,a,s,o,u,c,l,d).then(function(e){return e(p,h)})},updateQueue:function(e,t,n){return b(_).updateQueue(e,t,n).then(function(e){return e(p,h)})}}},g.QueueServiceApi=vn,g.QueueSkillServiceApiAxiosParamCreator=bn,g.QueueSkillServiceApiFp=wn,g.QueueSkillServiceApiFactory=function(p,f,g){return{createQueueSkill:function(e,t,n){return wn(p).createQueueSkill(e,t,n).then(function(e){return e(g,f)})},deleteQueueSkill:function(e,t,n){return wn(p).deleteQueueSkill(e,t,n).then(function(e){return e(g,f)})},patchQueueSkill:function(e,t,n,r){return wn(p).patchQueueSkill(e,t,n,r).then(function(e){return e(g,f)})},readQueueSkill:function(e,t,n){return wn(p).readQueueSkill(e,t,n).then(function(e){return e(g,f)})},searchQueueSkill:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){return wn(p).searchQueueSkill(e,t,n,r,i,a,s,o,u,c,l,d,_,h).then(function(e){return e(g,f)})},updateQueueSkill:function(e,t,n,r){return wn(p).updateQueueSkill(e,t,n,r).then(function(e){return e(g,f)})}}},g.QueueSkillServiceApi=qn,g.RegionServiceApiAxiosParamCreator=Cn,g.RegionServiceApiFp=Rn,g.RegionServiceApiFactory=function(l,d,_){return{createRegion:function(e,t){return Rn(l).createRegion(e,t).then(function(e){return e(_,d)})},deleteRegion:function(e,t){return Rn(l).deleteRegion(e,t).then(function(e){return e(_,d)})},patchRegion:function(e,t,n){return Rn(l).patchRegion(e,t,n).then(function(e){return e(_,d)})},readRegion:function(e,t){return Rn(l).readRegion(e,t).then(function(e){return e(_,d)})},searchRegion:function(e,t,n,r,i,a,s,o,u,c){return Rn(l).searchRegion(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},updateRegion:function(e,t,n){return Rn(l).updateRegion(e,t,n).then(function(e){return e(_,d)})}}},g.RegionServiceApi=Kn,g.RoutingChatPlanServiceApiAxiosParamCreator=Tn,g.RoutingChatPlanServiceApiFp=On,g.RoutingChatPlanServiceApiFactory=function(c,l,d){return{createChatPlan:function(e,t){return On(c).createChatPlan(e,t).then(function(e){return e(d,l)})},deleteChatPlan:function(e,t){return On(c).deleteChatPlan(e,t).then(function(e){return e(d,l)})},patchChatPlan:function(e,t,n){return On(c).patchChatPlan(e,t,n).then(function(e){return e(d,l)})},readChatPlan:function(e,t){return On(c).readChatPlan(e,t).then(function(e){return e(d,l)})},searchChatPlan:function(e,t,n,r,i,a,s,o,u){return On(c).searchChatPlan(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateChatPlan:function(e,t,n){return On(c).updateChatPlan(e,t,n).then(function(e){return e(d,l)})}}},g.RoutingChatPlanServiceApi=kn,g.RoutingOutboundCallServiceApiAxiosParamCreator=En,g.RoutingOutboundCallServiceApiFp=Xn,g.RoutingOutboundCallServiceApiFactory=function(d,_,h){return{createRoutingOutboundCall:function(e,t){return Xn(d).createRoutingOutboundCall(e,t).then(function(e){return e(h,_)})},deleteRoutingOutboundCall:function(e,t,n){return Xn(d).deleteRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},movePositionRoutingOutboundCall:function(e,t,n,r){return Xn(d).movePositionRoutingOutboundCall(e,t,n,r).then(function(e){return e(h,_)})},patchRoutingOutboundCall:function(e,t,n){return Xn(d).patchRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},readRoutingOutboundCall:function(e,t,n){return Xn(d).readRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},searchRoutingOutboundCall:function(e,t,n,r,i,a,s,o,u,c,l){return Xn(d).searchRoutingOutboundCall(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(h,_)})},updateRoutingOutboundCall:function(e,t,n){return Xn(d).updateRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})}}},g.RoutingOutboundCallServiceApi=jn,g.RoutingSchemaServiceApiAxiosParamCreator=Qn,g.RoutingSchemaServiceApiFp=Mn,g.RoutingSchemaServiceApiFactory=function(d,_,h){return{createRoutingSchema:function(e,t){return Mn(d).createRoutingSchema(e,t).then(function(e){return e(h,_)})},deleteRoutingSchema:function(e,t,n){return Mn(d).deleteRoutingSchema(e,t,n).then(function(e){return e(h,_)})},patchRoutingSchema:function(e,t,n){return Mn(d).patchRoutingSchema(e,t,n).then(function(e){return e(h,_)})},readRoutingSchema:function(e,t,n){return Mn(d).readRoutingSchema(e,t,n).then(function(e){return e(h,_)})},searchRoutingSchema:function(e,t,n,r,i,a,s,o,u,c,l){return Mn(d).searchRoutingSchema(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(h,_)})},searchRoutingSchemaTags:function(e,t,n,r,i,a,s){return Mn(d).searchRoutingSchemaTags(e,t,n,r,i,a,s).then(function(e){return e(h,_)})},updateRoutingSchema:function(e,t,n){return Mn(d).updateRoutingSchema(e,t,n).then(function(e){return e(h,_)})}}},g.RoutingSchemaServiceApi=Fn,g.RoutingVariableServiceApiAxiosParamCreator=Bn,g.RoutingVariableServiceApiFp=Dn,g.RoutingVariableServiceApiFactory=function(i,a,s){return{createRoutingVariable:function(e,t){return Dn(i).createRoutingVariable(e,t).then(function(e){return e(s,a)})},deleteRoutingVariable:function(e,t,n){return Dn(i).deleteRoutingVariable(e,t,n).then(function(e){return e(s,a)})},readRoutingVariable:function(e,t,n){return Dn(i).readRoutingVariable(e,t,n).then(function(e){return e(s,a)})},searchRoutingVariable:function(e,t,n,r){return Dn(i).searchRoutingVariable(e,t,n,r).then(function(e){return e(s,a)})},updateRoutingVariable:function(e,t,n){return Dn(i).updateRoutingVariable(e,t,n).then(function(e){return e(s,a)})}}},g.RoutingVariableServiceApi=Nn,g.SkillServiceApiAxiosParamCreator=Vn,g.SkillServiceApiFp=w,g.SkillServiceApiFactory=function(c,l,d){return{createSkill:function(e,t){return w(c).createSkill(e,t).then(function(e){return e(d,l)})},createSkillAgent:function(e,t,n){return w(c).createSkillAgent(e,t,n).then(function(e){return e(d,l)})},deleteSkill:function(e,t,n){return w(c).deleteSkill(e,t,n).then(function(e){return e(d,l)})},deleteSkillAgent:function(e,t,n){return w(c).deleteSkillAgent(e,t,n).then(function(e){return e(d,l)})},patchSkillAgent:function(e,t,n){return w(c).patchSkillAgent(e,t,n).then(function(e){return e(d,l)})},readSkill:function(e,t,n){return w(c).readSkill(e,t,n).then(function(e){return e(d,l)})},searchSkill:function(e,t,n,r,i,a,s){return w(c).searchSkill(e,t,n,r,i,a,s).then(function(e){return e(d,l)})},searchSkillAgent:function(e,t,n,r,i,a,s,o,u){return w(c).searchSkillAgent(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateSkill:function(e,t,n){return w(c).updateSkill(e,t,n).then(function(e){return e(d,l)})}}},g.SkillServiceApi=$n,g.TriggerServiceApiAxiosParamCreator=Zn,g.TriggerServiceApiFp=m,g.TriggerServiceApiFactory=function(p,f,g){return{createTrigger:function(e,t){return m(p).createTrigger(e,t).then(function(e){return e(g,f)})},createTriggerJob:function(e,t,n){return m(p).createTriggerJob(e,t,n).then(function(e){return e(g,f)})},deleteTrigger:function(e,t){return m(p).deleteTrigger(e,t).then(function(e){return e(g,f)})},patchTrigger:function(e,t,n){return m(p).patchTrigger(e,t,n).then(function(e){return e(g,f)})},readTrigger:function(e,t){return m(p).readTrigger(e,t).then(function(e){return e(g,f)})},searchTrigger:function(e,t,n,r,i,a,s,o){return m(p).searchTrigger(e,t,n,r,i,a,s,o).then(function(e){return e(g,f)})},searchTriggerJob:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){return m(p).searchTriggerJob(e,t,n,r,i,a,s,o,u,c,l,d,_,h).then(function(e){return e(g,f)})},updateTrigger:function(e,t,n){return m(p).updateTrigger(e,t,n).then(function(e){return e(g,f)})}}},g.TriggerServiceApi=tr,g.UserHelperServiceApiAxiosParamCreator=rr,g.UserHelperServiceApiFp=ir,g.UserHelperServiceApiFactory=function(n,r,i){return{defaultDeviceConfig:function(e,t){return ir(n).defaultDeviceConfig(e,t).then(function(e){return e(i,r)})}}},g.UserHelperServiceApi=sr,g.VariablesApiAxiosParamCreator=ur,g.VariablesApiFp=cr,g.VariablesApiFactory=function(u,c,l){return{deleteVariable:function(e,t,n,r){return cr(u).deleteVariable(e,t,n,r).then(function(e){return e(l,c)})},deleteVariables:function(e,t,n,r){return cr(u).deleteVariables(e,t,n,r).then(function(e){return e(l,c)})},listVariables:function(e,t,n,r,i,a,s,o){return cr(u).listVariables(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},mergeVariables:function(e,t,n,r){return cr(u).mergeVariables(e,t,n,r).then(function(e){return e(l,c)})},resetVariables:function(e,t,n,r){return cr(u).resetVariables(e,t,n,r).then(function(e){return e(l,c)})},updateVariable:function(e,t,n,r,i){return cr(u).updateVariable(e,t,n,r,i).then(function(e){return e(l,c)})},updateVariable2:function(e,t,n,r,i){return cr(u).updateVariable2(e,t,n,r,i).then(function(e){return e(l,c)})}}},g.VariablesApi=dr,g.Configuration=hr,g.Client=K,g.Call=Qr,g.Agent=jr,g.Conversation=Lr,g.DeviceNotFoundError=mr,g.DeviceNotAllowPermissionError=Cr,g.RolePermissionError=Kr,g.LicencePermissionError=Or,g.PauseNotAllowedError=Er,g.SipClient=ei,g.ExternalClient=ri,g.SipPhone=br,g.Log=pr,Object.defineProperty(g,"__esModule",{value:!0})});
2
2
  //# sourceMappingURL=index.umd.min.js.map