webitel-sdk 0.1.135 → 0.1.136

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/bundles/index.esm.min.js +1 -1
  2. package/bundles/index.umd.min.js +1 -1
  3. package/package.json +2 -2
  4. package/types/api/agent-pause-cause-service-api.d.ts +6 -6
  5. package/types/api/agent-service-api.d.ts +19 -19
  6. package/types/api/agent-skill-service-api.d.ts +7 -7
  7. package/types/api/agent-team-service-api.d.ts +5 -5
  8. package/types/api/backend-profile-service-api.d.ts +6 -6
  9. package/types/api/bucket-service-api.d.ts +5 -5
  10. package/types/api/calendar-service-api.d.ts +6 -6
  11. package/types/api/call-service-api.d.ts +15 -15
  12. package/types/api/cognitive-profile-service-api.d.ts +6 -6
  13. package/types/api/communication-type-service-api.d.ts +5 -5
  14. package/types/api/email-profile-service-api.d.ts +6 -6
  15. package/types/api/file-service-api.d.ts +1 -1
  16. package/types/api/file-transcript-service-api.d.ts +2 -2
  17. package/types/api/import-template-service-api.d.ts +6 -6
  18. package/types/api/list-service-api.d.ts +10 -10
  19. package/types/api/media-file-service-api.d.ts +3 -3
  20. package/types/api/member-service-api.d.ts +17 -17
  21. package/types/api/outbound-resource-group-service-api.d.ts +10 -10
  22. package/types/api/outbound-resource-service-api.d.ts +11 -11
  23. package/types/api/queue-bucket-service-api.d.ts +6 -6
  24. package/types/api/queue-hook-service-api.d.ts +6 -6
  25. package/types/api/queue-resources-service-api.d.ts +5 -5
  26. package/types/api/queue-service-api.d.ts +7 -7
  27. package/types/api/queue-skill-service-api.d.ts +6 -6
  28. package/types/api/region-service-api.d.ts +6 -6
  29. package/types/api/routing-chat-plan-service-api.d.ts +6 -6
  30. package/types/api/routing-outbound-call-service-api.d.ts +7 -7
  31. package/types/api/routing-schema-service-api.d.ts +6 -6
  32. package/types/api/routing-variable-service-api.d.ts +5 -5
  33. package/types/api/skill-service-api.d.ts +5 -5
  34. package/types/api/user-helper-service-api.d.ts +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(f,D,F,U,i,s){"use strict";U=U&&U.hasOwnProperty("default")?U.default:U;function e(e,t,n){void 0===t&&(t=G),void 0===n&&(n=U),this.basePath=t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}var r,G="https://dev.webitel.com/api".replace(/\/+$/,""),k=(r=Error,D.__extends(t,r),t);function t(e,t){var n=r.call(this,t)||this;return n.field=e,n.name="RequiredError",n}function l(f){var e=this;return{createAgentPauseCause:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createAgentPauseCause.");return t=F.parse("/call_center/pause_causes",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteAgentPauseCause:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteAgentPauseCause.");return t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),l),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},patchAgentPauseCause:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchAgentPauseCause.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchAgentPauseCause.");return t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readAgentPauseCause:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readAgentPauseCause.");return t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),l),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},searchAgentPauseCause:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/pause_causes",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},updateAgentPauseCause:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateAgentPauseCause.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateAgentPauseCause.");return t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function d(c){return{createAgentPauseCause:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,l(c).createAgentPauseCause(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteAgentPauseCause:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,l(c).deleteAgentPauseCause(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchAgentPauseCause:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,l(c).patchAgentPauseCause(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readAgentPauseCause:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,l(c).readAgentPauseCause(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentPauseCause:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,l(c).searchAgentPauseCause(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateAgentPauseCause:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,l(c).updateAgentPauseCause(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var n,a=(n=e,D.__extends(o,n),o.prototype.createAgentPauseCause=function(e,t){var n=this;return d(this.configuration).createAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},o.prototype.deleteAgentPauseCause=function(e,t){var n=this;return d(this.configuration).deleteAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},o.prototype.patchAgentPauseCause=function(e,t,n){var r=this;return d(this.configuration).patchAgentPauseCause(e,t,n).then(function(e){return e(r.axios,r.basePath)})},o.prototype.readAgentPauseCause=function(e,t){var n=this;return d(this.configuration).readAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},o.prototype.searchAgentPauseCause=function(e,t,n,r,i,a,s){var o=this;return d(this.configuration).searchAgentPauseCause(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},o.prototype.updateAgentPauseCause=function(e,t,n){var r=this;return d(this.configuration).updateAgentPauseCause(e,t,n).then(function(e){return e(r.axios,r.basePath)})},o);function o(){return null!==n&&n.apply(this,arguments)||this}function q(K){var e=this;return{agentSetState:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("agentId","Required parameter agentId was null or undefined when calling agentSetState.");if(null==d)throw new k("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(l))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},agentStateHistory:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("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(c))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),g),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.time_from=_),void 0!==h&&(s.time_to=h),void 0!==p&&(s.q=p),void 0!==f&&(s.domain_id=f),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),g.headers),[2,{url:F.format(n),options:i}]}})})},agentTodayStatistics:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("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(c))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return l&&(s.fields=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},createAgent:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createAgent.");return t=F.parse("/call_center/agents",!0),K&&(n=K.baseOptions),r=D.__assign(D.__assign({method:"POST"},n),l),i={},a={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteAgent:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteAgent.");return t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},patchAgent:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchAgent.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchAgent.");return t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readAgent:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readAgent.");return t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchAgent:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S){return void 0===S&&(S={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/agents",!0),K&&(n=K.baseOptions),r=D.__assign(D.__assign({method:"GET"},n),S),i={},a={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,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),t.query=D.__assign(D.__assign(D.__assign({},t.query),a),S.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),S.headers),[2,{url:F.format(t),options:r}]}})})},searchAgentCallStatistics:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/agents/reports/call",!0),K&&(n=K.baseOptions),r=D.__assign(D.__assign({method:"GET"},n),v),i={},a={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),v.headers),[2,{url:F.format(t),options:r}]}})})},searchAgentInQueue:function(c,l,d,_,h,p,f){return void 0===f&&(f={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling searchAgentInQueue.");return t="/call_center/agents/{id}/queues".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),f),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),f.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),f.headers),[2,{url:F.format(n),options:i}]}})})},searchAgentInQueueStatistics:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("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(c))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchAgentInTeam:function(c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling searchAgentInTeam.");return t="/call_center/agents/{id}/teams".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),p),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.domain_id=h),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),p.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),p.headers),[2,{url:F.format(n),options:i}]}})})},searchAgentStateHistory:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/agents/states/history",!0),K&&(n=K.baseOptions),r=D.__assign(D.__assign({method:"GET"},n),g),i={},a={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),g.headers),[2,{url:F.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={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/agents/reports/status",!0),K&&(n=K.baseOptions),r=D.__assign(D.__assign({method:"GET"},n),S),i={},a={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),S.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),S.headers),[2,{url:F.format(t),options:r}]}})})},searchAgentStatusStatisticItem:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("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(c))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),_),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s["time.from"]=l),void 0!==d&&(s["time.to"]=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},searchLookupUsersAgentNotExists:function(u,c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/lookups/agents/users",!0),K&&(n=K.baseOptions),r=D.__assign(D.__assign({method:"GET"},n),_),i={},a={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),_.headers),[2,{url:F.format(t),options:r}]}})})},searchPauseCauseForAgent:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("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(c))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.allow_change=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},updateAgent:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateAgent.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateAgent.");return t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},updateAgentStatus:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateAgentStatus.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateAgentStatus.");return t="/call_center/agents/{id}/status".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function A(m){return{agentSetState:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).agentSetState(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},agentStateHistory:function(t,n,i,a,s,o,u,c){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).agentStateHistory(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},agentTodayStatistics:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).agentTodayStatistics(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createAgent:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).createAgent(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteAgent:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).deleteAgent(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchAgent:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).patchAgent(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readAgent:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).readAgent(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgent:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgent(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentCallStatistics:function(t,n,i,a,s,o,u,c,l,d){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentCallStatistics(t,n,i,a,s,o,u,c,l,d)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentInQueue:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentInQueue(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentInQueueStatistics:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentInQueueStatistics(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentInTeam:function(t,n,i,a,s,o){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentInTeam(t,n,i,a,s,o)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentStateHistory:function(t,n,i,a,s,o,u,c,l){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentStateHistory(t,n,i,a,s,o,u,c,l)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentStatusStatistic:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentStatusStatistic(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentStatusStatisticItem:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentStatusStatisticItem(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchLookupUsersAgentNotExists:function(t,n,i,a,s){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchLookupUsersAgentNotExists(t,n,i,a,s)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchPauseCauseForAgent:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchPauseCauseForAgent(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateAgent:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).updateAgent(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateAgentStatus:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).updateAgentStatus(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var u,c=(u=e,D.__extends(_,u),_.prototype.agentSetState=function(e,t,n){var r=this;return A(this.configuration).agentSetState(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.agentStateHistory=function(e,t,n,r,i,a,s,o){var u=this;return A(this.configuration).agentStateHistory(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},_.prototype.agentTodayStatistics=function(e,t,n){var r=this;return A(this.configuration).agentTodayStatistics(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.createAgent=function(e,t){var n=this;return A(this.configuration).createAgent(e,t).then(function(e){return e(n.axios,n.basePath)})},_.prototype.deleteAgent=function(e,t,n){var r=this;return A(this.configuration).deleteAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.patchAgent=function(e,t,n){var r=this;return A(this.configuration).patchAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.readAgent=function(e,t,n){var r=this;return A(this.configuration).readAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.searchAgent=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y){var b=this;return A(this.configuration).searchAgent(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)})},_.prototype.searchAgentCallStatistics=function(e,t,n,r,i,a,s,o,u,c){var l=this;return A(this.configuration).searchAgentCallStatistics(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},_.prototype.searchAgentInQueue=function(e,t,n,r,i,a,s){var o=this;return A(this.configuration).searchAgentInQueue(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},_.prototype.searchAgentInQueueStatistics=function(e,t,n){var r=this;return A(this.configuration).searchAgentInQueueStatistics(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.searchAgentInTeam=function(e,t,n,r,i,a){var s=this;return A(this.configuration).searchAgentInTeam(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},_.prototype.searchAgentStateHistory=function(e,t,n,r,i,a,s,o,u){var c=this;return A(this.configuration).searchAgentStateHistory(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},_.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 A(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)})},_.prototype.searchAgentStatusStatisticItem=function(e,t,n,r){var i=this;return A(this.configuration).searchAgentStatusStatisticItem(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},_.prototype.searchLookupUsersAgentNotExists=function(e,t,n,r,i){var a=this;return A(this.configuration).searchLookupUsersAgentNotExists(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},_.prototype.searchPauseCauseForAgent=function(e,t,n){var r=this;return A(this.configuration).searchPauseCauseForAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.updateAgent=function(e,t,n){var r=this;return A(this.configuration).updateAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.updateAgentStatus=function(e,t,n){var r=this;return A(this.configuration).updateAgentStatus(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_);function _(){return null!==u&&u.apply(this,arguments)||this}function h(v){var e=this;return{createAgentSkill:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("agentId","Required parameter agentId was null or undefined when calling createAgentSkill.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling createAgentSkill.");return t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteAgentSkill:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("agentId","Required parameter agentId was null or undefined when calling deleteAgentSkill.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},patchAgentSkill:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("agentId","Required parameter agentId was null or undefined when calling patchAgentSkill.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling patchAgentSkill.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})},readAgentSkill:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("agentId","Required parameter agentId was null or undefined when calling readAgentSkill.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},searchAgentSkill:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("agentId","Required parameter agentId was null or undefined when calling searchAgentSkill.");return t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),g),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),g.headers),[2,{url:F.format(n),options:i}]}})})},searchLookupAgentNotExistsSkill:function(c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("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(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),p),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.domain_id=h),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),p.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),p.headers),[2,{url:F.format(n),options:i}]}})})},updateAgentSkill:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("agentId","Required parameter agentId was null or undefined when calling updateAgentSkill.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateAgentSkill.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function p(l){return{createAgentSkill:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).createAgentSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteAgentSkill:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).deleteAgentSkill(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchAgentSkill:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).patchAgentSkill(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readAgentSkill:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).readAgentSkill(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentSkill:function(t,n,i,a,s,o,u,c){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).searchAgentSkill(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchLookupAgentNotExistsSkill:function(t,n,i,a,s,o){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).searchLookupAgentNotExistsSkill(t,n,i,a,s,o)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateAgentSkill:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).updateAgentSkill(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var g,v=(g=e,D.__extends(y,g),y.prototype.createAgentSkill=function(e,t,n){var r=this;return p(this.configuration).createAgentSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},y.prototype.deleteAgentSkill=function(e,t,n,r){var i=this;return p(this.configuration).deleteAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},y.prototype.patchAgentSkill=function(e,t,n,r){var i=this;return p(this.configuration).patchAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},y.prototype.readAgentSkill=function(e,t,n,r){var i=this;return p(this.configuration).readAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},y.prototype.searchAgentSkill=function(e,t,n,r,i,a,s,o){var u=this;return p(this.configuration).searchAgentSkill(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},y.prototype.searchLookupAgentNotExistsSkill=function(e,t,n,r,i,a){var s=this;return p(this.configuration).searchLookupAgentNotExistsSkill(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},y.prototype.updateAgentSkill=function(e,t,n,r){var i=this;return p(this.configuration).updateAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},y);function y(){return null!==g&&g.apply(this,arguments)||this}function b(v){var e=this;return{createAgentTeam:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createAgentTeam.");return t=F.parse("/call_center/teams",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteAgentTeam:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteAgentTeam.");return t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readAgentTeam:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readAgentTeam.");return t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchAgentTeam:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/teams",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),g.headers),[2,{url:F.format(t),options:r}]}})})},updateAgentTeam:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateAgentTeam.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateAgentTeam.");return t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function w(d){return{createAgentTeam:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,b(d).createAgentTeam(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteAgentTeam:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,b(d).deleteAgentTeam(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readAgentTeam:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,b(d).readAgentTeam(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentTeam:function(t,n,i,a,s,o,u,c,l){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,b(d).searchAgentTeam(t,n,i,a,s,o,u,c,l)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateAgentTeam:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,b(d).updateAgentTeam(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var m,C=(m=e,D.__extends(R,m),R.prototype.createAgentTeam=function(e,t){var n=this;return w(this.configuration).createAgentTeam(e,t).then(function(e){return e(n.axios,n.basePath)})},R.prototype.deleteAgentTeam=function(e,t,n){var r=this;return w(this.configuration).deleteAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})},R.prototype.readAgentTeam=function(e,t,n){var r=this;return w(this.configuration).readAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})},R.prototype.searchAgentTeam=function(e,t,n,r,i,a,s,o,u){var c=this;return w(this.configuration).searchAgentTeam(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},R.prototype.updateAgentTeam=function(e,t,n){var r=this;return w(this.configuration).updateAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})},R);function R(){return null!==m&&m.apply(this,arguments)||this}function S(f){var e=this;return{createBackendProfile:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createBackendProfile.");return t=F.parse("/storage/backend_profiles",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteBackendProfile:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteBackendProfile.");return t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},patchBackendProfile:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchBackendProfile.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchBackendProfile.");return t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readBackendProfile:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readBackendProfile.");return t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchBackendProfile:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/storage/backend_profiles",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},updateBackendProfile:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateBackendProfile.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateBackendProfile.");return t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function K(c){return{createBackendProfile:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,S(c).createBackendProfile(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteBackendProfile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,S(c).deleteBackendProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchBackendProfile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,S(c).patchBackendProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readBackendProfile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,S(c).readBackendProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchBackendProfile:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,S(c).searchBackendProfile(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateBackendProfile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,S(c).updateBackendProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var P,O=(P=e,D.__extends(T,P),T.prototype.createBackendProfile=function(e,t){var n=this;return K(this.configuration).createBackendProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},T.prototype.deleteBackendProfile=function(e,t,n){var r=this;return K(this.configuration).deleteBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},T.prototype.patchBackendProfile=function(e,t,n){var r=this;return K(this.configuration).patchBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},T.prototype.readBackendProfile=function(e,t,n){var r=this;return K(this.configuration).readBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},T.prototype.searchBackendProfile=function(e,t,n,r,i,a,s){var o=this;return K(this.configuration).searchBackendProfile(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},T.prototype.updateBackendProfile=function(e,t,n){var r=this;return K(this.configuration).updateBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},T);function T(){return null!==P&&P.apply(this,arguments)||this}function I(f){var e=this;return{createBucket:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createBucket.");return t=F.parse("/call_center/buckets",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteBucket:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteBucket.");return t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readBucket:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readBucket.");return t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchBucket:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/buckets",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},updateBucket:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateBucket.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateBucket.");return t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function W(c){return{createBucket:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,I(c).createBucket(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteBucket:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,I(c).deleteBucket(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readBucket:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,I(c).readBucket(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchBucket:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,I(c).searchBucket(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateBucket:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,I(c).updateBucket(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var X,x=(X=e,D.__extends(E,X),E.prototype.createBucket=function(e,t){var n=this;return W(this.configuration).createBucket(e,t).then(function(e){return e(n.axios,n.basePath)})},E.prototype.deleteBucket=function(e,t,n){var r=this;return W(this.configuration).deleteBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},E.prototype.readBucket=function(e,t,n){var r=this;return W(this.configuration).readBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},E.prototype.searchBucket=function(e,t,n,r,i,a,s){var o=this;return W(this.configuration).searchBucket(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},E.prototype.updateBucket=function(e,t,n){var r=this;return W(this.configuration).updateBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},E);function E(){return null!==X&&X.apply(this,arguments)||this}function Q(f){var e=this;return{createCalendar:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createCalendar.");return t=F.parse("/calendars",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteCalendar:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteCalendar.");return t="/calendars/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readCalendar:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readCalendar.");return t="/calendars/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchCalendar:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/calendars",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},searchTimezones:function(u,c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/calendars/timezones",!0),f&&(n=f.baseOptions),r=D.__assign(D.__assign({method:"GET"},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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),d.headers),[2,{url:F.format(t),options:r}]}})})},updateCalendar:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateCalendar.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateCalendar.");return t="/calendars/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function j(c){return{createCalendar:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Q(c).createCalendar(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteCalendar:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Q(c).deleteCalendar(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readCalendar:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Q(c).readCalendar(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchCalendar:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Q(c).searchCalendar(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchTimezones:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Q(c).searchTimezones(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateCalendar:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Q(c).updateCalendar(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var B,M=(B=e,D.__extends(H,B),H.prototype.createCalendar=function(e,t){var n=this;return j(this.configuration).createCalendar(e,t).then(function(e){return e(n.axios,n.basePath)})},H.prototype.deleteCalendar=function(e,t,n){var r=this;return j(this.configuration).deleteCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})},H.prototype.readCalendar=function(e,t,n){var r=this;return j(this.configuration).readCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})},H.prototype.searchCalendar=function(e,t,n,r,i,a,s){var o=this;return j(this.configuration).searchCalendar(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},H.prototype.searchTimezones=function(e,t,n,r){var i=this;return j(this.configuration).searchTimezones(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},H.prototype.updateCalendar=function(e,t,n){var r=this;return j(this.configuration).updateCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})},H);function H(){return null!==B&&B.apply(this,arguments)||this}function L(L){var e=this;return{aggregateHistoryCall:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling aggregateHistoryCall.");return t=F.parse("/calls/history/aggregate",!0),L&&(n=L.baseOptions),r=D.__assign(D.__assign({method:"POST"},n),l),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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},blindTransferCall:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling blindTransferCall.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling blindTransferCall.");return t="/calls/active/{id}/transfer".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},confirmPush:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling confirmPush.");return t="/calls/active/{id}/confirm_push".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),l),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},createCall:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createCall.");return t=F.parse("/calls",!0),L&&(n=L.baseOptions),r=D.__assign(D.__assign({method:"POST"},n),l),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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},createCallAnnotation:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("callId","Required parameter callId was null or undefined when calling createCallAnnotation.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling createCallAnnotation.");return t="/calls/history/{call_id}/annotation".replace("{call_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteCallAnnotation:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("callId","Required parameter callId was null or undefined when calling deleteCallAnnotation.");if(null==l)throw new k("id","Required parameter id was null or undefined when calling deleteCallAnnotation.");return t="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},dtmfCall:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling dtmfCall.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling dtmfCall.");return t="/calls/active/{id}/dtmf".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},eavesdropCall:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling eavesdropCall.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling eavesdropCall.");return t="/calls/active/{id}/eavesdrop".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},hangupCall:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling hangupCall.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling hangupCall.");return t="/calls/active/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),_),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},holdCall:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling holdCall.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling holdCall.");return t="/calls/active/{id}/hold".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readCall:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readCall.");return t="/calls/active/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchActiveCall:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,T,k,I,W,X,x,E,Q){return void 0===Q&&(Q={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/calls/active",!0),L&&(n=L.baseOptions),r=D.__assign(D.__assign({method:"GET"},n),Q),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:i["X-Webitel-Access"]=s,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),O&&(a.direction=O),void 0!==T&&(a["answered_at.from"]=T),void 0!==k&&(a["answered_at.to"]=k),void 0!==I&&(a.missed=I),void 0!==W&&(a["stored_at.from"]=W),void 0!==X&&(a["stored_at.to"]=X),x&&(a.supervisor_id=x),E&&(a.state=E),t.query=D.__assign(D.__assign(D.__assign({},t.query),a),Q.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),Q.headers),[2,{url:F.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,O,T,k,I,W,X,x,E,Q,j,U,G,B,M,H){return void 0===H&&(H={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/calls/history",!0),L&&(n=L.baseOptions),r=D.__assign(D.__assign({method:"GET"},n),H),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:i["X-Webitel-Access"]=s,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!==O&&(a.direction=O),void 0!==T&&(a["answered_at.from"]=T),void 0!==k&&(a["answered_at.to"]=k),void 0!==I&&(a.missed=I),void 0!==W&&(a["stored_at.from"]=W),void 0!==X&&(a["stored_at.to"]=X),x&&(a.id=x),E&&(a.transfer_from=E),Q&&(a.transfer_to=Q),j&&(a.dependency_id=j),U&&(a.tags=U),G&&(a.amd_result=G),void 0!==B&&(a.fts=B),M&&(a.directions=M),t.query=D.__assign(D.__assign(D.__assign({},t.query),a),H.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),H.headers),[2,{url:F.format(t),options:r}]}})})},unHoldCall:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling unHoldCall.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling unHoldCall.");return t="/calls/active/{id}/unhold".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},updateCallAnnotation:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("callId","Required parameter callId was null or undefined when calling updateCallAnnotation.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateCallAnnotation.");if(null==_)throw new k("body","Required parameter body was null or undefined when calling updateCallAnnotation.");return t="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function N(j){return{aggregateHistoryCall:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).aggregateHistoryCall(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},blindTransferCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).blindTransferCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},confirmPush:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).confirmPush(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createCall:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).createCall(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createCallAnnotation:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).createCallAnnotation(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteCallAnnotation:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).deleteCallAnnotation(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},dtmfCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).dtmfCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},eavesdropCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).eavesdropCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},hangupCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).hangupCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},holdCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).holdCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).readCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchActiveCall:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,T,k){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).searchActiveCall(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,T,k)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchHistoryCall:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,T,k,I,W,X,x,E,Q){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).searchHistoryCall(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,T,k,I,W,X,x,E,Q)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},unHoldCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).unHoldCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateCallAnnotation:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).updateCallAnnotation(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var J,z=(J=e,D.__extends(V,J),V.prototype.aggregateHistoryCall=function(e,t){var n=this;return N(this.configuration).aggregateHistoryCall(e,t).then(function(e){return e(n.axios,n.basePath)})},V.prototype.blindTransferCall=function(e,t,n){var r=this;return N(this.configuration).blindTransferCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.confirmPush=function(e,t){var n=this;return N(this.configuration).confirmPush(e,t).then(function(e){return e(n.axios,n.basePath)})},V.prototype.createCall=function(e,t){var n=this;return N(this.configuration).createCall(e,t).then(function(e){return e(n.axios,n.basePath)})},V.prototype.createCallAnnotation=function(e,t,n){var r=this;return N(this.configuration).createCallAnnotation(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.deleteCallAnnotation=function(e,t,n){var r=this;return N(this.configuration).deleteCallAnnotation(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.dtmfCall=function(e,t,n){var r=this;return N(this.configuration).dtmfCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.eavesdropCall=function(e,t,n){var r=this;return N(this.configuration).eavesdropCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.hangupCall=function(e,t,n){var r=this;return N(this.configuration).hangupCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.holdCall=function(e,t,n){var r=this;return N(this.configuration).holdCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.readCall=function(e,t,n){var r=this;return N(this.configuration).readCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.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,O){var T=this;return N(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,O).then(function(e){return e(T.axios,T.basePath)})},V.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,O,T,k,I,W,X,x){var E=this;return N(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,O,T,k,I,W,X,x).then(function(e){return e(E.axios,E.basePath)})},V.prototype.unHoldCall=function(e,t,n){var r=this;return N(this.configuration).unHoldCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.updateCallAnnotation=function(e,t,n,r){var i=this;return N(this.configuration).updateCallAnnotation(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},V);function V(){return null!==J&&J.apply(this,arguments)||this}function $(v){var e=this;return{createCognitiveProfile:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createCognitiveProfile.");return t=F.parse("/storage/cognitive_profiles",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteCognitiveProfile:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteCognitiveProfile.");return t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),l),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},patchCognitiveProfile:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchCognitiveProfile.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchCognitiveProfile.");return t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readCognitiveProfile:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readCognitiveProfile.");return t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),l),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},searchCognitiveProfile:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/storage/cognitive_profiles",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),g.headers),[2,{url:F.format(t),options:r}]}})})},updateCognitiveProfile:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateCognitiveProfile.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateCognitiveProfile.");return t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function Y(d){return{createCognitiveProfile:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,$(d).createCognitiveProfile(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteCognitiveProfile:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,$(d).deleteCognitiveProfile(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchCognitiveProfile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,$(d).patchCognitiveProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readCognitiveProfile:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,$(d).readCognitiveProfile(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchCognitiveProfile:function(t,n,i,a,s,o,u,c,l){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,$(d).searchCognitiveProfile(t,n,i,a,s,o,u,c,l)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateCognitiveProfile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,$(d).updateCognitiveProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Z,ee=(Z=e,D.__extends(te,Z),te.prototype.createCognitiveProfile=function(e,t){var n=this;return Y(this.configuration).createCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},te.prototype.deleteCognitiveProfile=function(e,t){var n=this;return Y(this.configuration).deleteCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},te.prototype.patchCognitiveProfile=function(e,t,n){var r=this;return Y(this.configuration).patchCognitiveProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},te.prototype.readCognitiveProfile=function(e,t){var n=this;return Y(this.configuration).readCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},te.prototype.searchCognitiveProfile=function(e,t,n,r,i,a,s,o,u){var c=this;return Y(this.configuration).searchCognitiveProfile(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},te.prototype.updateCognitiveProfile=function(e,t,n){var r=this;return Y(this.configuration).updateCognitiveProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},te);function te(){return null!==Z&&Z.apply(this,arguments)||this}function ne(f){var e=this;return{createCommunicationType:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createCommunicationType.");return t=F.parse("/call_center/communication_type",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteCommunicationType:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteCommunicationType.");return t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readCommunicationType:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readCommunicationType.");return t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchCommunicationType:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/communication_type",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},updateCommunicationType:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateCommunicationType.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateCommunicationType.");return t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function re(c){return{createCommunicationType:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ne(c).createCommunicationType(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteCommunicationType:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ne(c).deleteCommunicationType(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readCommunicationType:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ne(c).readCommunicationType(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchCommunicationType:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ne(c).searchCommunicationType(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateCommunicationType:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ne(c).updateCommunicationType(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var ie,ae=(ie=e,D.__extends(se,ie),se.prototype.createCommunicationType=function(e,t){var n=this;return re(this.configuration).createCommunicationType(e,t).then(function(e){return e(n.axios,n.basePath)})},se.prototype.deleteCommunicationType=function(e,t,n){var r=this;return re(this.configuration).deleteCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})},se.prototype.readCommunicationType=function(e,t,n){var r=this;return re(this.configuration).readCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})},se.prototype.searchCommunicationType=function(e,t,n,r,i,a,s){var o=this;return re(this.configuration).searchCommunicationType(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},se.prototype.updateCommunicationType=function(e,t,n){var r=this;return re(this.configuration).updateCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})},se);function se(){return null!==ie&&ie.apply(this,arguments)||this}function oe(p){var e=this;return{createEmailProfile:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createEmailProfile.");return t=F.parse("/email/profile",!0),p&&(n=p.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteEmailProfile:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteEmailProfile.");return t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),p&&(r=p.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),l),a={},s={},p&&p.apiKey?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},patchEmailProfile:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchEmailProfile.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchEmailProfile.");return t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),p&&(r=p.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},p&&p.apiKey?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readEmailProfile:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readEmailProfile.");return t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),p&&(r=p.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),l),a={},s={},p&&p.apiKey?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},searchEmailProfile:function(u,c,l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/email/profile",!0),p&&(n=p.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),h.headers),[2,{url:F.format(t),options:r}]}})})},updateEmailProfile:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateEmailProfile.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateEmailProfile.");return t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),p&&(r=p.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},p&&p.apiKey?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function ue(u){return{createEmailProfile:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,oe(u).createEmailProfile(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteEmailProfile:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,oe(u).deleteEmailProfile(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchEmailProfile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,oe(u).patchEmailProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readEmailProfile:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,oe(u).readEmailProfile(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchEmailProfile:function(t,n,i,a,s,o){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,oe(u).searchEmailProfile(t,n,i,a,s,o)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateEmailProfile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,oe(u).updateEmailProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var ce,le=(ce=e,D.__extends(de,ce),de.prototype.createEmailProfile=function(e,t){var n=this;return ue(this.configuration).createEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},de.prototype.deleteEmailProfile=function(e,t){var n=this;return ue(this.configuration).deleteEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},de.prototype.patchEmailProfile=function(e,t,n){var r=this;return ue(this.configuration).patchEmailProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},de.prototype.readEmailProfile=function(e,t){var n=this;return ue(this.configuration).readEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},de.prototype.searchEmailProfile=function(e,t,n,r,i,a){var s=this;return ue(this.configuration).searchEmailProfile(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},de.prototype.updateEmailProfile=function(e,t,n){var r=this;return ue(this.configuration).updateEmailProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},de);function de(){return null!==ce&&ce.apply(this,arguments)||this}function _e(d){var e=this;return{deleteFiles:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling deleteFiles.");return t=F.parse("/storage/file",!0),d&&(n=d.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})}}}function he(i){return{deleteFiles:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,_e(i).deleteFiles(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var pe,fe=(pe=e,D.__extends(ge,pe),ge.prototype.deleteFiles=function(e,t){var n=this;return he(this.configuration).deleteFiles(e,t).then(function(e){return e(n.axios,n.basePath)})},ge);function ge(){return null!==pe&&pe.apply(this,arguments)||this}function ve(h){var e=this;return{createFileTranscript:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createFileTranscript.");return t=F.parse("/storage/transcript_file",!0),h&&(n=h.baseOptions),r=D.__assign(D.__assign({method:"POST"},n),l),i={},a={},h&&h.apiKey?"function"!=typeof h.apiKey?[3,2]:[4,h.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,h.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},getFileTranscriptPhrases:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling getFileTranscriptPhrases.");return t="/storage/transcript_file/{id}/phrases".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),h&&(r=h.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),_),a={},s={},h&&h.apiKey?"function"!=typeof h.apiKey?[3,2]:[4,h.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,h.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})}}}function ye(s){return{createFileTranscript:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ve(s).createFileTranscript(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},getFileTranscriptPhrases:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ve(s).getFileTranscriptPhrases(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var be,we=(be=e,D.__extends(me,be),me.prototype.createFileTranscript=function(e,t){var n=this;return ye(this.configuration).createFileTranscript(e,t).then(function(e){return e(n.axios,n.basePath)})},me.prototype.getFileTranscriptPhrases=function(e,t,n,r){var i=this;return ye(this.configuration).getFileTranscriptPhrases(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},me);function me(){return null!==be&&be.apply(this,arguments)||this}function qe(f){var e=this;return{createImportTemplate:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createImportTemplate.");return t=F.parse("/storage/import_templates",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteImportTemplate:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteImportTemplate.");return t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),l),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},patchImportTemplate:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchImportTemplate.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchImportTemplate.");return t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readImportTemplate:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readImportTemplate.");return t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),l),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},searchImportTemplate:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/storage/import_templates",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},updateImportTemplate:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateImportTemplate.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateImportTemplate.");return t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function Ae(c){return{createImportTemplate:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,qe(c).createImportTemplate(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteImportTemplate:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,qe(c).deleteImportTemplate(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchImportTemplate:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,qe(c).patchImportTemplate(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readImportTemplate:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,qe(c).readImportTemplate(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchImportTemplate:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,qe(c).searchImportTemplate(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateImportTemplate:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,qe(c).updateImportTemplate(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Ce,Re=(Ce=e,D.__extends(Se,Ce),Se.prototype.createImportTemplate=function(e,t){var n=this;return Ae(this.configuration).createImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},Se.prototype.deleteImportTemplate=function(e,t){var n=this;return Ae(this.configuration).deleteImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},Se.prototype.patchImportTemplate=function(e,t,n){var r=this;return Ae(this.configuration).patchImportTemplate(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Se.prototype.readImportTemplate=function(e,t){var n=this;return Ae(this.configuration).readImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},Se.prototype.searchImportTemplate=function(e,t,n,r,i,a,s){var o=this;return Ae(this.configuration).searchImportTemplate(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Se.prototype.updateImportTemplate=function(e,t,n){var r=this;return Ae(this.configuration).updateImportTemplate(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Se);function Se(){return null!==Ce&&Ce.apply(this,arguments)||this}function Ke(v){var e=this;return{createList:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createList.");return t=F.parse("/call_center/list",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},createListCommunication:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("listId","Required parameter listId was null or undefined when calling createListCommunication.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling createListCommunication.");return t="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteList:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteList.");return t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},deleteListCommunication:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("listId","Required parameter listId was null or undefined when calling deleteListCommunication.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},readList:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readList.");return t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readListCommunication:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("listId","Required parameter listId was null or undefined when calling readListCommunication.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},searchList:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/list",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},searchListCommunication:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("listId","Required parameter listId was null or undefined when calling searchListCommunication.");return t="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),g),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),g.headers),[2,{url:F.format(n),options:i}]}})})},updateList:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateList.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateList.");return t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},updateListCommunication:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("listId","Required parameter listId was null or undefined when calling updateListCommunication.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateListCommunication.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function Pe(l){return{createList:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).createList(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createListCommunication:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).createListCommunication(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteList:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).deleteList(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteListCommunication:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).deleteListCommunication(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readList:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).readList(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readListCommunication:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).readListCommunication(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchList:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).searchList(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchListCommunication:function(t,n,i,a,s,o,u,c){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).searchListCommunication(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateList:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).updateList(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateListCommunication:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).updateListCommunication(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Oe,Te=(Oe=e,D.__extends(ke,Oe),ke.prototype.createList=function(e,t){var n=this;return Pe(this.configuration).createList(e,t).then(function(e){return e(n.axios,n.basePath)})},ke.prototype.createListCommunication=function(e,t,n){var r=this;return Pe(this.configuration).createListCommunication(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ke.prototype.deleteList=function(e,t,n){var r=this;return Pe(this.configuration).deleteList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ke.prototype.deleteListCommunication=function(e,t,n,r){var i=this;return Pe(this.configuration).deleteListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},ke.prototype.readList=function(e,t,n){var r=this;return Pe(this.configuration).readList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ke.prototype.readListCommunication=function(e,t,n,r){var i=this;return Pe(this.configuration).readListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},ke.prototype.searchList=function(e,t,n,r,i,a,s){var o=this;return Pe(this.configuration).searchList(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},ke.prototype.searchListCommunication=function(e,t,n,r,i,a,s,o){var u=this;return Pe(this.configuration).searchListCommunication(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},ke.prototype.updateList=function(e,t,n){var r=this;return Pe(this.configuration).updateList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ke.prototype.updateListCommunication=function(e,t,n,r){var i=this;return Pe(this.configuration).updateListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},ke);function ke(){return null!==Oe&&Oe.apply(this,arguments)||this}function Ie(f){var e=this;return{deleteMediaFile:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteMediaFile.");return t="/storage/media/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readMediaFile:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readMediaFile.");return t="/storage/media/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchMediaFile:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/storage/media",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})}}}function We(c){return{deleteMediaFile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ie(c).deleteMediaFile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readMediaFile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ie(c).readMediaFile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchMediaFile:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ie(c).searchMediaFile(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Xe,xe=(Xe=e,D.__extends(Ee,Xe),Ee.prototype.deleteMediaFile=function(e,t,n){var r=this;return We(this.configuration).deleteMediaFile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ee.prototype.readMediaFile=function(e,t,n){var r=this;return We(this.configuration).readMediaFile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ee.prototype.searchMediaFile=function(e,t,n,r,i,a,s){var o=this;return We(this.configuration).searchMediaFile(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Ee);function Ee(){return null!==Xe&&Xe.apply(this,arguments)||this}function Qe(T){var e=this;return{attemptCallback:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("attemptId","Required parameter attemptId was null or undefined when calling attemptCallback.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling attemptCallback.");return t="/call_center/attempts/{attempt_id}".replace("{attempt_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},attemptResult:function(l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling attemptResult.");if(null==d)throw new k("memberId","Required parameter memberId was null or undefined when calling attemptResult.");if(null==_)throw new k("attemptId","Required parameter attemptId was null or undefined when calling attemptResult.");if(null==h)throw new k("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(l))).replace("{member_id}",encodeURIComponent(String(d))).replace("{attempt_id}",encodeURIComponent(String(_))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),p),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),p.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),p.headers),c="string"!=typeof h||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==h?h:{}):h||"",[2,{url:F.format(n),options:i}]}})})},attemptsRenewalResult:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("attemptId","Required parameter attemptId was null or undefined when calling attemptsRenewalResult.");if(null==d)throw new k("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(l))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},createAttempt:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling createAttempt.");if(null==d)throw new k("memberId","Required parameter memberId was null or undefined when calling createAttempt.");if(null==_)throw new k("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(l))).replace("{member_id}",encodeURIComponent(String(d))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),h),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})},createMember:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling createMember.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling createMember.");return t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},createMemberBulk:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling createMemberBulk.");if(null==d)throw new k("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(l))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteMember:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling deleteMember.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),_),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},deleteMembers:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling deleteMembers.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling deleteMembers.");return t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),_),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},patchMember:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling patchMember.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling patchMember.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),h),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})},readMember:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling readMember.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),_),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},resetMembers:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling resetMembers.");if(null==d)throw new k("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(l))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},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={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/queues/attempts/active",!0),T&&(n=T.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),K.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),K.headers),[2,{url:F.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={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/queues/attempts/history",!0),T&&(n=T.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),K.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),K.headers),[2,{url:F.format(t),options:r}]}})})},searchMemberAttempts:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling searchMemberAttempts.");if(null==l)throw new k("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(c))).replace("{member_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),_),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},searchMemberInQueue:function(c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O){return void 0===O&&(O={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling searchMemberInQueue.");return t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(c))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),O),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),g&&(s.bucket_id=g),void 0!==v&&(s.destination=v),void 0!==y&&(s["created_at.from"]=y),void 0!==b&&(s["created_at.to"]=b),void 0!==w&&(s["offering_at.from"]=w),void 0!==m&&(s["offering_at.to"]=m),q&&(s.stop_cause=q),void 0!==A&&(s["priority.from"]=A),void 0!==C&&(s["priority.to"]=C),void 0!==R&&(s.name=R),void 0!==S&&(s["attempts.from"]=S),void 0!==K&&(s["attempts.to"]=K),P&&(s.agent_id=P),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),O.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),O.headers),[2,{url:F.format(n),options:i}]}})})},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={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/members",!0),T&&(n=T.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),P.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),P.headers),[2,{url:F.format(t),options:r}]}})})},updateMember:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling updateMember.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateMember.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function je(A){return{attemptCallback:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).attemptCallback(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},attemptResult:function(t,n,i,a,s){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).attemptResult(t,n,i,a,s)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},attemptsRenewalResult:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).attemptsRenewalResult(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createAttempt:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).createAttempt(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createMember:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).createMember(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createMemberBulk:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).createMemberBulk(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteMember:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).deleteMember(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteMembers:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).deleteMembers(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchMember:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).patchMember(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readMember:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).readMember(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},resetMembers:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).resetMembers(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAttempts:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).searchAttempts(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAttemptsHistory:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).searchAttemptsHistory(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchMemberAttempts:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).searchMemberAttempts(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchMemberInQueue:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).searchMemberInQueue(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchMembers:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).searchMembers(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateMember:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).updateMember(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Ue,Ge=(Ue=e,D.__extends(Be,Ue),Be.prototype.attemptCallback=function(e,t,n){var r=this;return je(this.configuration).attemptCallback(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Be.prototype.attemptResult=function(e,t,n,r,i){var a=this;return je(this.configuration).attemptResult(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},Be.prototype.attemptsRenewalResult=function(e,t,n){var r=this;return je(this.configuration).attemptsRenewalResult(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Be.prototype.createAttempt=function(e,t,n,r){var i=this;return je(this.configuration).createAttempt(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Be.prototype.createMember=function(e,t,n){var r=this;return je(this.configuration).createMember(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Be.prototype.createMemberBulk=function(e,t,n){var r=this;return je(this.configuration).createMemberBulk(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Be.prototype.deleteMember=function(e,t,n,r){var i=this;return je(this.configuration).deleteMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Be.prototype.deleteMembers=function(e,t,n){var r=this;return je(this.configuration).deleteMembers(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Be.prototype.patchMember=function(e,t,n,r){var i=this;return je(this.configuration).patchMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Be.prototype.readMember=function(e,t,n,r){var i=this;return je(this.configuration).readMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Be.prototype.resetMembers=function(e,t,n){var r=this;return je(this.configuration).resetMembers(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Be.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 je(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)})},Be.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 je(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)})},Be.prototype.searchMemberAttempts=function(e,t,n,r){var i=this;return je(this.configuration).searchMemberAttempts(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Be.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 je(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)})},Be.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 je(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)})},Be.prototype.updateMember=function(e,t,n,r){var i=this;return je(this.configuration).updateMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Be);function Be(){return null!==Ue&&Ue.apply(this,arguments)||this}function Me(v){var e=this;return{createOutboundResourceGroup:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createOutboundResourceGroup.");return t=F.parse("/call_center/resource_group",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},createOutboundResourceInGroup:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("groupId","Required parameter groupId was null or undefined when calling createOutboundResourceInGroup.");if(null==d)throw new k("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(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteOutboundResourceGroup:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteOutboundResourceGroup.");return t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},deleteOutboundResourceInGroup:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("groupId","Required parameter groupId was null or undefined when calling deleteOutboundResourceInGroup.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},readOutboundResourceGroup:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readOutboundResourceGroup.");return t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readOutboundResourceInGroup:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("groupId","Required parameter groupId was null or undefined when calling readOutboundResourceInGroup.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},searchOutboundResourceGroup:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/resource_group",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},searchOutboundResourceInGroup:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("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(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),g),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),g.headers),[2,{url:F.format(n),options:i}]}})})},updateOutboundResourceGroup:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateOutboundResourceGroup.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateOutboundResourceGroup.");return t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},updateOutboundResourceInGroup:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("groupId","Required parameter groupId was null or undefined when calling updateOutboundResourceInGroup.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateOutboundResourceInGroup.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function He(l){return{createOutboundResourceGroup:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).createOutboundResourceGroup(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createOutboundResourceInGroup:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).createOutboundResourceInGroup(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteOutboundResourceGroup:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).deleteOutboundResourceGroup(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteOutboundResourceInGroup:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).deleteOutboundResourceInGroup(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readOutboundResourceGroup:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).readOutboundResourceGroup(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readOutboundResourceInGroup:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).readOutboundResourceInGroup(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchOutboundResourceGroup:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).searchOutboundResourceGroup(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchOutboundResourceInGroup:function(t,n,i,a,s,o,u,c){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).searchOutboundResourceInGroup(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateOutboundResourceGroup:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).updateOutboundResourceGroup(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateOutboundResourceInGroup:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).updateOutboundResourceInGroup(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Le,De=(Le=e,D.__extends(Fe,Le),Fe.prototype.createOutboundResourceGroup=function(e,t){var n=this;return He(this.configuration).createOutboundResourceGroup(e,t).then(function(e){return e(n.axios,n.basePath)})},Fe.prototype.createOutboundResourceInGroup=function(e,t,n){var r=this;return He(this.configuration).createOutboundResourceInGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Fe.prototype.deleteOutboundResourceGroup=function(e,t,n){var r=this;return He(this.configuration).deleteOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Fe.prototype.deleteOutboundResourceInGroup=function(e,t,n,r){var i=this;return He(this.configuration).deleteOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Fe.prototype.readOutboundResourceGroup=function(e,t,n){var r=this;return He(this.configuration).readOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Fe.prototype.readOutboundResourceInGroup=function(e,t,n,r){var i=this;return He(this.configuration).readOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Fe.prototype.searchOutboundResourceGroup=function(e,t,n,r,i,a,s){var o=this;return He(this.configuration).searchOutboundResourceGroup(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Fe.prototype.searchOutboundResourceInGroup=function(e,t,n,r,i,a,s,o){var u=this;return He(this.configuration).searchOutboundResourceInGroup(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},Fe.prototype.updateOutboundResourceGroup=function(e,t,n){var r=this;return He(this.configuration).updateOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Fe.prototype.updateOutboundResourceInGroup=function(e,t,n,r){var i=this;return He(this.configuration).updateOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Fe);function Fe(){return null!==Le&&Le.apply(this,arguments)||this}function Ne(v){var e=this;return{createOutboundResource:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createOutboundResource.");return t=F.parse("/call_center/resources",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},createOutboundResourceDisplay:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("resourceId","Required parameter resourceId was null or undefined when calling createOutboundResourceDisplay.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling createOutboundResourceDisplay.");return t="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteOutboundResource:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteOutboundResource.");return t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},deleteOutboundResourceDisplay:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("resourceId","Required parameter resourceId was null or undefined when calling deleteOutboundResourceDisplay.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},patchOutboundResource:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchOutboundResource.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchOutboundResource.");return t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readOutboundResource:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readOutboundResource.");return t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readOutboundResourceDisplay:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("resourceId","Required parameter resourceId was null or undefined when calling readOutboundResourceDisplay.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},searchOutboundResource:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/resources",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},searchOutboundResourceDisplay:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("resourceId","Required parameter resourceId was null or undefined when calling searchOutboundResourceDisplay.");return t="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),g),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),g.headers),[2,{url:F.format(n),options:i}]}})})},updateOutboundResource:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateOutboundResource.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateOutboundResource.");return t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},updateOutboundResourceDisplay:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("resourceId","Required parameter resourceId was null or undefined when calling updateOutboundResourceDisplay.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateOutboundResourceDisplay.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function Je(l){return{createOutboundResource:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).createOutboundResource(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createOutboundResourceDisplay:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).createOutboundResourceDisplay(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteOutboundResource:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).deleteOutboundResource(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteOutboundResourceDisplay:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).deleteOutboundResourceDisplay(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchOutboundResource:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).patchOutboundResource(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readOutboundResource:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).readOutboundResource(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readOutboundResourceDisplay:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).readOutboundResourceDisplay(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchOutboundResource:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).searchOutboundResource(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchOutboundResourceDisplay:function(t,n,i,a,s,o,u,c){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).searchOutboundResourceDisplay(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateOutboundResource:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).updateOutboundResource(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateOutboundResourceDisplay:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).updateOutboundResourceDisplay(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var ze,Ve=(ze=e,D.__extends($e,ze),$e.prototype.createOutboundResource=function(e,t){var n=this;return Je(this.configuration).createOutboundResource(e,t).then(function(e){return e(n.axios,n.basePath)})},$e.prototype.createOutboundResourceDisplay=function(e,t,n){var r=this;return Je(this.configuration).createOutboundResourceDisplay(e,t,n).then(function(e){return e(r.axios,r.basePath)})},$e.prototype.deleteOutboundResource=function(e,t,n){var r=this;return Je(this.configuration).deleteOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},$e.prototype.deleteOutboundResourceDisplay=function(e,t,n,r){var i=this;return Je(this.configuration).deleteOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},$e.prototype.patchOutboundResource=function(e,t,n){var r=this;return Je(this.configuration).patchOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},$e.prototype.readOutboundResource=function(e,t,n){var r=this;return Je(this.configuration).readOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},$e.prototype.readOutboundResourceDisplay=function(e,t,n,r){var i=this;return Je(this.configuration).readOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},$e.prototype.searchOutboundResource=function(e,t,n,r,i,a,s){var o=this;return Je(this.configuration).searchOutboundResource(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},$e.prototype.searchOutboundResourceDisplay=function(e,t,n,r,i,a,s,o){var u=this;return Je(this.configuration).searchOutboundResourceDisplay(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},$e.prototype.updateOutboundResource=function(e,t,n){var r=this;return Je(this.configuration).updateOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},$e.prototype.updateOutboundResourceDisplay=function(e,t,n,r){var i=this;return Je(this.configuration).updateOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},$e);function $e(){return null!==ze&&ze.apply(this,arguments)||this}function Ye(v){var e=this;return{createQueueBucket:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling createQueueBucket.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling createQueueBucket.");return t="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteQueueBucket:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling deleteQueueBucket.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},patchQueueBucket:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling patchQueueBucket.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling patchQueueBucket.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})},readQueueBucket:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling readQueueBucket.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchQueueBucket:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling searchQueueBucket.");return t="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),g),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),g.headers),[2,{url:F.format(n),options:i}]}})})},updateQueueBucket:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling updateQueueBucket.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateQueueBucket.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function Ze(l){return{createQueueBucket:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ye(l).createQueueBucket(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteQueueBucket:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ye(l).deleteQueueBucket(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchQueueBucket:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ye(l).patchQueueBucket(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readQueueBucket:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ye(l).readQueueBucket(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchQueueBucket:function(t,n,i,a,s,o,u,c){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ye(l).searchQueueBucket(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateQueueBucket:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ye(l).updateQueueBucket(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var et,tt=(et=e,D.__extends(nt,et),nt.prototype.createQueueBucket=function(e,t,n){var r=this;return Ze(this.configuration).createQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},nt.prototype.deleteQueueBucket=function(e,t,n){var r=this;return Ze(this.configuration).deleteQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},nt.prototype.patchQueueBucket=function(e,t,n,r){var i=this;return Ze(this.configuration).patchQueueBucket(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},nt.prototype.readQueueBucket=function(e,t,n){var r=this;return Ze(this.configuration).readQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},nt.prototype.searchQueueBucket=function(e,t,n,r,i,a,s,o){var u=this;return Ze(this.configuration).searchQueueBucket(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},nt.prototype.updateQueueBucket=function(e,t,n,r){var i=this;return Ze(this.configuration).updateQueueBucket(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},nt);function nt(){return null!==et&&et.apply(this,arguments)||this}function rt(b){var e=this;return{createQueueHook:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling createQueueHook.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling createQueueHook.");return t="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteQueueHook:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling deleteQueueHook.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},patchQueueHook:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling patchQueueHook.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling patchQueueHook.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),h),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})},readQueueHook:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling readQueueHook.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchQueueHook:function(c,l,d,_,h,p,f,g,v,y){return void 0===y&&(y={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling searchQueueHook.");return t="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(c))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),y),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),g&&(s.schema_id=g),v&&(s.event=v),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),y.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),y.headers),[2,{url:F.format(n),options:i}]}})})},updateQueueHook:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling updateQueueHook.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateQueueHook.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function it(_){return{createQueueHook:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,rt(_).createQueueHook(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteQueueHook:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,rt(_).deleteQueueHook(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchQueueHook:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,rt(_).patchQueueHook(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readQueueHook:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,rt(_).readQueueHook(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchQueueHook:function(t,n,i,a,s,o,u,c,l,d){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,rt(_).searchQueueHook(t,n,i,a,s,o,u,c,l,d)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateQueueHook:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,rt(_).updateQueueHook(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var at,st=(at=e,D.__extends(ot,at),ot.prototype.createQueueHook=function(e,t,n){var r=this;return it(this.configuration).createQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ot.prototype.deleteQueueHook=function(e,t,n){var r=this;return it(this.configuration).deleteQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ot.prototype.patchQueueHook=function(e,t,n,r){var i=this;return it(this.configuration).patchQueueHook(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},ot.prototype.readQueueHook=function(e,t,n){var r=this;return it(this.configuration).readQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ot.prototype.searchQueueHook=function(e,t,n,r,i,a,s,o,u,c){var l=this;return it(this.configuration).searchQueueHook(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},ot.prototype.updateQueueHook=function(e,t,n,r){var i=this;return it(this.configuration).updateQueueHook(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},ot);function ot(){return null!==at&&at.apply(this,arguments)||this}function ut(v){var e=this;return{createQueueResourceGroup:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling createQueueResourceGroup.");if(null==d)throw new k("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(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteQueueResourceGroup:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling deleteQueueResourceGroup.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},readQueueResourceGroup:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling readQueueResourceGroup.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},searchQueueResourceGroup:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("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(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),g),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),g.headers),[2,{url:F.format(n),options:i}]}})})},updateQueueResourceGroup:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling updateQueueResourceGroup.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateQueueResourceGroup.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function ct(l){return{createQueueResourceGroup:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ut(l).createQueueResourceGroup(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteQueueResourceGroup:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ut(l).deleteQueueResourceGroup(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readQueueResourceGroup:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ut(l).readQueueResourceGroup(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchQueueResourceGroup:function(t,n,i,a,s,o,u,c){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ut(l).searchQueueResourceGroup(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateQueueResourceGroup:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ut(l).updateQueueResourceGroup(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var lt,dt=(lt=e,D.__extends(_t,lt),_t.prototype.createQueueResourceGroup=function(e,t,n){var r=this;return ct(this.configuration).createQueueResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_t.prototype.deleteQueueResourceGroup=function(e,t,n,r){var i=this;return ct(this.configuration).deleteQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},_t.prototype.readQueueResourceGroup=function(e,t,n,r){var i=this;return ct(this.configuration).readQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},_t.prototype.searchQueueResourceGroup=function(e,t,n,r,i,a,s,o){var u=this;return ct(this.configuration).searchQueueResourceGroup(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},_t.prototype.updateQueueResourceGroup=function(e,t,n,r){var i=this;return ct(this.configuration).updateQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},_t);function _t(){return null!==lt&&lt.apply(this,arguments)||this}function ht(w){var e=this;return{createQueue:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createQueue.");return t=F.parse("/call_center/queues",!0),w&&(n=w.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteQueue:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteQueue.");return t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),w&&(r=w.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},w&&w.apiKey?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},patchQueue:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchQueue.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchQueue.");return t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),w&&(r=w.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},w&&w.apiKey?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readQueue:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readQueue.");return t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),w&&(r=w.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},w&&w.apiKey?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchQueue:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/queues",!0),w&&(n=w.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),f.headers),[2,{url:F.format(t),options:r}]}})})},searchQueueReportGeneral:function(u,c,l,d,_,h,p,f,g,v,y,b){return void 0===b&&(b={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/queues/reports/general",!0),w&&(n=w.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),b.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),b.headers),[2,{url:F.format(t),options:r}]}})})},updateQueue:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateQueue.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateQueue.");return t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),w&&(r=w.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},w&&w.apiKey?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function pt(p){return{createQueue:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ht(p).createQueue(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteQueue:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ht(p).deleteQueue(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchQueue:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ht(p).patchQueue(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readQueue:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ht(p).readQueue(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchQueue:function(t,n,i,a,s,o,u,c){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ht(p).searchQueue(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchQueueReportGeneral:function(t,n,i,a,s,o,u,c,l,d,_,h){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ht(p).searchQueueReportGeneral(t,n,i,a,s,o,u,c,l,d,_,h)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateQueue:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ht(p).updateQueue(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var ft,gt=(ft=e,D.__extends(vt,ft),vt.prototype.createQueue=function(e,t){var n=this;return pt(this.configuration).createQueue(e,t).then(function(e){return e(n.axios,n.basePath)})},vt.prototype.deleteQueue=function(e,t,n){var r=this;return pt(this.configuration).deleteQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},vt.prototype.patchQueue=function(e,t,n){var r=this;return pt(this.configuration).patchQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},vt.prototype.readQueue=function(e,t,n){var r=this;return pt(this.configuration).readQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},vt.prototype.searchQueue=function(e,t,n,r,i,a,s,o){var u=this;return pt(this.configuration).searchQueue(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},vt.prototype.searchQueueReportGeneral=function(e,t,n,r,i,a,s,o,u,c,l,d){var _=this;return pt(this.configuration).searchQueueReportGeneral(e,t,n,r,i,a,s,o,u,c,l,d).then(function(e){return e(_.axios,_.basePath)})},vt.prototype.updateQueue=function(e,t,n){var r=this;return pt(this.configuration).updateQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},vt);function vt(){return null!==ft&&ft.apply(this,arguments)||this}function yt(A){var e=this;return{createQueueSkill:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling createQueueSkill.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling createQueueSkill.");return t="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),A&&(r=A.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},A&&A.apiKey?"function"!=typeof A.apiKey?[3,2]:[4,A.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,A.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteQueueSkill:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling deleteQueueSkill.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),A&&(r=A.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},A&&A.apiKey?"function"!=typeof A.apiKey?[3,2]:[4,A.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,A.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},patchQueueSkill:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling patchQueueSkill.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling patchQueueSkill.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),A&&(r=A.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),h),a={},s={},A&&A.apiKey?"function"!=typeof A.apiKey?[3,2]:[4,A.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,A.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})},readQueueSkill:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling readQueueSkill.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),A&&(r=A.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},A&&A.apiKey?"function"!=typeof A.apiKey?[3,2]:[4,A.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,A.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchQueueSkill:function(c,l,d,_,h,p,f,g,v,y,b,w,m,q){return void 0===q&&(q={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling searchQueueSkill.");return t="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(c))),n=F.parse(t,!0),A&&(r=A.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),q),a={},s={},A&&A.apiKey?"function"!=typeof A.apiKey?[3,2]:[4,A.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,A.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),g&&(s.skill_id=g),v&&(s.bucket_id=v),y&&(s.lvl=y),b&&(s.min_capacity=b),w&&(s.max_capacity=w),void 0!==m&&(s.enabled=m),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),q.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),q.headers),[2,{url:F.format(n),options:i}]}})})},updateQueueSkill:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling updateQueueSkill.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateQueueSkill.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),A&&(r=A.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},A&&A.apiKey?"function"!=typeof A.apiKey?[3,2]:[4,A.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,A.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function bt(g){return{createQueueSkill:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,yt(g).createQueueSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteQueueSkill:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,yt(g).deleteQueueSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchQueueSkill:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,yt(g).patchQueueSkill(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readQueueSkill:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,yt(g).readQueueSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchQueueSkill:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,yt(g).searchQueueSkill(t,n,i,a,s,o,u,c,l,d,_,h,p,f)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateQueueSkill:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,yt(g).updateQueueSkill(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var wt,mt=(wt=e,D.__extends(qt,wt),qt.prototype.createQueueSkill=function(e,t,n){var r=this;return bt(this.configuration).createQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},qt.prototype.deleteQueueSkill=function(e,t,n){var r=this;return bt(this.configuration).deleteQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},qt.prototype.patchQueueSkill=function(e,t,n,r){var i=this;return bt(this.configuration).patchQueueSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},qt.prototype.readQueueSkill=function(e,t,n){var r=this;return bt(this.configuration).readQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},qt.prototype.searchQueueSkill=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){var p=this;return bt(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)})},qt.prototype.updateQueueSkill=function(e,t,n,r){var i=this;return bt(this.configuration).updateQueueSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},qt);function qt(){return null!==wt&&wt.apply(this,arguments)||this}function At(y){var e=this;return{createRegion:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createRegion.");return t=F.parse("/regions",!0),y&&(n=y.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteRegion:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteRegion.");return t="/regions/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),y&&(r=y.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),l),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},patchRegion:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchRegion.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchRegion.");return t="/regions/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),y&&(r=y.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readRegion:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readRegion.");return t="/regions/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),y&&(r=y.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),l),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},searchRegion:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/regions",!0),y&&(n=y.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),v.headers),[2,{url:F.format(t),options:r}]}})})},updateRegion:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateRegion.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateRegion.");return t="/regions/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),y&&(r=y.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function Ct(_){return{createRegion:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,At(_).createRegion(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteRegion:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,At(_).deleteRegion(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchRegion:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,At(_).patchRegion(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readRegion:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,At(_).readRegion(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchRegion:function(t,n,i,a,s,o,u,c,l,d){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,At(_).searchRegion(t,n,i,a,s,o,u,c,l,d)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateRegion:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,At(_).updateRegion(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Rt,St=(Rt=e,D.__extends(Kt,Rt),Kt.prototype.createRegion=function(e,t){var n=this;return Ct(this.configuration).createRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},Kt.prototype.deleteRegion=function(e,t){var n=this;return Ct(this.configuration).deleteRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},Kt.prototype.patchRegion=function(e,t,n){var r=this;return Ct(this.configuration).patchRegion(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Kt.prototype.readRegion=function(e,t){var n=this;return Ct(this.configuration).readRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},Kt.prototype.searchRegion=function(e,t,n,r,i,a,s,o,u,c){var l=this;return Ct(this.configuration).searchRegion(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},Kt.prototype.updateRegion=function(e,t,n){var r=this;return Ct(this.configuration).updateRegion(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Kt);function Kt(){return null!==Rt&&Rt.apply(this,arguments)||this}function Pt(v){var e=this;return{createChatPlan:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createChatPlan.");return t=F.parse("/routing/outbound/chat",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteChatPlan:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteChatPlan.");return t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),l),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},patchChatPlan:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchChatPlan.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchChatPlan.");return t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readChatPlan:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readChatPlan.");return t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),l),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},searchChatPlan:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/routing/outbound/chat",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),g.headers),[2,{url:F.format(t),options:r}]}})})},updateChatPlan:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateChatPlan.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateChatPlan.");return t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function Ot(d){return{createChatPlan:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Pt(d).createChatPlan(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteChatPlan:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Pt(d).deleteChatPlan(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchChatPlan:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Pt(d).patchChatPlan(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readChatPlan:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Pt(d).readChatPlan(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchChatPlan:function(t,n,i,a,s,o,u,c,l){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Pt(d).searchChatPlan(t,n,i,a,s,o,u,c,l)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateChatPlan:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Pt(d).updateChatPlan(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Tt,kt=(Tt=e,D.__extends(It,Tt),It.prototype.createChatPlan=function(e,t){var n=this;return Ot(this.configuration).createChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},It.prototype.deleteChatPlan=function(e,t){var n=this;return Ot(this.configuration).deleteChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},It.prototype.patchChatPlan=function(e,t,n){var r=this;return Ot(this.configuration).patchChatPlan(e,t,n).then(function(e){return e(r.axios,r.basePath)})},It.prototype.readChatPlan=function(e,t){var n=this;return Ot(this.configuration).readChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},It.prototype.searchChatPlan=function(e,t,n,r,i,a,s,o,u){var c=this;return Ot(this.configuration).searchChatPlan(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},It.prototype.updateChatPlan=function(e,t,n){var r=this;return Ot(this.configuration).updateChatPlan(e,t,n).then(function(e){return e(r.axios,r.basePath)})},It);function It(){return null!==Tt&&Tt.apply(this,arguments)||this}function Wt(b){var e=this;return{createRoutingOutboundCall:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createRoutingOutboundCall.");return t=F.parse("/routing/outbound/calls",!0),b&&(n=b.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteRoutingOutboundCall:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteRoutingOutboundCall.");return t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},movePositionRoutingOutboundCall:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("fromId","Required parameter fromId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==d)throw new k("toId","Required parameter toId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==_)throw new k("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(l))).replace("{to_id}",encodeURIComponent(String(d))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),h),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})},patchRoutingOutboundCall:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchRoutingOutboundCall.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchRoutingOutboundCall.");return t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readRoutingOutboundCall:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readRoutingOutboundCall.");return t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchRoutingOutboundCall:function(u,c,l,d,_,h,p,f,g,v,y){return void 0===y&&(y={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/routing/outbound/calls",!0),b&&(n=b.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),y.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),y.headers),[2,{url:F.format(t),options:r}]}})})},updateRoutingOutboundCall:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateRoutingOutboundCall.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateRoutingOutboundCall.");return t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function Xt(h){return{createRoutingOutboundCall:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(h).createRoutingOutboundCall(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteRoutingOutboundCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(h).deleteRoutingOutboundCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},movePositionRoutingOutboundCall:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(h).movePositionRoutingOutboundCall(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchRoutingOutboundCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(h).patchRoutingOutboundCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readRoutingOutboundCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(h).readRoutingOutboundCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchRoutingOutboundCall:function(t,n,i,a,s,o,u,c,l,d,_){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(h).searchRoutingOutboundCall(t,n,i,a,s,o,u,c,l,d,_)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateRoutingOutboundCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(h).updateRoutingOutboundCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var xt,Et=(xt=e,D.__extends(Qt,xt),Qt.prototype.createRoutingOutboundCall=function(e,t){var n=this;return Xt(this.configuration).createRoutingOutboundCall(e,t).then(function(e){return e(n.axios,n.basePath)})},Qt.prototype.deleteRoutingOutboundCall=function(e,t,n){var r=this;return Xt(this.configuration).deleteRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Qt.prototype.movePositionRoutingOutboundCall=function(e,t,n,r){var i=this;return Xt(this.configuration).movePositionRoutingOutboundCall(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Qt.prototype.patchRoutingOutboundCall=function(e,t,n){var r=this;return Xt(this.configuration).patchRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Qt.prototype.readRoutingOutboundCall=function(e,t,n){var r=this;return Xt(this.configuration).readRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Qt.prototype.searchRoutingOutboundCall=function(e,t,n,r,i,a,s,o,u,c,l){var d=this;return Xt(this.configuration).searchRoutingOutboundCall(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(d.axios,d.basePath)})},Qt.prototype.updateRoutingOutboundCall=function(e,t,n){var r=this;return Xt(this.configuration).updateRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Qt);function Qt(){return null!==xt&&xt.apply(this,arguments)||this}function jt(y){var e=this;return{createRoutingSchema:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createRoutingSchema.");return t=F.parse("/routing/schema",!0),y&&(n=y.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteRoutingSchema:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteRoutingSchema.");return t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),y&&(r=y.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},patchRoutingSchema:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchRoutingSchema.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchRoutingSchema.");return t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),y&&(r=y.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readRoutingSchema:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readRoutingSchema.");return t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),y&&(r=y.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchRoutingSchema:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/routing/schema",!0),y&&(n=y.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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),t.query=D.__assign(D.__assign(D.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),v.headers),[2,{url:F.format(t),options:r}]}})})},updateRoutingSchema:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateRoutingSchema.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateRoutingSchema.");return t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),y&&(r=y.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function Ut(_){return{createRoutingSchema:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,jt(_).createRoutingSchema(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteRoutingSchema:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,jt(_).deleteRoutingSchema(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchRoutingSchema:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,jt(_).patchRoutingSchema(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readRoutingSchema:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,jt(_).readRoutingSchema(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchRoutingSchema:function(t,n,i,a,s,o,u,c,l,d){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,jt(_).searchRoutingSchema(t,n,i,a,s,o,u,c,l,d)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateRoutingSchema:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,jt(_).updateRoutingSchema(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Gt,Bt=(Gt=e,D.__extends(Mt,Gt),Mt.prototype.createRoutingSchema=function(e,t){var n=this;return Ut(this.configuration).createRoutingSchema(e,t).then(function(e){return e(n.axios,n.basePath)})},Mt.prototype.deleteRoutingSchema=function(e,t,n){var r=this;return Ut(this.configuration).deleteRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Mt.prototype.patchRoutingSchema=function(e,t,n){var r=this;return Ut(this.configuration).patchRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Mt.prototype.readRoutingSchema=function(e,t,n){var r=this;return Ut(this.configuration).readRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Mt.prototype.searchRoutingSchema=function(e,t,n,r,i,a,s,o,u,c){var l=this;return Ut(this.configuration).searchRoutingSchema(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},Mt.prototype.updateRoutingSchema=function(e,t,n){var r=this;return Ut(this.configuration).updateRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Mt);function Mt(){return null!==Gt&&Gt.apply(this,arguments)||this}function Ht(h){var e=this;return{createRoutingVariable:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createRoutingVariable.");return t=F.parse("/routing/variables",!0),h&&(n=h.baseOptions),r=D.__assign(D.__assign({method:"POST"},n),l),i={},a={},h&&h.apiKey?"function"!=typeof h.apiKey?[3,2]:[4,h.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,h.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteRoutingVariable:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteRoutingVariable.");return t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),h&&(r=h.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},h&&h.apiKey?"function"!=typeof h.apiKey?[3,2]:[4,h.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,h.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readRoutingVariable:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readRoutingVariable.");return t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),h&&(r=h.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},h&&h.apiKey?"function"!=typeof h.apiKey?[3,2]:[4,h.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,h.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchRoutingVariable:function(u,c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/routing/variables",!0),h&&(n=h.baseOptions),r=D.__assign(D.__assign({method:"GET"},n),d),i={},a={},h&&h.apiKey?"function"!=typeof h.apiKey?[3,2]:[4,h.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,h.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),d.headers),[2,{url:F.format(t),options:r}]}})})},updateRoutingVariable:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateRoutingVariable.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateRoutingVariable.");return t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),h&&(r=h.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},h&&h.apiKey?"function"!=typeof h.apiKey?[3,2]:[4,h.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,h.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function Lt(s){return{createRoutingVariable:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ht(s).createRoutingVariable(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteRoutingVariable:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ht(s).deleteRoutingVariable(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readRoutingVariable:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ht(s).readRoutingVariable(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchRoutingVariable:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ht(s).searchRoutingVariable(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateRoutingVariable:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ht(s).updateRoutingVariable(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Dt,Ft=(Dt=e,D.__extends(Nt,Dt),Nt.prototype.createRoutingVariable=function(e,t){var n=this;return Lt(this.configuration).createRoutingVariable(e,t).then(function(e){return e(n.axios,n.basePath)})},Nt.prototype.deleteRoutingVariable=function(e,t,n){var r=this;return Lt(this.configuration).deleteRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Nt.prototype.readRoutingVariable=function(e,t,n){var r=this;return Lt(this.configuration).readRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Nt.prototype.searchRoutingVariable=function(e,t,n,r){var i=this;return Lt(this.configuration).searchRoutingVariable(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Nt.prototype.updateRoutingVariable=function(e,t,n){var r=this;return Lt(this.configuration).updateRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Nt);function Nt(){return null!==Dt&&Dt.apply(this,arguments)||this}function Jt(f){var e=this;return{createSkill:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createSkill.");return t=F.parse("/call_center/skills",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteSkill:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteSkill.");return t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readSkill:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readSkill.");return t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchSkill:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/skills",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},updateSkill:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateSkill.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateSkill.");return t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function zt(c){return{createSkill:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(c).createSkill(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteSkill:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(c).deleteSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readSkill:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(c).readSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchSkill:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(c).searchSkill(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateSkill:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(c).updateSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Vt,$t=(Vt=e,D.__extends(Yt,Vt),Yt.prototype.createSkill=function(e,t){var n=this;return zt(this.configuration).createSkill(e,t).then(function(e){return e(n.axios,n.basePath)})},Yt.prototype.deleteSkill=function(e,t,n){var r=this;return zt(this.configuration).deleteSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Yt.prototype.readSkill=function(e,t,n){var r=this;return zt(this.configuration).readSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Yt.prototype.searchSkill=function(e,t,n,r,i,a,s){var o=this;return zt(this.configuration).searchSkill(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Yt.prototype.updateSkill=function(e,t,n){var r=this;return zt(this.configuration).updateSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Yt);function Yt(){return null!==Vt&&Vt.apply(this,arguments)||this}function Zt(d){var e=this;return{defaultDeviceConfig:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("type","Required parameter type was null or undefined when calling defaultDeviceConfig.");return t="/user/device/config/{type}".replace("{type}",encodeURIComponent(String(c))),n=F.parse(t,!0),d&&(r=d.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),l),a={},s={},d&&d.apiKey?"function"!=typeof d.apiKey?[3,2]:[4,d.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,d.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})}}}function en(i){return{defaultDeviceConfig:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Zt(i).defaultDeviceConfig(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var tn,nn=(tn=e,D.__extends(rn,tn),rn.prototype.defaultDeviceConfig=function(e,t){var n=this;return en(this.configuration).defaultDeviceConfig(e,t).then(function(e){return e(n.axios,n.basePath)})},rn);function rn(){return null!==tn&&tn.apply(this,arguments)||this}function an(e){void 0===e&&(e={}),this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions}var sn,on,un,cn;(f.ProtobufNullValue||(f.ProtobufNullValue={})).NULLVALUE="NULL_VALUE",(sn=f.StorageImportSourceType||(f.StorageImportSourceType={})).DefaultSourceType="DefaultSourceType",sn.Dialer="Dialer",(on=f.StorageProviderType||(f.StorageProviderType={})).DefaultProvider="DefaultProvider",on.Microsoft="Microsoft",(un=f.StorageServiceType||(f.StorageServiceType={})).DefaultService="DefaultService",un.STT="STT",un.TTS="TTS",(cn=f.StorageUploadStatusCode||(f.StorageUploadStatusCode={})).Unknown="Unknown",cn.Ok="Ok",cn.Failed="Failed";var ln=(dn.prototype.debug=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("debug",e,t)},dn.prototype.info=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("info",e,t)},dn.prototype.warn=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("warn",e,t)},dn.prototype.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("error",e,t)},dn.prototype.emitLogMessage=function(e,t,n){0<n.length?console[e].apply(console,D.__spreadArrays([t],n)):console[e](t)},dn);function dn(){}var _n=(Object.defineProperty(hn.prototype,"id",{get:function(){return this.session.id},enumerable:!0,configurable:!0}),hn.prototype.getLocalMedia=function(){if(this.session.connection){var e=this.session.connection.getLocalStreams();if(e.length)return e}return[]},hn.prototype.getPeerMedia=function(){if(this.session.connection){var e=this.session.connection.getRemoteStreams();if(e.length)return e}return[]},hn.prototype.answer=function(e){var t=this;return new Promise(function(){t.session.answer(e)})},hn);function hn(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")}var pn,fn=(pn=i.EventEmitter,D.__extends(gn,pn),gn.prototype.callOption=function(n){return void 0===n&&(n={}),D.__awaiter(this,void 0,void 0,function(){var t;return D.__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}]}})})},gn.prototype.answer=function(r,i){return D.__awaiter(this,void 0,void 0,function(){var t,n;return D.__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]}})})},gn.prototype.call=function(i){return D.__awaiter(this,void 0,void 0,function(){var t,n,r;return D.__generator(this,function(e){switch(e.label){case 0:if(t={},n=null,i.params&&(t.audio=i.params.audio,t.video=i.params.video||!1,t.screen=i.params.screen||!1,t.disableStun=i.params.disableStun||!1),"string"!=typeof i.destination)throw new Error("bad destination type");return[4,this.callOption(t)];case 1:return r=e.sent(),i.params&&i.params.display&&(n={extraHeaders:["X-Webitel-Display: "+i.params.display]}),[4,this.ua.call(i.destination,D.__assign(D.__assign({},r),n))];case 2:return e.sent(),[2]}})})},gn.prototype.register=function(a){return D.__awaiter(this,void 0,void 0,function(){var t,n,r,i=this;return D.__generator(this,function(e){return t=new s.WebSocketInterface(a.server),n={realm:a.realm,uri:a.uri,authorization_user:a.authorization_user,ha1:a.ha1,user_agent:gn.userAgent,sockets:[t],session_timers:!0,display_name:a.display_name,register_expires:a.register_expires||90,connection_recovery_min_interval:5,connection_recovery_max_interval:60},(r=this.ua=new s.UA(n)).on("newRTCSession",function(e){var t=e.session,n=t.id,r=new _n(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 D.__awaiter(i,void 0,void 0,function(){return D.__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)}),r.on("disconnected",function(e){i.emit("unregistered")}),r.on("unregistered",function(e){i.emit("unregistered")}),r.on("registrationFailed",function(e){i.log.error("registrationFailed",e)}),r.on("registered",function(e){i.emit("registered")}),r.start(),[2]})})},gn.prototype.unregister=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__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]}})})},gn.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},gn.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},gn.prototype.removeSession=function(e,t){var n,r;return t&&(n=t.getLocalStreams(),r=t.getRemoteStreams(),n&&n.forEach(function(e){e.getTracks().forEach(function(e){e.stop()})}),r&&r.forEach(function(e){e.getTracks().forEach(function(e){e.stop()})})),!!this.sessionCache.has(e)&&(this.sessionCache.delete(e),!0)},gn.prototype.storeSession=function(e,t){if(this.sessionCache.has(e))throw new Error("Session already store");this.sessionCache.set(e,t)},Object.defineProperty(gn.prototype,"allSession",{get:function(){return Array.from(this.sessionCache.values())},enumerable:!0,configurable:!0}),gn.prototype.getMediaConstraints=function(e){return e.screen?{video:!1,audio:!1,screen:!0}:{video:e.video||!1,audio:!0}},gn.prototype.getSession=function(e){return this.sessionCache.has(e)?this.sessionCache.get(e):null},gn.prototype.hasSession=function(e){return this.sessionCache.has(e)},gn.prototype.getUserScreen=function(){return D.__awaiter(this,void 0,void 0,function(){var t=this;return D.__generator(this,function(e){return[2,new Promise(function(r,i){return D.__awaiter(t,void 0,void 0,function(){var t,n;return D.__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(),r(t),[3,3];case 2:return n=e.sent(),i(n),[3,3];case 3:return[2]}})})})]})})},gn.prototype.getUserCallStream=function(r){return D.__awaiter(this,void 0,void 0,function(){var t,n;return D.__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)throw new Error("bad stream request");return[2,t]}})})},gn.prototype.getUserMedia=function(i,a){return D.__awaiter(this,void 0,void 0,function(){var t=this;return D.__generator(this,function(e){return[2,new Promise(function(n,r){return D.__awaiter(t,void 0,void 0,function(){var t;return D.__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 D.__awaiter(this,void 0,void 0,function(){return D.__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)]})})})]})})},gn.userAgent="Webitel-Phone/0.0.1",gn);function gn(e,t){var n=pn.call(this)||this;return n.instanceId=e,n.type="webrtc",n.sessionCache=new Map,t?s.debug.enable("*"):s.debug.disable(),n.log=new ln,n.on("unregistered",function(){n.sessionCache.clear()}),n}var vn,yn,bn;(vn=f.JobState||(f.JobState={})).Distribute="distribute",vn.Offering="offering",vn.Bridged="bridged",vn.Missed="missed",vn.Processing="processing",vn.Closed="closed",vn.Destroy="destroy",(bn=yn=yn||{}).Call="call",bn.Chat="chat",bn.Task="task";var wn,mn,qn,An=(Object.defineProperty(Cn.prototype,"queue",{get:function(){return{id:this.distribute.queue_id,name:this.distribute.queue_name}},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"duration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"hasForm",{get:function(){return this.distribute.has_form||!1},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"channel",{get:function(){return this.distribute.channel},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"allowAccept",{get:function(){return this.channel===yn.Task&&0===this.bridgedAt&&0===this.closedAt},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"allowDecline",{get:function(){return this.allowAccept},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"allowClose",{get:function(){return this.channel===yn.Task&&0===this.closedAt&&0<this.bridgedAt},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"memberId",{get:function(){return this.distribute.member_id},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"queueId",{get:function(){return this.distribute.queue_id},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"hasReporting",{get:function(){return this.distribute.has_reporting},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"allowReporting",{get:function(){return this.hasReporting&&0<this.bridgedAt},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"agentChannelId",{get:function(){return this.distribute.agent_channel_id},enumerable:!0,configurable:!0}),Cn.prototype.setState=function(e){this.state=e},Cn.prototype.setAnswered=function(e){this.answeredAt=e,this.lastStatusChange=Date.now()},Cn.prototype.setOffering=function(e){this.offeringAt=e.timestamp},Cn.prototype.setBridged=function(e){this.bridgedAt=e.timestamp,this.lastStatusChange=Date.now(),e.form&&(this.form=e.form)},Cn.prototype.setProcessing=function(e,t){this.state=f.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},Cn.prototype.setClosed=function(e){this.stopAt=e,this.state=f.JobState.Closed},Cn.prototype.setTransferred=function(e){this.distribute=e,this.history.push(e)},Cn.prototype.setMissed=function(){this.state=f.JobState.Missed},Object.defineProperty(Cn.prototype,"processingTimeoutAt",{get:function(){return this._processing&&this._processing.timeout?this._processing.timeout:null},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"processingSec",{get:function(){return this._processing&&this._processing.sec?this._processing.sec:null},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"attempt",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"variables",{get:function(){var e={};for(var t in this.distribute.variables)t.startsWith("cc_")||(e[t]=this.distribute.variables[t]);return e},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"isMember",{get:function(){return!!this.memberId},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"displayNumber",{get:function(){return this.communication.destination},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"displayName",{get:function(){return this.distribute.member_name||null},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"display",{get:function(){return this.displayName+" ("+this.displayNumber+")"},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"renewalSec",{get:function(){return this._processing&&this._processing.renewal_sec?this._processing.renewal_sec:null},enumerable:!0,configurable:!0}),Cn.prototype.accept=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__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})]})})},Cn.prototype.close=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__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})]})})},Cn.prototype.decline=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__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})]})})},Cn.prototype.reporting=function(n){return D.__awaiter(this,void 0,void 0,function(){var t;return D.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.request("cc_reporting",D.__assign({attempt_id:this.id},n))];case 1:return t=e.sent(),this.reportedAt=Date.now(),[2,t]}})})},Cn.prototype.renew=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.request("cc_renewal",{attempt_id:this.id,renewal_sec:t||this.processingSec})]})})},Cn.prototype.formAction=function(t,n){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.form)throw new Error("not found active form");return[2,this.client.request("cc_form_action",{attempt_id:this.id,app_id:this.distribute.app_id,action:t,fields:n})]})})},Cn);function Cn(e,t,n){this.client=e,this.distribute=n,this.id=t.attempt_id,this.state=f.JobState.Offering,this.setState(t.status),this.lastStatusChange=t.timestamp,this.createdAt=t.timestamp,this._processing=null,this.offeringAt=0,this.answeredAt=0,this.bridgedAt=0,this.reportedAt=0,this.startProcessingAt=0,this.stopAt=0,this.closedAt=0,this.form=null,this.communication=n.communication,this.history=[n]}(wn=f.AgentStatus||(f.AgentStatus={})).Online="online",wn.Offline="offline",wn.Pause="pause",wn.BreakOut="break_out",(mn=f.ChannelState||(f.ChannelState={})).Waiting="waiting",mn.Distribute="distribute",mn.Offering="offering",mn.Answered="answered",mn.Active="active",mn.Bridged="bridged",mn.Hold="hold",mn.Missed="missed",mn.WrapTime="wrap_time",mn.Processing="processing",mn.Transfer="transfer",mn.Form="form",(qn=f.ChannelType||(f.ChannelType={})).Call="call",qn.Email="email",qn.Chat="chat",qn.Job="task";var Rn,Sn,Kn,Pn=(Object.defineProperty(On.prototype,"agentId",{get:function(){return this.info.agent_id},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"onDemand",{get:function(){return this.info.on_demand},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"status",{get:function(){return this.info.status},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"statusPayload",{get:function(){return this.info.status_payload},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"isAdmin",{get:function(){return this.info.is_admin},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"isSupervisor",{get:function(){return this.info.is_supervisor},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"team",{get:function(){return this.info.team},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"supervisor",{get:function(){return this.info.supervisor},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"auditor",{get:function(){return this.info.auditor},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"channels",{get:function(){return[this._channel]},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"channel",{get:function(){return this._channel},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"stateDuration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!0,configurable:!0}),On.prototype.onChannelEvent=function(e){var t=this;switch(e.status){case f.ChannelState.Distribute:var n=e;if(!n)throw new Error("bad event");if(a=new An(this.client,e,n.distribute),this.task.set(a.id,a),a.agentChannelId)switch(a.channel){case f.ChannelType.Call:var r=this.client.callById(a.agentChannelId);r&&!r.task&&(r.task=a);break;case f.ChannelType.Chat:var i=this.client.conversationById(a.agentChannelId);i&&!i.task&&(i.task=a)}break;case f.ChannelState.Offering:var a,s=e;(a=this.task.get(e.attempt_id))&&(a.setOffering(s),s.offering.auto_answer&&a.channel===f.ChannelType.Job&&a.accept().catch(function(e){t.client.emit("error",e)}));break;case f.ChannelState.Bridged:var o=e;(a=this.task.get(o.attempt_id))&&a.setBridged(o);break;case f.ChannelState.Transfer:var u=e;(a=this.task.get(u.to_attempt_id))&&(this.task.delete(a.id),a.id=u.attempt_id,a.setTransferred(u.distribute),this.task.set(a.id,a));break;case f.ChannelState.Answered:(a=this.task.get(e.attempt_id))&&(a.answeredAt=e.timestamp);break;case f.ChannelState.Form:var c=e;return void((a=this.task.get(e.attempt_id))&&(a.form=c.form||null));case f.ChannelState.Missed:if(e.attempt_id&&(a=this.task.get(e.attempt_id))){a.stopAt=e.timestamp;var l=e;if(!l)throw new Error("bad event");return a.setMissed(),this.setChannelStateTimeout(e.channel,e,l.missed.timeout),this.task.delete(e.attempt_id),this.client.reportingChannelTask(a),a}break;case f.ChannelState.WrapTime:if(e.attempt_id){if(!e)throw new Error("bad event");a=this.task.get(e.attempt_id),this.task.delete(e.attempt_id),this.client.reportingChannelTask(a)}break;case f.ChannelState.Processing:if(e.attempt_id){var d=e;if(!d)throw new Error("bad event");if(a=this.task.get(e.attempt_id))return a.setProcessing(e.timestamp,d.processing),this.setChannelStateTimeout(e.channel,e,d.processing.timeout||0),a}break;case f.ChannelState.Waiting:e.attempt_id&&(a=this.task.get(e.attempt_id))&&(a.setClosed(e.timestamp),this.task.delete(e.attempt_id),this.client.reportingChannelTask(a))}return this.setChannelState(e.channel,e),a?(a.setState(e.status),a):void 0},On.prototype.online=function(t,n){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.agentSetOnline(this.agentId,t,n)]})})},On.prototype.waiting=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.agentSetWaiting(this.agentId,t)]})})},On.prototype.pause=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.agentSetPause(this.agentId,t)]})})},On.prototype.offline=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.agentSetOffline(this.agentId)]})})},On.prototype.setStatus=function(e){e.status===f.AgentStatus.Online&&(this.info.on_demand=e.on_demand||!1,this._channel=e.channels[0]),this.info.status=e.status,this.info.status_payload=e.status_payload?e.status_payload:null,this.lastStatusChange=Date.now()},On.prototype.directMember=function(t,n){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.request("cc_member_direct",{agent_id:this.agentId,member_id:t,communication_id:n})]})})},On.prototype.offlineMembers=function(t,n,r){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.request("cc_fetch_offline_members",{agent_id:this.agentId,page:n,q:t,per_page:r})]})})},On.prototype.hasTask=function(e){return this.task.has(e.id)},On.prototype.setChannelState=function(e,t){this._channel.channel=e||null,this._channel.state=t.status,this._channel.joined_at=t.timestamp,this._channel.timeout=void 0},On.prototype.setChannelStateTimeout=function(e,t,n){this._channel.channel=e||null,this._channel.state=t.status,this._channel.timeout=n,this._channel.joined_at=t.timestamp},On);function On(e,t){this.client=e,this.info=t,this.task=new Map,this._channel=t.channels[0],this.lastStatusChange=Date.now()-1e3*this.info.status_duration}(Rn=f.CallReportingStatus||(f.CallReportingStatus={})).Abandoned="abandoned",Rn.Cancel="cancel",Rn.Success="success",(Sn=f.CallActions||(f.CallActions={})).Ringing="ringing",Sn.Active="active",Sn.Bridge="bridge",Sn.Hold="hold",Sn.DTMF="dtmf",Sn.Voice="voice",Sn.Silence="silence",Sn.Execute="execute",Sn.Update="update",Sn.Hangup="hangup",Sn.Reporting="reporting",Sn.PeerStream="peerStream",Sn.LocalStream="localStream",Sn.Destroy="destroy",(Kn=f.CallDirection||(f.CallDirection={})).Inbound="inbound",Kn.Outbound="outbound";var Tn=(kn.prototype.setState=function(e){this.state=e.event},kn.prototype.setSip=function(e){e&&!this.sip&&(this.sip=e,this.localStreams=e.getLocalMedia(),this.peerStreams=e.getPeerMedia())},Object.defineProperty(kn.prototype,"duration",{get:function(){return 0===this.hangupAt?Math.round((Date.now()-this.createdAt)/1e3):Math.round((this.hangupAt-this.createdAt)/1e3)},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"allowDtmf",{get:function(){return 0<this.answeredAt&&this.allowHangup},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"allowHangup",{get:function(){return 0===this.hangupAt},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"allowHold",{get:function(){return 0===this.hangupAt&&("active"===this.state||"bridge"===this.state)},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"allowAnswer",{get:function(){return this.client.phone&&0===this.hangupAt&&0===this.answeredAt&&(this.queue||this.direction===f.CallDirection.Inbound||this.params&&!this.params.autoAnswer)},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"allowUnHold",{get:function(){return 0===this.hangupAt&&"hold"===this.state},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"memberCommunication",{get:function(){return this.task?this.task.communication:null},enumerable:!0,configurable:!0}),kn.prototype.getMember=function(e){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.isMember)throw new Error("call is not from outbound queue");return[2,this.client.request("cc_member_page",{queue_id:this.task.queueId,member_id:this.task.memberId})]})})},Object.defineProperty(kn.prototype,"isMember",{get:function(){return!(!this.task||!this.task.isMember)},enumerable:!0,configurable:!0}),kn.prototype.setActive=function(e){this.answeredAt||(this.direction===f.CallDirection.Inbound&&(this.bridgedAt=+e.timestamp,this.parentId&&(this.bridgedId=this.parentId)),this.answeredAt=+e.timestamp),this.setState(e)},kn.prototype.setBridged=function(e){var t=e.data;this.bridgedAt||(this.bridgedAt=+e.timestamp),this.bridgedId=t.bridged_id,t.to&&(this.direction===f.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)},kn.prototype.setHold=function(e){this.setState(e)},kn.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},kn.prototype.setPeerStreams=function(e){this.peerStreams=e||[]},kn.prototype.setLocalStreams=function(e){this.localStreams=e||[]},kn.prototype.setVoice=function(){this.voice=!0},kn.prototype.setSilence=function(){this.voice=!1},kn.prototype.setExecute=function(e){this.applications.push(e.application)},kn.prototype.addDigit=function(e){this.digits.push(e.digit)},kn.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(kn.prototype,"allowReporting",{get:function(){return 0<this.answeredAt&&this.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"hasReporting",{get:function(){return!!this.task&&this.task.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"display",{get:function(){return this.displayNumber+" ("+this.displayName+")"},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"muted",{get:function(){return this._muted},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"isHold",{get:function(){return this.state===f.CallActions.Hold},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"allowInboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"allowOutboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"active",{get:function(){return 0===this.hangupAt},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"displayNumber",{get:function(){return"inbound"===this.direction?this.from.number:this.to?this.to.number:this.destination},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"displayName",{get:function(){return"inbound"===this.direction?this.from.name:this.to?this.to.name:this.destination},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"autoAnswer",{get:function(){return this.queue&&"offline"===this.queue.queue_type||this.params&&!0===this.params.autoAnswer},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"attempt",{get:function(){return this.task},enumerable:!0,configurable:!0}),kn.prototype.answer=function(r){return D.__awaiter(this,void 0,void 0,function(){var t,n;return D.__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(r)];case 2:return t=e.sent(),[4,this.sip.answer(t)];case 3:return e.sent(),[3,5];case 4:return n=e.sent(),this.client.handleError(n),[3,5];case 5:return[2,!0];case 6:return[2,!1]}})})},kn.prototype.answerDelay=function(t,e){var n=this;this.autoAnswered||(this.autoAnswered=!0,setTimeout(function(){return D.__awaiter(n,void 0,void 0,function(){return D.__generator(this,function(e){switch(e.label){case 0:return[4,this.answer(t)];case 1:return e.sent(),[2]}})})},e))},kn.prototype.hangup=function(n){return D.__awaiter(this,void 0,void 0,function(){var t;return D.__generator(this,function(e){return t=n,0!==this.answeredAt||n||(t=this.direction===f.CallDirection.Inbound?"USER_BUSY":"ORIGINATOR_CANCEL"),[2,this.client.request("call_hangup",{id:this.id,app_id:this.appId,cause:t})]})})},kn.prototype.eavesdrop=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return t.id=this.id,[2,this.client.request("call_eavesdrop",t)]})})},kn.prototype.toggleHold=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return this.state===f.CallActions.Hold?[2,this.unHold()]:[2,this.hold()]})})},kn.prototype.hold=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(this.state===f.CallActions.Hold)throw new Error("Call is hold");return[2,this.client.request("call_hold",{id:this.id,app_id:this.appId})]})})},kn.prototype.unHold=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(this.state!==f.CallActions.Hold)throw new Error("Call is active");return[2,this.client.request("call_unhold",{id:this.id,app_id:this.appId})]})})},kn.prototype.sendDTMF=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.request("call_dtmf",{id:this.id,app_id:this.appId,dtmf:t})]})})},kn.prototype.blindTransfer=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.request("call_blind_transfer",{id:this.id,app_id:this.appId,destination:t})]})})},kn.prototype.mute=function(n){return void 0===n&&(n=!1),D.__awaiter(this,void 0,void 0,function(){var t;return D.__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]}})})},kn.prototype.bridgeTo=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__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})]})})},kn.prototype.reporting=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.task)throw new Error("this call not in queue");return[2,this.task.reporting(t)]})})},kn.prototype.renew=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.task)throw new Error("this conversation not in queue");return[2,this.task.renew(t)]})})},kn.prototype.callToUser=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return t.nodeId=this.appId,t.parentCallId=this.id||null,t.sendToCallId=this.parentId||null,[2,this.client.inviteToUser(t)]})})},kn);function kn(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.answeredAt=0,this.hangupAt=0,this.bridgedAt=0,this.reportingAt=0,this.autoAnswered=!1,this.peerStreams=[],this.localStreams=[],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)}var In,Wn;(In=f.ChatActions||(f.ChatActions={})).Message="message",In.UserInvite="user_invite",In.Invite="invite_conversation",In.Joined="join_conversation",In.Close="close_conversation",In.Leave="leave_conversation",In.Decline="decline_invite",In.Update="update_channel",In.Destroy="destroy",(Wn=f.ConversationState||(f.ConversationState={})).Init="init",Wn.Invite="invite",Wn.Active="active",Wn.Pending="pending",Wn.Closed="closed";var Xn=(xn.prototype.setInvite=function(e,t){var n=this;this.inviteId=e,this.invitedAt=t,this._autoAnswer&&this.join().catch(function(e){n.client.emit("error",e)})},xn.prototype.setAnswered=function(e,t,n){this.state=f.ConversationState.Active,this.answeredAt=t,this.channelId=e,this.member=En(n),this.inviteId=null},xn.prototype.setClosed=function(e){this.state=f.ConversationState.Closed,this.closedAt=e},Object.defineProperty(xn.prototype,"id",{get:function(){return this.channelId||this.inviteId||this.conversationId},enumerable:!0,configurable:!0}),Object.defineProperty(xn.prototype,"messages",{get:function(){return this.getMessages()},enumerable:!0,configurable:!0}),xn.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.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})},xn.prototype.next=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){throw new Error("TODO")})})},xn.prototype.pagination=function(e,t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){throw new Error("TODO")})})},xn.prototype.newMessage=function(e){this._messages.push(e)},Object.defineProperty(xn.prototype,"allowDecline",{get:function(){return!!this.inviteId},enumerable:!0,configurable:!0}),Object.defineProperty(xn.prototype,"allowJoin",{get:function(){return!!this.inviteId},enumerable:!0,configurable:!0}),Object.defineProperty(xn.prototype,"allowLeave",{get:function(){return!!this.channelId&&0===this.closedAt},enumerable:!0,configurable:!0}),Object.defineProperty(xn.prototype,"allowReporting",{get:function(){return 0<this.answeredAt&&this.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(xn.prototype,"hasReporting",{get:function(){return this._hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(xn.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:!0,configurable:!0}),Object.defineProperty(xn.prototype,"attempt",{get:function(){return this.task},enumerable:!0,configurable:!0}),xn.prototype.decline=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.inviteId)throw new Error("This conversation is joined");return[2,this.client.request("decline_chat",{invite_id:this.inviteId})]})})},xn.prototype.join=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.inviteId)throw new Error("This conversation is joined");return[2,this.client.request("join_chat",{invite_id:this.inviteId})]})})},xn.prototype.close=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.channelId)throw new Error("This conversation not active");return[2,this.client.request("close_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:t})]})})},xn.prototype.leave=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.channelId)throw new Error("This conversation not active");return[2,this.client.request("leave_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:t})]})})},xn.prototype.sendText=function(r){return D.__awaiter(this,void 0,void 0,function(){var t,n;return D.__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.substr(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]}})})},xn.prototype.sendFile=function(r,i){return D.__awaiter(this,void 0,void 0,function(){var t,n;return D.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.storeFile(this.conversationId,[r],i)];case 1:return t=e.sent(),n=t[0],[2,this.client.request("send_file_chat",{channel_id:this.channelId,conversation_id:this.conversationId,id:n.id,name:r.name,mime:n.mime,url:n.shared,size:n.size})]}})})},xn.prototype.send=function(t,n){return D.__awaiter(this,void 0,void 0,function(){return D.__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")})})},xn.prototype.addToChat=function(t,n){return D.__awaiter(this,void 0,void 0,function(){return D.__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})]})})},xn.prototype.startChat=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.request("start_chat",{user_id:t})]})})},xn.prototype.updateChannel=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.request("update_channel_chat",{channel_id:this.channelId})]})})},xn.prototype.reporting=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.task)throw new Error("this conversation not in queue");return[2,this.task.reporting(t)]})})},xn.prototype.renew=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.task)throw new Error("this conversation not in queue");return[2,this.task.renew(t)]})})},xn.prototype.transferToPlan=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.request("blind_transfer_chat",{conversation_id:this.conversationId,channel_id:this.channelId,plan_id:t})]})})},xn.prototype.transferToUser=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.request("transfer_user_chat",{conversation_id:this.conversationId,channel_id:this.channelId,user_id:t})]})})},xn.prototype.sendMessageTextChunk=function(e){return this.client.request("send_text_chat",{channel_id:this.channelId,conversation_id:this.conversationId,text:e})},xn.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},xn);function xn(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.members=(r||[]).map(En),this._messages=i||[],this.state=f.ConversationState.Invite,this.variables={},this._hasReporting=!(!a||"true"!==a.cc_reporting),this._autoAnswer=!1,a)!s.startsWith("cc_")&&a.hasOwnProperty(s)&&("wbt_auto_answer"===s?this._autoAnswer="true"===a.wbt_auto_answer:this.variables[s]=a[s]);a&&a.hasOwnProperty("cc_attempt_id")&&this.client.agent&&(this.task=this.client.agent.task.get(+a.cc_attempt_id)||null)}function En(e){return e.messenger=e.type,e}var Qn,jn=(Qn=Error,D.__extends(Un,Qn),Un.id="device_not_found",Un);function Un(e){var t=Qn.call(this,e)||this;return t.id=Un.id,t}var Gn,Bn=(Gn=Error,D.__extends(Mn,Gn),Mn.id="device_not_allow",Mn);function Mn(e){var t=Gn.call(this,e)||this;return t.id=Mn.id,t}var Hn,Ln=(Hn=i.EventEmitter,D.__extends(Dn,Hn),Dn.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()}},Dn.prototype.send=function(e){return this.socket.send(JSON.stringify(e)),null},Dn.prototype.close=function(e){this.socket.close(e||1e3),delete this.socket},Dn.prototype.onOpen=function(){this.emit("open")},Dn.prototype.onClose=function(e){this.emit("close",e),this.off("*")},Dn.prototype.onMessage=function(e){var t;"\0\0\0\0"!==e&&(t=JSON.parse(e),this.emit("message",t))},Dn);function Dn(e){var t=Hn.call(this)||this;return t.host=e,t}var Fn,Nn,Jn,zn="call",Vn="chat",$n="user_state",Yn="agent_status";(Nn=Fn=Fn||{}).NotFoundError="NotFoundError",Nn.NotAllowedError="NotAllowedError",(Jn=f.Response||(f.Response={})).STATUS_FAIL="FAIL",Jn.STATUS_OK="OK";var Zn,er=(Zn=i.EventEmitter,D.__extends(tr,Zn),tr.prototype.connect=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){switch(e.label){case 0:return[4,this.connectToSocket()];case 1:return e.sent(),[2]}})})},tr.prototype.disconnect=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return this.socket.close(),[2]})})},tr.prototype.subscribeCall=function(o,u){return D.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s;return D.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("subscribe_call",u)];case 1:if(t=e.sent(),this.eventHandler.on(zn,o),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}},(s=new Tn(this,a)).createdAt=i.created_at,s.answeredAt=i.answered_at||0,s.bridgedAt=i.bridged_at||0,s.hangupAt=i.hangup_at||0,i.task&&(s.task=new An(this,{attempt_id:i.task.attempt_id,channel:i.task.channel,status:i.task.status,timestamp:Date.now()},i.task),s.queue.reporting="true",s.task.form=i.task.form||null,i.leaving_at&&i.task.processing_sec&&(s.task.startProcessingAt=i.leaving_at,s.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(s.id,s));return[2,t]}})})},tr.prototype.subscribeChat=function(o,u){return D.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s;return D.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("subscribe_chat",u)];case 1:if(t=e.sent(),this.eventHandler.on(Vn,o),t&&t.items)for(n=0,r=t.items;n<r.length;n++){if(i=r[n],a=i.messages.reverse(),(s=new Xn(this,i.id,i.title,i.members,a,i.variables)).createdAt=i.created_at,s.closedAt=i.closed_at,i.task&&(s.task=new An(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&&(s.task.startProcessingAt=i.leaving_at,s.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})),s.task.form=i.task.form||null),i.invite_id)s.setInvite(i.invite_id,i.created_at);else{if(!i.channel_id){this.log.error("conversation "+i.id+" not valid");continue}s.setAnswered(i.channel_id,i.joined_at,{id:i.channel_id,name:"TODO",type:"webitel"})}this.conversationStore.set(s.id,s)}return[2,t]}})})},tr.prototype.subscribeUsersStatus=function(n,r){return D.__awaiter(this,void 0,void 0,function(){var t;return D.__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($n,n),[2,t]}})})},tr.prototype.subscribeAgentsStatus=function(n,r){return D.__awaiter(this,void 0,void 0,function(){var t;return D.__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(Yn,n),[2,t]}})})},tr.prototype.subscribeTask=function(e){this.eventHandler.on("task",e)},tr.prototype.subscribeJob=function(e){this.eventHandler.on("job",e)},tr.prototype.unSubscribe=function(t,e,n){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("un_subscribe_"+t,n)]})})},tr.prototype.destroy=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__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]}})})},tr.prototype.allCall=function(){return Array.from(this.callStore.values())},tr.prototype.allConversations=function(){return Array.from(this.conversationStore.values())},tr.prototype.allTask=function(){return this.agent?Array.from(this.agent.task.values()):[]},tr.prototype.allJob=function(){return this.allTask().filter(nr)},tr.prototype.callById=function(e){if(this.callStore.has(e))return this.callStore.get(e)},tr.prototype.conversationById=function(e){if(this.conversationStore.has(e))return this.conversationStore.get(e)},tr.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}},tr.prototype.reportingTask=function(t,n){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("cc_reporting",D.__assign({attempt_id:t},n))]})})},tr.prototype.agentActiveTasks=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("cc_agent_tasks",{agent_id:t})]})})},tr.prototype.auth=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("authentication_challenge",{token:this._config.token})]})})},tr.prototype.ping=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("ping",{ping:1})]})})},tr.prototype.sessionInfo=function(){return this.connectionInfo.session},Object.defineProperty(tr.prototype,"version",{get:function(){return this.connectionInfo.server_version},enumerable:!0,configurable:!0}),Object.defineProperty(tr.prototype,"buildVersion",{get:function(){return'"0.1.135"'},enumerable:!0,configurable:!0}),Object.defineProperty(tr.prototype,"instanceId",{get:function(){return this.connectionInfo.sock_id},enumerable:!0,configurable:!0}),tr.prototype.agentSession=function(){return D.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l,d,_;return D.__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 Pn(this,t),[4,this.agentActiveTasks(this.agent.agentId)];case 2:for(n=e.sent(),r=0,i=n.items;r<i.length;r++)a=i[r],(s=new An(this,{status:a.status,timestamp:Date.now(),channel:a.channel,attempt_id:a.attempt_id},a)).postProcessData={},s.setState(a.state),a.bridged_at&&(s.bridgedAt=a.bridged_at,s.answeredAt=a.bridged_at),a.leaving_at&&(s.closedAt=a.leaving_at),a.leaving_at&&a.processing_sec&&(s.startProcessingAt=a.leaving_at,s.setProcessing(a.leaving_at,{sec:a.processing_sec||0,timeout:a.processing_timeout_at||null,renewal_sec:a.processing_renewal_sec||0})),s.form=a.form||null,this.agent.task.set(s.id,s);for(o=0,u=this.allCall();o<u.length;o++)(c=u[o]).task&&this.agent.task.set(c.task.id,c.task);for(l=0,d=this.allConversations();l<d.length;l++)(_=d[l]).task&&this.agent.task.set(_.task.id,_.task);return[2,this.agent]}})})},tr.prototype.invite=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("call_invite",t)]})})},tr.prototype.call=function(n){return D.__awaiter(this,void 0,void 0,function(){var t;return D.__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]}})})},tr.prototype.callRecordId=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("call_recordings",{id:t})]})})},tr.prototype.eavesdrop=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("call_eavesdrop",t)]})})},tr.prototype.agentSetOnline=function(t,n,r){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("cc_agent_online",{agent_id:t,channels:n,on_demand:r})]})})},tr.prototype.agentSetWaiting=function(t,n){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("cc_agent_waiting",{agent_id:t,channel:n})]})})},tr.prototype.agentSetPause=function(t,n){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("cc_agent_pause",{agent_id:t,payload:n})]})})},tr.prototype.agentSetOffline=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("cc_agent_offline",{agent_id:t})]})})},tr.prototype.inviteToUser=function(e){return this.request("call_user",e)},tr.prototype.answer=function(n,r){return D.__awaiter(this,void 0,void 0,function(){var t;return D.__generator(this,function(e){return(t=this.callById(n))?[2,t.answer(r)]:[2]})})},tr.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})})},tr.prototype.useWebPhone=function(){return this._config.registerWebDevice||!1},tr.prototype.callDestroyed=function(e){return 0<e.hangupAt&&!this.hasAgentTask(e.task)},tr.prototype.conversationDestroyed=function(e){return 0<e.closedAt&&!this.hasAgentTask(e.task)},tr.prototype.reportingChannelTask=function(e){switch(e.channel){case yn.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 yn.Chat:if(e.agentChannelId){var i=this.conversationById(e.agentChannelId);if(i&&this.conversationDestroyed(i))return void this.destroyConversation(i)}}},tr.prototype.registerCallClient=function(i){return D.__awaiter(this,void 0,void 0,function(){var t,n,r=this;return D.__generator(this,function(e){switch(e.label){case 0:this.phone=i,this.phone.on("peerStreams",function(e,t){var n=r.callBySession(e);n&&!n.peerStreams.length&&(n.setPeerStreams(t),r.eventHandler.emit(zn,f.CallActions.PeerStream,n))}),this.phone.on("localStreams",function(e,t){var n=r.callBySession(e);n&&!n.localStreams.length&&(n.setLocalStreams(t),r.eventHandler.emit(zn,f.CallActions.LocalStream,n))}),this.phone.on("newSession",this.onNewCallSession.bind(this)),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 n=e.sent(),this.log.error(n),[3,5];case 5:return[2]}})})},tr.prototype.deviceConfig=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("user_default_device",{name:t})]})})},tr.prototype.storeFile=function(d,_,h){return D.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l;return D.__generator(this,function(e){switch(e.label){case 0:if(!_||_.length<1)throw new Error("no files");for(t=new FormData,n=0,r=_;n<r.length;n++)i=r[n],t.append(i.name,i);return[4,U.post(this.basePath+"/api/storage/file/"+d+"/upload",t,{headers:((l={})["X-Webitel-Access"]=this._config.token,l),onUploadProgress:h})];case 1:for(a=e.sent(),s=a.data,o=0,u=s;o<u.length;o++)(c=u[o]).shared=this.basePath+c.shared;return[2,s]}})})},tr.prototype.fileUrlDownload=function(e){return this.basePath+"/api/storage/file/"+e+"/download?access_token="+this._config.token},tr.prototype.fileUrlStream=function(e){return this.basePath+"/api/storage/file/"+e+"/stream?access_token="+this._config.token},tr.prototype.handleError=function(e){if(e)switch(e.name){case Fn.NotFoundError:this.emit("error",new jn(e.message));break;case Fn.NotAllowedError:this.emit("error",new Bn(e.message));break;default:this.emit("error",e)}},tr.prototype.onMessage=function(n){return D.__awaiter(this,void 0,void 0,function(){var t;return D.__generator(this,function(e){switch(e.label){case 0:return this.log.debug("receive message: ",n),0<n.seq_reply?(this.queueRequest.has(n.seq_reply)&&(t=this.queueRequest.get(n.seq_reply),this.queueRequest.delete(n.seq_reply),n.status===f.Response.STATUS_OK?t.resolve(n.data):t.reject(n.error)),[3,13]):[3,1];case 1:switch(n.event){case"hello":return[3,2];case zn:return[3,4];case Vn:return[3,6];case $n:return[3,8];case"sip":return[3,9];case Yn:return[3,10];case"channel":return[3,11]}return[3,12];case 2:return[4,this.connected(n.data)];case 3:return e.sent(),this.log.debug("opened session "+this.connectionInfo.sock_id+" for userId="+this.connectionInfo.session.user_id),[3,13];case 4:return[4,this.handleCallEvents(n.data.call)];case 5:return e.sent(),[3,13];case 6:return[4,this.handleChatEvents(n.data)];case 7:return e.sent(),[3,13];case 8:return this.handleUserStateEvent(n.data.state),[3,13];case 9:return this.eventHandler.emit("sip",n.data),[3,13];case 10:return this.handleAgentStatus(n.data),[3,13];case 11:return this.handleChannelEvents(n.data),[3,13];case 12:this.log.error("event "+n.event+" not handler"),e.label=13;case 13:return[2]}})})},tr.prototype.handleAgentStatus=function(e){this.agent&&e.agent_id===this.agent.agentId&&this.agent.setStatus(e),this.eventHandler.emit(Yn,e,this.agent)},tr.prototype.handleChannelEvents=function(e){var t,n;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),n=t.state,-1<[f.ChannelState.Missed.toString(),f.ChannelState.Waiting,f.ChannelState.WrapTime,f.JobState.Closed].indexOf(n)&&this.eventHandler.emit("job",f.JobState.Destroy,t)))},tr.prototype.pingServer=function(){return D.__awaiter(this,void 0,void 0,function(){var t,n=this;return D.__generator(this,function(e){switch(e.label){case 0:return this.pingTimer&&this.connectionInfo.ping_interval?(t=setTimeout(function(){return D.__awaiter(n,void 0,void 0,function(){return D.__generator(this,function(e){return this.socket.close(3005),[2]})})},this.connectionInfo.ping_interval/2),[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]}})})},tr.prototype.connected=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__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 fn(this.instanceId,this._config.debug))]:[2]}})})},tr.prototype.callBySession=function(e){for(var t=0,n=this.allCall();t<n.length;t++){var r=n[t];if(r.sip===e)return r}},tr.prototype.onNewCallSession=function(n){return D.__awaiter(this,void 0,void 0,function(){var t;return D.__generator(this,function(e){return(t=n.callId?this.callById(n.callId):this.callBySipId(n.id))&&(t.setSip(n),this.checkAutoAnswer(t)),[2]})})},tr.prototype.checkAutoAnswer=function(e){e.autoAnswer&&e.answerDelay({video:e.params.video,screen:e.params.screen,disableStun:e.params.disableStun},300)},tr.prototype.connectToSocket=function(){var n=this;return new Promise(function(e,t){try{n.socket=new Ln(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),n.eventHandler.off("*"),1e3!==e&&(n.emit("disconnected",e),t(new Error("close socket code: "+e)))}),n.socket.on("open",function(){e(null),n.emit("connected")})})},tr.prototype.handleUserStateEvent=function(e){this.eventHandler.emit($n,e)},tr.prototype.handleCallEvents=function(n){return D.__awaiter(this,void 0,void 0,function(){var t;return D.__generator(this,function(e){switch(n.timestamp=Date.now(),n.event){case f.CallActions.Ringing:t=new Tn(this,n),this.callStore.set(t.id,t),this.checkAutoAnswer(t);break;case f.CallActions.Active:(t=this.callById(n.id))&&t.setActive(n);break;case f.CallActions.Bridge:(t=this.callById(n.id))&&t.setBridged(n);break;case f.CallActions.Execute:(t=this.callById(n.id))&&t.setExecute(n.data);break;case f.CallActions.DTMF:(t=this.callById(n.id))&&t.addDigit(n.data);break;case f.CallActions.Voice:(t=this.callById(n.id))&&t.setVoice();break;case f.CallActions.Silence:(t=this.callById(n.id))&&t.setSilence();break;case f.CallActions.Hold:(t=this.callById(n.id))&&t.setHold(n);break;case f.CallActions.Hangup:(t=this.callById(n.id))&&t.setHangup(n);break;default:throw new Error("Unhandled action")}return t&&(this.eventHandler.emit(zn,n.event,t),this.callDestroyed(t)&&this.destroyCall(t)),[2]})})},tr.prototype.handleChatEvents=function(p){return D.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l,d,_,h;return D.__generator(this,function(e){switch(n=Date.now(),p.action){case f.ChatActions.UserInvite:r=p.data,(t=new Xn(this,r.conversation_id,r.title,r.members,r.messages,r.variables)).setInvite(r.invite_id,n),this.conversationStore.set(t.id,t);break;case f.ChatActions.Joined:i=p.data,(t=this.conversationById(i.member.id))&&t.setAnswered(i.member.id,n,i.member);break;case f.ChatActions.Message:for((a=p.data).timestamp=n,s=0,o=this.allConversations();s<o.length;s++)!(d=o[s]).closedAt&&-1<d.membersId.indexOf(a.channel_id)&&(t=d);t&&t.newMessage(a);break;case f.ChatActions.Close:for(u=p.data,c=0,l=this.allConversations();c<l.length;c++)!(d=l[c]).closedAt&&-1<d.membersId.indexOf(u.from_channel_id)&&(t=d);t&&t.setClosed(n);break;case f.ChatActions.Leave:_=p.data,(t=this.conversationById(_.leaved_channel_id))&&t.setClosed(n);break;case f.ChatActions.Decline:h=p.data,(t=this.conversationById(h.invite_id))&&t.setClosed(n)}return t&&(this.eventHandler.emit(Vn,p.action,t),this.conversationDestroyed(t)&&this.destroyConversation(t)),[2]})})},tr.prototype.hasAgentTask=function(e){return!(!this.agent||!e)&&this.agent.hasTask(e)},tr.prototype.destroyCall=function(e){this.callStore.delete(e.id),this.eventHandler.emit(zn,f.CallActions.Destroy,e)},tr.prototype.destroyConversation=function(e){this.conversationStore.delete(e.id),this.eventHandler.emit(Vn,f.ChatActions.Destroy,e)},tr);function tr(e){var t,n,r=Zn.call(this)||this;return r._config=e,r.reqSeq=0,r.queueRequest=new Map,r.log=new ln,r.eventHandler=new i.EventEmitter,r.callStore=new Map,r.conversationStore=new Map,r.pingTimer=null,r.basePath=""+(t=e.storageEndpoint||e.endpoint,(n=t.replace(/^ws/,"http")).endsWith("/")&&(n=n.slice(0,-1)),n.endsWith("/ws")&&(n=n.slice(0,-3)),n),r}function nr(e){return e.channel===yn.Task}var rr,ir=(rr=i.EventEmitter,D.__extends(ar,rr),ar);function ar(){return null!==rr&&rr.apply(this,arguments)||this}var sr="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var or,ur,cr=(function(c){var e=sr&&sr.__generator||function(n,r){var i,a,s,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[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(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,s&&(t=[2&t[0],s.value]),t[0]){case 0:case 1:s=t;break;case 4:return o.label++,{value:t[1],done:!1};case 5:o.label++,a=t[1],t=[0];continue;case 7:t=o.ops.pop(),o.trys.pop();continue;default:if(!(s=0<(s=o.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){o=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){o.label=t[1];break}if(6===t[0]&&o.label<s[1]){o.label=s[1],s=t;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(t);break}s[2]&&o.ops.pop(),o.trys.pop();continue}t=r.call(n,o)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}};Object.defineProperty(c,"__esModule",{value:!0}),c.$listeners=Symbol("EventEmitter.listeners"),c.$addListener=Symbol("EventEmitter.addListener");var t=(n.count=function(e,t){var n=0,r=e[c.$listeners][t];if(r)for(var i=r.first;++n&&i.next;)i=i.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);return this}if("function"==typeof t){var i=this[c.$listeners][e];if(i&&function(e,t){for(var n=null,r=e.first;;)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}(i,function(e){return e.fn==t}))return this}return delete this[c.$listeners][e],this._onEventUnhandled&&this._onEventUnhandled(e),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;var o=s.apply(void 0,n);void 0!==o&&(t=o)}},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&&(t=n,a=l(this[c.$listeners],t,{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}((or={exports:{}},or.exports)),or.exports);(ur=cr)&&ur.__esModule&&Object.prototype.hasOwnProperty.call(ur,"default")&&ur.default;cr.$listeners,cr.$addListener;var lr=cr.EventEmitter,dr=(Object.defineProperty(_r.prototype,"id",{get:function(){return this.callId},enumerable:!0,configurable:!0}),_r.prototype.getLocalMedia=function(){return[]},_r.prototype.getPeerMedia=function(){return[]},_r.prototype.answer=function(e){var t=this;return new Promise(function(e){t.client.answer(t.id),e()})},_r);function _r(e,t){this.client=e,this.callId=t,this.incoming=!1,this.instanceId="fixme"}var hr,pr=(hr=lr,D.__extends(fr,hr),fr.prototype.callOption=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,t]})})},fr.prototype.register=function(e){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2]})})},fr.prototype.unregister=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2]})})},fr.prototype.call=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return t.destination&&this.exec(t.destination),[2]})})},fr.prototype.answer=function(e){this.exec(e,"answer")},fr.prototype.sipSessionByCallId=function(e){return new dr(this,e)},fr.prototype.sipSessionBySipId=function(e){return null},fr.prototype.open=function(e){this.exec(encodeURIComponent(JSON.stringify(D.__assign({token:e},this.config))),"open")},fr.prototype.exec=function(e,t){var n=""+this.schema+e;t&&(n+=" "+t);var r=document.createElement("a");r.download="File name",r.href=n,r.click()},fr);function fr(e){var t=hr.call(this)||this;return t.config=e,t.type="external",t.schema="wtel://",t}f.AgentPauseCauseServiceApiAxiosParamCreator=l,f.AgentPauseCauseServiceApiFp=d,f.AgentPauseCauseServiceApiFactory=function(o,u,c){return{createAgentPauseCause:function(e,t){return d(o).createAgentPauseCause(e,t).then(function(e){return e(c,u)})},deleteAgentPauseCause:function(e,t){return d(o).deleteAgentPauseCause(e,t).then(function(e){return e(c,u)})},patchAgentPauseCause:function(e,t,n){return d(o).patchAgentPauseCause(e,t,n).then(function(e){return e(c,u)})},readAgentPauseCause:function(e,t){return d(o).readAgentPauseCause(e,t).then(function(e){return e(c,u)})},searchAgentPauseCause:function(e,t,n,r,i,a,s){return d(o).searchAgentPauseCause(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateAgentPauseCause:function(e,t,n){return d(o).updateAgentPauseCause(e,t,n).then(function(e){return e(c,u)})}}},f.AgentPauseCauseServiceApi=a,f.AgentServiceApiAxiosParamCreator=q,f.AgentServiceApiFp=A,f.AgentServiceApiFactory=function(b,w,m){return{agentSetState:function(e,t,n){return A(b).agentSetState(e,t,n).then(function(e){return e(m,w)})},agentStateHistory:function(e,t,n,r,i,a,s,o){return A(b).agentStateHistory(e,t,n,r,i,a,s,o).then(function(e){return e(m,w)})},agentTodayStatistics:function(e,t,n){return A(b).agentTodayStatistics(e,t,n).then(function(e){return e(m,w)})},createAgent:function(e,t){return A(b).createAgent(e,t).then(function(e){return e(m,w)})},deleteAgent:function(e,t,n){return A(b).deleteAgent(e,t,n).then(function(e){return e(m,w)})},patchAgent:function(e,t,n){return A(b).patchAgent(e,t,n).then(function(e){return e(m,w)})},readAgent:function(e,t,n){return A(b).readAgent(e,t,n).then(function(e){return e(m,w)})},searchAgent:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y){return A(b).searchAgent(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y).then(function(e){return e(m,w)})},searchAgentCallStatistics:function(e,t,n,r,i,a,s,o,u,c){return A(b).searchAgentCallStatistics(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(m,w)})},searchAgentInQueue:function(e,t,n,r,i,a,s){return A(b).searchAgentInQueue(e,t,n,r,i,a,s).then(function(e){return e(m,w)})},searchAgentInQueueStatistics:function(e,t,n){return A(b).searchAgentInQueueStatistics(e,t,n).then(function(e){return e(m,w)})},searchAgentInTeam:function(e,t,n,r,i,a){return A(b).searchAgentInTeam(e,t,n,r,i,a).then(function(e){return e(m,w)})},searchAgentStateHistory:function(e,t,n,r,i,a,s,o,u){return A(b).searchAgentStateHistory(e,t,n,r,i,a,s,o,u).then(function(e){return e(m,w)})},searchAgentStatusStatistic:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y){return A(b).searchAgentStatusStatistic(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y).then(function(e){return e(m,w)})},searchAgentStatusStatisticItem:function(e,t,n,r){return A(b).searchAgentStatusStatisticItem(e,t,n,r).then(function(e){return e(m,w)})},searchLookupUsersAgentNotExists:function(e,t,n,r,i){return A(b).searchLookupUsersAgentNotExists(e,t,n,r,i).then(function(e){return e(m,w)})},searchPauseCauseForAgent:function(e,t,n){return A(b).searchPauseCauseForAgent(e,t,n).then(function(e){return e(m,w)})},updateAgent:function(e,t,n){return A(b).updateAgent(e,t,n).then(function(e){return e(m,w)})},updateAgentStatus:function(e,t,n){return A(b).updateAgentStatus(e,t,n).then(function(e){return e(m,w)})}}},f.AgentServiceApi=c,f.AgentSkillServiceApiAxiosParamCreator=h,f.AgentSkillServiceApiFp=p,f.AgentSkillServiceApiFactory=function(u,c,l){return{createAgentSkill:function(e,t,n){return p(u).createAgentSkill(e,t,n).then(function(e){return e(l,c)})},deleteAgentSkill:function(e,t,n,r){return p(u).deleteAgentSkill(e,t,n,r).then(function(e){return e(l,c)})},patchAgentSkill:function(e,t,n,r){return p(u).patchAgentSkill(e,t,n,r).then(function(e){return e(l,c)})},readAgentSkill:function(e,t,n,r){return p(u).readAgentSkill(e,t,n,r).then(function(e){return e(l,c)})},searchAgentSkill:function(e,t,n,r,i,a,s,o){return p(u).searchAgentSkill(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},searchLookupAgentNotExistsSkill:function(e,t,n,r,i,a){return p(u).searchLookupAgentNotExistsSkill(e,t,n,r,i,a).then(function(e){return e(l,c)})},updateAgentSkill:function(e,t,n,r){return p(u).updateAgentSkill(e,t,n,r).then(function(e){return e(l,c)})}}},f.AgentSkillServiceApi=v,f.AgentTeamServiceApiAxiosParamCreator=b,f.AgentTeamServiceApiFp=w,f.AgentTeamServiceApiFactory=function(c,l,d){return{createAgentTeam:function(e,t){return w(c).createAgentTeam(e,t).then(function(e){return e(d,l)})},deleteAgentTeam:function(e,t,n){return w(c).deleteAgentTeam(e,t,n).then(function(e){return e(d,l)})},readAgentTeam:function(e,t,n){return w(c).readAgentTeam(e,t,n).then(function(e){return e(d,l)})},searchAgentTeam:function(e,t,n,r,i,a,s,o,u){return w(c).searchAgentTeam(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateAgentTeam:function(e,t,n){return w(c).updateAgentTeam(e,t,n).then(function(e){return e(d,l)})}}},f.AgentTeamServiceApi=C,f.BackendProfileServiceApiAxiosParamCreator=S,f.BackendProfileServiceApiFp=K,f.BackendProfileServiceApiFactory=function(o,u,c){return{createBackendProfile:function(e,t){return K(o).createBackendProfile(e,t).then(function(e){return e(c,u)})},deleteBackendProfile:function(e,t,n){return K(o).deleteBackendProfile(e,t,n).then(function(e){return e(c,u)})},patchBackendProfile:function(e,t,n){return K(o).patchBackendProfile(e,t,n).then(function(e){return e(c,u)})},readBackendProfile:function(e,t,n){return K(o).readBackendProfile(e,t,n).then(function(e){return e(c,u)})},searchBackendProfile:function(e,t,n,r,i,a,s){return K(o).searchBackendProfile(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateBackendProfile:function(e,t,n){return K(o).updateBackendProfile(e,t,n).then(function(e){return e(c,u)})}}},f.BackendProfileServiceApi=O,f.BucketServiceApiAxiosParamCreator=I,f.BucketServiceApiFp=W,f.BucketServiceApiFactory=function(o,u,c){return{createBucket:function(e,t){return W(o).createBucket(e,t).then(function(e){return e(c,u)})},deleteBucket:function(e,t,n){return W(o).deleteBucket(e,t,n).then(function(e){return e(c,u)})},readBucket:function(e,t,n){return W(o).readBucket(e,t,n).then(function(e){return e(c,u)})},searchBucket:function(e,t,n,r,i,a,s){return W(o).searchBucket(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateBucket:function(e,t,n){return W(o).updateBucket(e,t,n).then(function(e){return e(c,u)})}}},f.BucketServiceApi=x,f.CalendarServiceApiAxiosParamCreator=Q,f.CalendarServiceApiFp=j,f.CalendarServiceApiFactory=function(o,u,c){return{createCalendar:function(e,t){return j(o).createCalendar(e,t).then(function(e){return e(c,u)})},deleteCalendar:function(e,t,n){return j(o).deleteCalendar(e,t,n).then(function(e){return e(c,u)})},readCalendar:function(e,t,n){return j(o).readCalendar(e,t,n).then(function(e){return e(c,u)})},searchCalendar:function(e,t,n,r,i,a,s){return j(o).searchCalendar(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},searchTimezones:function(e,t,n,r){return j(o).searchTimezones(e,t,n,r).then(function(e){return e(c,u)})},updateCalendar:function(e,t,n){return j(o).updateCalendar(e,t,n).then(function(e){return e(c,u)})}}},f.CalendarServiceApi=M,f.CallServiceApiAxiosParamCreator=L,f.CallServiceApiFp=N,f.CallServiceApiFactory=function(E,Q,j){return{aggregateHistoryCall:function(e,t){return N(E).aggregateHistoryCall(e,t).then(function(e){return e(j,Q)})},blindTransferCall:function(e,t,n){return N(E).blindTransferCall(e,t,n).then(function(e){return e(j,Q)})},confirmPush:function(e,t){return N(E).confirmPush(e,t).then(function(e){return e(j,Q)})},createCall:function(e,t){return N(E).createCall(e,t).then(function(e){return e(j,Q)})},createCallAnnotation:function(e,t,n){return N(E).createCallAnnotation(e,t,n).then(function(e){return e(j,Q)})},deleteCallAnnotation:function(e,t,n){return N(E).deleteCallAnnotation(e,t,n).then(function(e){return e(j,Q)})},dtmfCall:function(e,t,n){return N(E).dtmfCall(e,t,n).then(function(e){return e(j,Q)})},eavesdropCall:function(e,t,n){return N(E).eavesdropCall(e,t,n).then(function(e){return e(j,Q)})},hangupCall:function(e,t,n){return N(E).hangupCall(e,t,n).then(function(e){return e(j,Q)})},holdCall:function(e,t,n){return N(E).holdCall(e,t,n).then(function(e){return e(j,Q)})},readCall:function(e,t,n){return N(E).readCall(e,t,n).then(function(e){return e(j,Q)})},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,O){return N(E).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,O).then(function(e){return e(j,Q)})},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,O,T,k,I,W,X,x){return N(E).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,O,T,k,I,W,X,x).then(function(e){return e(j,Q)})},unHoldCall:function(e,t,n){return N(E).unHoldCall(e,t,n).then(function(e){return e(j,Q)})},updateCallAnnotation:function(e,t,n,r){return N(E).updateCallAnnotation(e,t,n,r).then(function(e){return e(j,Q)})}}},f.CallServiceApi=z,f.CognitiveProfileServiceApiAxiosParamCreator=$,f.CognitiveProfileServiceApiFp=Y,f.CognitiveProfileServiceApiFactory=function(c,l,d){return{createCognitiveProfile:function(e,t){return Y(c).createCognitiveProfile(e,t).then(function(e){return e(d,l)})},deleteCognitiveProfile:function(e,t){return Y(c).deleteCognitiveProfile(e,t).then(function(e){return e(d,l)})},patchCognitiveProfile:function(e,t,n){return Y(c).patchCognitiveProfile(e,t,n).then(function(e){return e(d,l)})},readCognitiveProfile:function(e,t){return Y(c).readCognitiveProfile(e,t).then(function(e){return e(d,l)})},searchCognitiveProfile:function(e,t,n,r,i,a,s,o,u){return Y(c).searchCognitiveProfile(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateCognitiveProfile:function(e,t,n){return Y(c).updateCognitiveProfile(e,t,n).then(function(e){return e(d,l)})}}},f.CognitiveProfileServiceApi=ee,f.CommunicationTypeServiceApiAxiosParamCreator=ne,f.CommunicationTypeServiceApiFp=re,f.CommunicationTypeServiceApiFactory=function(o,u,c){return{createCommunicationType:function(e,t){return re(o).createCommunicationType(e,t).then(function(e){return e(c,u)})},deleteCommunicationType:function(e,t,n){return re(o).deleteCommunicationType(e,t,n).then(function(e){return e(c,u)})},readCommunicationType:function(e,t,n){return re(o).readCommunicationType(e,t,n).then(function(e){return e(c,u)})},searchCommunicationType:function(e,t,n,r,i,a,s){return re(o).searchCommunicationType(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateCommunicationType:function(e,t,n){return re(o).updateCommunicationType(e,t,n).then(function(e){return e(c,u)})}}},f.CommunicationTypeServiceApi=ae,f.EmailProfileServiceApiAxiosParamCreator=oe,f.EmailProfileServiceApiFp=ue,f.EmailProfileServiceApiFactory=function(s,o,u){return{createEmailProfile:function(e,t){return ue(s).createEmailProfile(e,t).then(function(e){return e(u,o)})},deleteEmailProfile:function(e,t){return ue(s).deleteEmailProfile(e,t).then(function(e){return e(u,o)})},patchEmailProfile:function(e,t,n){return ue(s).patchEmailProfile(e,t,n).then(function(e){return e(u,o)})},readEmailProfile:function(e,t){return ue(s).readEmailProfile(e,t).then(function(e){return e(u,o)})},searchEmailProfile:function(e,t,n,r,i,a){return ue(s).searchEmailProfile(e,t,n,r,i,a).then(function(e){return e(u,o)})},updateEmailProfile:function(e,t,n){return ue(s).updateEmailProfile(e,t,n).then(function(e){return e(u,o)})}}},f.EmailProfileServiceApi=le,f.FileServiceApiAxiosParamCreator=_e,f.FileServiceApiFp=he,f.FileServiceApiFactory=function(n,r,i){return{deleteFiles:function(e,t){return he(n).deleteFiles(e,t).then(function(e){return e(i,r)})}}},f.FileServiceApi=fe,f.FileTranscriptServiceApiAxiosParamCreator=ve,f.FileTranscriptServiceApiFp=ye,f.FileTranscriptServiceApiFactory=function(i,a,s){return{createFileTranscript:function(e,t){return ye(i).createFileTranscript(e,t).then(function(e){return e(s,a)})},getFileTranscriptPhrases:function(e,t,n,r){return ye(i).getFileTranscriptPhrases(e,t,n,r).then(function(e){return e(s,a)})}}},f.FileTranscriptServiceApi=we,f.ImportTemplateServiceApiAxiosParamCreator=qe,f.ImportTemplateServiceApiFp=Ae,f.ImportTemplateServiceApiFactory=function(o,u,c){return{createImportTemplate:function(e,t){return Ae(o).createImportTemplate(e,t).then(function(e){return e(c,u)})},deleteImportTemplate:function(e,t){return Ae(o).deleteImportTemplate(e,t).then(function(e){return e(c,u)})},patchImportTemplate:function(e,t,n){return Ae(o).patchImportTemplate(e,t,n).then(function(e){return e(c,u)})},readImportTemplate:function(e,t){return Ae(o).readImportTemplate(e,t).then(function(e){return e(c,u)})},searchImportTemplate:function(e,t,n,r,i,a,s){return Ae(o).searchImportTemplate(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateImportTemplate:function(e,t,n){return Ae(o).updateImportTemplate(e,t,n).then(function(e){return e(c,u)})}}},f.ImportTemplateServiceApi=Re,f.ListServiceApiAxiosParamCreator=Ke,f.ListServiceApiFp=Pe,f.ListServiceApiFactory=function(u,c,l){return{createList:function(e,t){return Pe(u).createList(e,t).then(function(e){return e(l,c)})},createListCommunication:function(e,t,n){return Pe(u).createListCommunication(e,t,n).then(function(e){return e(l,c)})},deleteList:function(e,t,n){return Pe(u).deleteList(e,t,n).then(function(e){return e(l,c)})},deleteListCommunication:function(e,t,n,r){return Pe(u).deleteListCommunication(e,t,n,r).then(function(e){return e(l,c)})},readList:function(e,t,n){return Pe(u).readList(e,t,n).then(function(e){return e(l,c)})},readListCommunication:function(e,t,n,r){return Pe(u).readListCommunication(e,t,n,r).then(function(e){return e(l,c)})},searchList:function(e,t,n,r,i,a,s){return Pe(u).searchList(e,t,n,r,i,a,s).then(function(e){return e(l,c)})},searchListCommunication:function(e,t,n,r,i,a,s,o){return Pe(u).searchListCommunication(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateList:function(e,t,n){return Pe(u).updateList(e,t,n).then(function(e){return e(l,c)})},updateListCommunication:function(e,t,n,r){return Pe(u).updateListCommunication(e,t,n,r).then(function(e){return e(l,c)})}}},f.ListServiceApi=Te,f.MediaFileServiceApiAxiosParamCreator=Ie,f.MediaFileServiceApiFp=We,f.MediaFileServiceApiFactory=function(o,u,c){return{deleteMediaFile:function(e,t,n){return We(o).deleteMediaFile(e,t,n).then(function(e){return e(c,u)})},readMediaFile:function(e,t,n){return We(o).readMediaFile(e,t,n).then(function(e){return e(c,u)})},searchMediaFile:function(e,t,n,r,i,a,s){return We(o).searchMediaFile(e,t,n,r,i,a,s).then(function(e){return e(c,u)})}}},f.MediaFileServiceApi=xe,f.MemberServiceApiAxiosParamCreator=Qe,f.MemberServiceApiFp=je,f.MemberServiceApiFactory=function(m,q,A){return{attemptCallback:function(e,t,n){return je(m).attemptCallback(e,t,n).then(function(e){return e(A,q)})},attemptResult:function(e,t,n,r,i){return je(m).attemptResult(e,t,n,r,i).then(function(e){return e(A,q)})},attemptsRenewalResult:function(e,t,n){return je(m).attemptsRenewalResult(e,t,n).then(function(e){return e(A,q)})},createAttempt:function(e,t,n,r){return je(m).createAttempt(e,t,n,r).then(function(e){return e(A,q)})},createMember:function(e,t,n){return je(m).createMember(e,t,n).then(function(e){return e(A,q)})},createMemberBulk:function(e,t,n){return je(m).createMemberBulk(e,t,n).then(function(e){return e(A,q)})},deleteMember:function(e,t,n,r){return je(m).deleteMember(e,t,n,r).then(function(e){return e(A,q)})},deleteMembers:function(e,t,n){return je(m).deleteMembers(e,t,n).then(function(e){return e(A,q)})},patchMember:function(e,t,n,r){return je(m).patchMember(e,t,n,r).then(function(e){return e(A,q)})},readMember:function(e,t,n,r){return je(m).readMember(e,t,n,r).then(function(e){return e(A,q)})},resetMembers:function(e,t,n){return je(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 je(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 je(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 je(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 je(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 je(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 je(m).updateMember(e,t,n,r).then(function(e){return e(A,q)})}}},f.MemberServiceApi=Ge,f.OutboundResourceGroupServiceApiAxiosParamCreator=Me,f.OutboundResourceGroupServiceApiFp=He,f.OutboundResourceGroupServiceApiFactory=function(u,c,l){return{createOutboundResourceGroup:function(e,t){return He(u).createOutboundResourceGroup(e,t).then(function(e){return e(l,c)})},createOutboundResourceInGroup:function(e,t,n){return He(u).createOutboundResourceInGroup(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceGroup:function(e,t,n){return He(u).deleteOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceInGroup:function(e,t,n,r){return He(u).deleteOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})},readOutboundResourceGroup:function(e,t,n){return He(u).readOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},readOutboundResourceInGroup:function(e,t,n,r){return He(u).readOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})},searchOutboundResourceGroup:function(e,t,n,r,i,a,s){return He(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 He(u).searchOutboundResourceInGroup(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateOutboundResourceGroup:function(e,t,n){return He(u).updateOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},updateOutboundResourceInGroup:function(e,t,n,r){return He(u).updateOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})}}},f.OutboundResourceGroupServiceApi=De,f.OutboundResourceServiceApiAxiosParamCreator=Ne,f.OutboundResourceServiceApiFp=Je,f.OutboundResourceServiceApiFactory=function(u,c,l){return{createOutboundResource:function(e,t){return Je(u).createOutboundResource(e,t).then(function(e){return e(l,c)})},createOutboundResourceDisplay:function(e,t,n){return Je(u).createOutboundResourceDisplay(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResource:function(e,t,n){return Je(u).deleteOutboundResource(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceDisplay:function(e,t,n,r){return Je(u).deleteOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})},patchOutboundResource:function(e,t,n){return Je(u).patchOutboundResource(e,t,n).then(function(e){return e(l,c)})},readOutboundResource:function(e,t,n){return Je(u).readOutboundResource(e,t,n).then(function(e){return e(l,c)})},readOutboundResourceDisplay:function(e,t,n,r){return Je(u).readOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})},searchOutboundResource:function(e,t,n,r,i,a,s){return Je(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 Je(u).searchOutboundResourceDisplay(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateOutboundResource:function(e,t,n){return Je(u).updateOutboundResource(e,t,n).then(function(e){return e(l,c)})},updateOutboundResourceDisplay:function(e,t,n,r){return Je(u).updateOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})}}},f.OutboundResourceServiceApi=Ve,f.QueueBucketServiceApiAxiosParamCreator=Ye,f.QueueBucketServiceApiFp=Ze,f.QueueBucketServiceApiFactory=function(u,c,l){return{createQueueBucket:function(e,t,n){return Ze(u).createQueueBucket(e,t,n).then(function(e){return e(l,c)})},deleteQueueBucket:function(e,t,n){return Ze(u).deleteQueueBucket(e,t,n).then(function(e){return e(l,c)})},patchQueueBucket:function(e,t,n,r){return Ze(u).patchQueueBucket(e,t,n,r).then(function(e){return e(l,c)})},readQueueBucket:function(e,t,n){return Ze(u).readQueueBucket(e,t,n).then(function(e){return e(l,c)})},searchQueueBucket:function(e,t,n,r,i,a,s,o){return Ze(u).searchQueueBucket(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateQueueBucket:function(e,t,n,r){return Ze(u).updateQueueBucket(e,t,n,r).then(function(e){return e(l,c)})}}},f.QueueBucketServiceApi=tt,f.QueueHookServiceApiAxiosParamCreator=rt,f.QueueHookServiceApiFp=it,f.QueueHookServiceApiFactory=function(l,d,_){return{createQueueHook:function(e,t,n){return it(l).createQueueHook(e,t,n).then(function(e){return e(_,d)})},deleteQueueHook:function(e,t,n){return it(l).deleteQueueHook(e,t,n).then(function(e){return e(_,d)})},patchQueueHook:function(e,t,n,r){return it(l).patchQueueHook(e,t,n,r).then(function(e){return e(_,d)})},readQueueHook:function(e,t,n){return it(l).readQueueHook(e,t,n).then(function(e){return e(_,d)})},searchQueueHook:function(e,t,n,r,i,a,s,o,u,c){return it(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 it(l).updateQueueHook(e,t,n,r).then(function(e){return e(_,d)})}}},f.QueueHookServiceApi=st,f.QueueResourcesServiceApiAxiosParamCreator=ut,f.QueueResourcesServiceApiFp=ct,f.QueueResourcesServiceApiFactory=function(u,c,l){return{createQueueResourceGroup:function(e,t,n){return ct(u).createQueueResourceGroup(e,t,n).then(function(e){return e(l,c)})},deleteQueueResourceGroup:function(e,t,n,r){return ct(u).deleteQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})},readQueueResourceGroup:function(e,t,n,r){return ct(u).readQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})},searchQueueResourceGroup:function(e,t,n,r,i,a,s,o){return ct(u).searchQueueResourceGroup(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateQueueResourceGroup:function(e,t,n,r){return ct(u).updateQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})}}},f.QueueResourcesServiceApi=dt,f.QueueServiceApiAxiosParamCreator=ht,f.QueueServiceApiFp=pt,f.QueueServiceApiFactory=function(_,h,p){return{createQueue:function(e,t){return pt(_).createQueue(e,t).then(function(e){return e(p,h)})},deleteQueue:function(e,t,n){return pt(_).deleteQueue(e,t,n).then(function(e){return e(p,h)})},patchQueue:function(e,t,n){return pt(_).patchQueue(e,t,n).then(function(e){return e(p,h)})},readQueue:function(e,t,n){return pt(_).readQueue(e,t,n).then(function(e){return e(p,h)})},searchQueue:function(e,t,n,r,i,a,s,o){return pt(_).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 pt(_).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 pt(_).updateQueue(e,t,n).then(function(e){return e(p,h)})}}},f.QueueServiceApi=gt,f.QueueSkillServiceApiAxiosParamCreator=yt,f.QueueSkillServiceApiFp=bt,f.QueueSkillServiceApiFactory=function(p,f,g){return{createQueueSkill:function(e,t,n){return bt(p).createQueueSkill(e,t,n).then(function(e){return e(g,f)})},deleteQueueSkill:function(e,t,n){return bt(p).deleteQueueSkill(e,t,n).then(function(e){return e(g,f)})},patchQueueSkill:function(e,t,n,r){return bt(p).patchQueueSkill(e,t,n,r).then(function(e){return e(g,f)})},readQueueSkill:function(e,t,n){return bt(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 bt(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 bt(p).updateQueueSkill(e,t,n,r).then(function(e){return e(g,f)})}}},f.QueueSkillServiceApi=mt,f.RegionServiceApiAxiosParamCreator=At,f.RegionServiceApiFp=Ct,f.RegionServiceApiFactory=function(l,d,_){return{createRegion:function(e,t){return Ct(l).createRegion(e,t).then(function(e){return e(_,d)})},deleteRegion:function(e,t){return Ct(l).deleteRegion(e,t).then(function(e){return e(_,d)})},patchRegion:function(e,t,n){return Ct(l).patchRegion(e,t,n).then(function(e){return e(_,d)})},readRegion:function(e,t){return Ct(l).readRegion(e,t).then(function(e){return e(_,d)})},searchRegion:function(e,t,n,r,i,a,s,o,u,c){return Ct(l).searchRegion(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},updateRegion:function(e,t,n){return Ct(l).updateRegion(e,t,n).then(function(e){return e(_,d)})}}},f.RegionServiceApi=St,f.RoutingChatPlanServiceApiAxiosParamCreator=Pt,f.RoutingChatPlanServiceApiFp=Ot,f.RoutingChatPlanServiceApiFactory=function(c,l,d){return{createChatPlan:function(e,t){return Ot(c).createChatPlan(e,t).then(function(e){return e(d,l)})},deleteChatPlan:function(e,t){return Ot(c).deleteChatPlan(e,t).then(function(e){return e(d,l)})},patchChatPlan:function(e,t,n){return Ot(c).patchChatPlan(e,t,n).then(function(e){return e(d,l)})},readChatPlan:function(e,t){return Ot(c).readChatPlan(e,t).then(function(e){return e(d,l)})},searchChatPlan:function(e,t,n,r,i,a,s,o,u){return Ot(c).searchChatPlan(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateChatPlan:function(e,t,n){return Ot(c).updateChatPlan(e,t,n).then(function(e){return e(d,l)})}}},f.RoutingChatPlanServiceApi=kt,f.RoutingOutboundCallServiceApiAxiosParamCreator=Wt,f.RoutingOutboundCallServiceApiFp=Xt,f.RoutingOutboundCallServiceApiFactory=function(d,_,h){return{createRoutingOutboundCall:function(e,t){return Xt(d).createRoutingOutboundCall(e,t).then(function(e){return e(h,_)})},deleteRoutingOutboundCall:function(e,t,n){return Xt(d).deleteRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},movePositionRoutingOutboundCall:function(e,t,n,r){return Xt(d).movePositionRoutingOutboundCall(e,t,n,r).then(function(e){return e(h,_)})},patchRoutingOutboundCall:function(e,t,n){return Xt(d).patchRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},readRoutingOutboundCall:function(e,t,n){return Xt(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 Xt(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 Xt(d).updateRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})}}},f.RoutingOutboundCallServiceApi=Et,f.RoutingSchemaServiceApiAxiosParamCreator=jt,f.RoutingSchemaServiceApiFp=Ut,f.RoutingSchemaServiceApiFactory=function(l,d,_){return{createRoutingSchema:function(e,t){return Ut(l).createRoutingSchema(e,t).then(function(e){return e(_,d)})},deleteRoutingSchema:function(e,t,n){return Ut(l).deleteRoutingSchema(e,t,n).then(function(e){return e(_,d)})},patchRoutingSchema:function(e,t,n){return Ut(l).patchRoutingSchema(e,t,n).then(function(e){return e(_,d)})},readRoutingSchema:function(e,t,n){return Ut(l).readRoutingSchema(e,t,n).then(function(e){return e(_,d)})},searchRoutingSchema:function(e,t,n,r,i,a,s,o,u,c){return Ut(l).searchRoutingSchema(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},updateRoutingSchema:function(e,t,n){return Ut(l).updateRoutingSchema(e,t,n).then(function(e){return e(_,d)})}}},f.RoutingSchemaServiceApi=Bt,f.RoutingVariableServiceApiAxiosParamCreator=Ht,f.RoutingVariableServiceApiFp=Lt,f.RoutingVariableServiceApiFactory=function(i,a,s){return{createRoutingVariable:function(e,t){return Lt(i).createRoutingVariable(e,t).then(function(e){return e(s,a)})},deleteRoutingVariable:function(e,t,n){return Lt(i).deleteRoutingVariable(e,t,n).then(function(e){return e(s,a)})},readRoutingVariable:function(e,t,n){return Lt(i).readRoutingVariable(e,t,n).then(function(e){return e(s,a)})},searchRoutingVariable:function(e,t,n,r){return Lt(i).searchRoutingVariable(e,t,n,r).then(function(e){return e(s,a)})},updateRoutingVariable:function(e,t,n){return Lt(i).updateRoutingVariable(e,t,n).then(function(e){return e(s,a)})}}},f.RoutingVariableServiceApi=Ft,f.SkillServiceApiAxiosParamCreator=Jt,f.SkillServiceApiFp=zt,f.SkillServiceApiFactory=function(o,u,c){return{createSkill:function(e,t){return zt(o).createSkill(e,t).then(function(e){return e(c,u)})},deleteSkill:function(e,t,n){return zt(o).deleteSkill(e,t,n).then(function(e){return e(c,u)})},readSkill:function(e,t,n){return zt(o).readSkill(e,t,n).then(function(e){return e(c,u)})},searchSkill:function(e,t,n,r,i,a,s){return zt(o).searchSkill(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateSkill:function(e,t,n){return zt(o).updateSkill(e,t,n).then(function(e){return e(c,u)})}}},f.SkillServiceApi=$t,f.UserHelperServiceApiAxiosParamCreator=Zt,f.UserHelperServiceApiFp=en,f.UserHelperServiceApiFactory=function(n,r,i){return{defaultDeviceConfig:function(e,t){return en(n).defaultDeviceConfig(e,t).then(function(e){return e(i,r)})}}},f.UserHelperServiceApi=nn,f.Configuration=an,f.Client=er,f.Call=Tn,f.Agent=Pn,f.Conversation=Xn,f.DeviceNotFoundError=jn,f.DeviceNotAllowPermissionError=Bn,f.SipClient=ir,f.ExternalClient=pr,f.SipPhone=fn,f.Log=ln,Object.defineProperty(f,"__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(f,D,F,U,i,s){"use strict";U=U&&U.hasOwnProperty("default")?U.default:U;function e(e,t,n){void 0===t&&(t=G),void 0===n&&(n=U),this.basePath=t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}var r,G="https://dev.webitel.com/api".replace(/\/+$/,""),k=(r=Error,D.__extends(t,r),t);function t(e,t){var n=r.call(this,t)||this;return n.field=e,n.name="RequiredError",n}function l(f){var e=this;return{createAgentPauseCause:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createAgentPauseCause.");return t=F.parse("/call_center/pause_causes",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteAgentPauseCause:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteAgentPauseCause.");return t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),l),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},patchAgentPauseCause:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchAgentPauseCause.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchAgentPauseCause.");return t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readAgentPauseCause:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readAgentPauseCause.");return t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),l),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},searchAgentPauseCause:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/pause_causes",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},updateAgentPauseCause:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateAgentPauseCause.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateAgentPauseCause.");return t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function d(c){return{createAgentPauseCause:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,l(c).createAgentPauseCause(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteAgentPauseCause:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,l(c).deleteAgentPauseCause(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchAgentPauseCause:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,l(c).patchAgentPauseCause(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readAgentPauseCause:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,l(c).readAgentPauseCause(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentPauseCause:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,l(c).searchAgentPauseCause(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateAgentPauseCause:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,l(c).updateAgentPauseCause(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var n,a=(n=e,D.__extends(o,n),o.prototype.createAgentPauseCause=function(e,t){var n=this;return d(this.configuration).createAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},o.prototype.deleteAgentPauseCause=function(e,t){var n=this;return d(this.configuration).deleteAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},o.prototype.patchAgentPauseCause=function(e,t,n){var r=this;return d(this.configuration).patchAgentPauseCause(e,t,n).then(function(e){return e(r.axios,r.basePath)})},o.prototype.readAgentPauseCause=function(e,t){var n=this;return d(this.configuration).readAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},o.prototype.searchAgentPauseCause=function(e,t,n,r,i,a,s){var o=this;return d(this.configuration).searchAgentPauseCause(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},o.prototype.updateAgentPauseCause=function(e,t,n){var r=this;return d(this.configuration).updateAgentPauseCause(e,t,n).then(function(e){return e(r.axios,r.basePath)})},o);function o(){return null!==n&&n.apply(this,arguments)||this}function q(K){var e=this;return{agentSetState:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("agentId","Required parameter agentId was null or undefined when calling agentSetState.");if(null==d)throw new k("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(l))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},agentStateHistory:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("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(c))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),g),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.time_from=_),void 0!==h&&(s.time_to=h),void 0!==p&&(s.q=p),void 0!==f&&(s.domain_id=f),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),g.headers),[2,{url:F.format(n),options:i}]}})})},agentTodayStatistics:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("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(c))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return l&&(s.fields=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},createAgent:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createAgent.");return t=F.parse("/call_center/agents",!0),K&&(n=K.baseOptions),r=D.__assign(D.__assign({method:"POST"},n),l),i={},a={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteAgent:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteAgent.");return t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},patchAgent:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchAgent.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchAgent.");return t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readAgent:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readAgent.");return t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchAgent:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S){return void 0===S&&(S={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/agents",!0),K&&(n=K.baseOptions),r=D.__assign(D.__assign({method:"GET"},n),S),i={},a={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,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),t.query=D.__assign(D.__assign(D.__assign({},t.query),a),S.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),S.headers),[2,{url:F.format(t),options:r}]}})})},searchAgentCallStatistics:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/agents/reports/call",!0),K&&(n=K.baseOptions),r=D.__assign(D.__assign({method:"GET"},n),v),i={},a={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),v.headers),[2,{url:F.format(t),options:r}]}})})},searchAgentInQueue:function(c,l,d,_,h,p,f){return void 0===f&&(f={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling searchAgentInQueue.");return t="/call_center/agents/{id}/queues".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),f),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),f.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),f.headers),[2,{url:F.format(n),options:i}]}})})},searchAgentInQueueStatistics:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("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(c))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchAgentInTeam:function(c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling searchAgentInTeam.");return t="/call_center/agents/{id}/teams".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),p),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.domain_id=h),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),p.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),p.headers),[2,{url:F.format(n),options:i}]}})})},searchAgentStateHistory:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/agents/states/history",!0),K&&(n=K.baseOptions),r=D.__assign(D.__assign({method:"GET"},n),g),i={},a={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),g.headers),[2,{url:F.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={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/agents/reports/status",!0),K&&(n=K.baseOptions),r=D.__assign(D.__assign({method:"GET"},n),S),i={},a={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),S.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),S.headers),[2,{url:F.format(t),options:r}]}})})},searchAgentStatusStatisticItem:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("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(c))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),_),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s["time.from"]=l),void 0!==d&&(s["time.to"]=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},searchLookupUsersAgentNotExists:function(u,c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/lookups/agents/users",!0),K&&(n=K.baseOptions),r=D.__assign(D.__assign({method:"GET"},n),_),i={},a={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),_.headers),[2,{url:F.format(t),options:r}]}})})},searchPauseCauseForAgent:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("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(c))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.allow_change=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},updateAgent:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateAgent.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateAgent.");return t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},updateAgentStatus:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateAgentStatus.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateAgentStatus.");return t="/call_center/agents/{id}/status".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),K&&(r=K.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},K&&K.apiKey?"function"!=typeof K.apiKey?[3,2]:[4,K.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,K.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function A(m){return{agentSetState:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).agentSetState(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},agentStateHistory:function(t,n,i,a,s,o,u,c){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).agentStateHistory(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},agentTodayStatistics:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).agentTodayStatistics(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createAgent:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).createAgent(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteAgent:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).deleteAgent(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchAgent:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).patchAgent(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readAgent:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).readAgent(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgent:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgent(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentCallStatistics:function(t,n,i,a,s,o,u,c,l,d){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentCallStatistics(t,n,i,a,s,o,u,c,l,d)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentInQueue:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentInQueue(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentInQueueStatistics:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentInQueueStatistics(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentInTeam:function(t,n,i,a,s,o){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentInTeam(t,n,i,a,s,o)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentStateHistory:function(t,n,i,a,s,o,u,c,l){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentStateHistory(t,n,i,a,s,o,u,c,l)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentStatusStatistic:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentStatusStatistic(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentStatusStatisticItem:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentStatusStatisticItem(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchLookupUsersAgentNotExists:function(t,n,i,a,s){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchLookupUsersAgentNotExists(t,n,i,a,s)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchPauseCauseForAgent:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchPauseCauseForAgent(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateAgent:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).updateAgent(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateAgentStatus:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).updateAgentStatus(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var u,c=(u=e,D.__extends(_,u),_.prototype.agentSetState=function(e,t,n){var r=this;return A(this.configuration).agentSetState(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.agentStateHistory=function(e,t,n,r,i,a,s,o){var u=this;return A(this.configuration).agentStateHistory(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},_.prototype.agentTodayStatistics=function(e,t,n){var r=this;return A(this.configuration).agentTodayStatistics(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.createAgent=function(e,t){var n=this;return A(this.configuration).createAgent(e,t).then(function(e){return e(n.axios,n.basePath)})},_.prototype.deleteAgent=function(e,t,n){var r=this;return A(this.configuration).deleteAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.patchAgent=function(e,t,n){var r=this;return A(this.configuration).patchAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.readAgent=function(e,t,n){var r=this;return A(this.configuration).readAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.searchAgent=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y){var b=this;return A(this.configuration).searchAgent(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)})},_.prototype.searchAgentCallStatistics=function(e,t,n,r,i,a,s,o,u,c){var l=this;return A(this.configuration).searchAgentCallStatistics(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},_.prototype.searchAgentInQueue=function(e,t,n,r,i,a,s){var o=this;return A(this.configuration).searchAgentInQueue(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},_.prototype.searchAgentInQueueStatistics=function(e,t,n){var r=this;return A(this.configuration).searchAgentInQueueStatistics(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.searchAgentInTeam=function(e,t,n,r,i,a){var s=this;return A(this.configuration).searchAgentInTeam(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},_.prototype.searchAgentStateHistory=function(e,t,n,r,i,a,s,o,u){var c=this;return A(this.configuration).searchAgentStateHistory(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},_.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 A(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)})},_.prototype.searchAgentStatusStatisticItem=function(e,t,n,r){var i=this;return A(this.configuration).searchAgentStatusStatisticItem(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},_.prototype.searchLookupUsersAgentNotExists=function(e,t,n,r,i){var a=this;return A(this.configuration).searchLookupUsersAgentNotExists(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},_.prototype.searchPauseCauseForAgent=function(e,t,n){var r=this;return A(this.configuration).searchPauseCauseForAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.updateAgent=function(e,t,n){var r=this;return A(this.configuration).updateAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_.prototype.updateAgentStatus=function(e,t,n){var r=this;return A(this.configuration).updateAgentStatus(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_);function _(){return null!==u&&u.apply(this,arguments)||this}function h(v){var e=this;return{createAgentSkill:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("agentId","Required parameter agentId was null or undefined when calling createAgentSkill.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling createAgentSkill.");return t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteAgentSkill:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("agentId","Required parameter agentId was null or undefined when calling deleteAgentSkill.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},patchAgentSkill:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("agentId","Required parameter agentId was null or undefined when calling patchAgentSkill.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling patchAgentSkill.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})},readAgentSkill:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("agentId","Required parameter agentId was null or undefined when calling readAgentSkill.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},searchAgentSkill:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("agentId","Required parameter agentId was null or undefined when calling searchAgentSkill.");return t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),g),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),g.headers),[2,{url:F.format(n),options:i}]}})})},searchLookupAgentNotExistsSkill:function(c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("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(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),p),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.domain_id=h),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),p.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),p.headers),[2,{url:F.format(n),options:i}]}})})},updateAgentSkill:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("agentId","Required parameter agentId was null or undefined when calling updateAgentSkill.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateAgentSkill.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function p(l){return{createAgentSkill:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).createAgentSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteAgentSkill:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).deleteAgentSkill(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchAgentSkill:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).patchAgentSkill(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readAgentSkill:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).readAgentSkill(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentSkill:function(t,n,i,a,s,o,u,c){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).searchAgentSkill(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchLookupAgentNotExistsSkill:function(t,n,i,a,s,o){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).searchLookupAgentNotExistsSkill(t,n,i,a,s,o)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateAgentSkill:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,h(l).updateAgentSkill(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var g,v=(g=e,D.__extends(y,g),y.prototype.createAgentSkill=function(e,t,n){var r=this;return p(this.configuration).createAgentSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},y.prototype.deleteAgentSkill=function(e,t,n,r){var i=this;return p(this.configuration).deleteAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},y.prototype.patchAgentSkill=function(e,t,n,r){var i=this;return p(this.configuration).patchAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},y.prototype.readAgentSkill=function(e,t,n,r){var i=this;return p(this.configuration).readAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},y.prototype.searchAgentSkill=function(e,t,n,r,i,a,s,o){var u=this;return p(this.configuration).searchAgentSkill(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},y.prototype.searchLookupAgentNotExistsSkill=function(e,t,n,r,i,a){var s=this;return p(this.configuration).searchLookupAgentNotExistsSkill(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},y.prototype.updateAgentSkill=function(e,t,n,r){var i=this;return p(this.configuration).updateAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},y);function y(){return null!==g&&g.apply(this,arguments)||this}function b(v){var e=this;return{createAgentTeam:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createAgentTeam.");return t=F.parse("/call_center/teams",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteAgentTeam:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteAgentTeam.");return t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readAgentTeam:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readAgentTeam.");return t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchAgentTeam:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/teams",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),g.headers),[2,{url:F.format(t),options:r}]}})})},updateAgentTeam:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateAgentTeam.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateAgentTeam.");return t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function w(d){return{createAgentTeam:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,b(d).createAgentTeam(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteAgentTeam:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,b(d).deleteAgentTeam(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readAgentTeam:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,b(d).readAgentTeam(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAgentTeam:function(t,n,i,a,s,o,u,c,l){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,b(d).searchAgentTeam(t,n,i,a,s,o,u,c,l)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateAgentTeam:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,b(d).updateAgentTeam(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var m,C=(m=e,D.__extends(R,m),R.prototype.createAgentTeam=function(e,t){var n=this;return w(this.configuration).createAgentTeam(e,t).then(function(e){return e(n.axios,n.basePath)})},R.prototype.deleteAgentTeam=function(e,t,n){var r=this;return w(this.configuration).deleteAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})},R.prototype.readAgentTeam=function(e,t,n){var r=this;return w(this.configuration).readAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})},R.prototype.searchAgentTeam=function(e,t,n,r,i,a,s,o,u){var c=this;return w(this.configuration).searchAgentTeam(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},R.prototype.updateAgentTeam=function(e,t,n){var r=this;return w(this.configuration).updateAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})},R);function R(){return null!==m&&m.apply(this,arguments)||this}function S(f){var e=this;return{createBackendProfile:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createBackendProfile.");return t=F.parse("/storage/backend_profiles",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteBackendProfile:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteBackendProfile.");return t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},patchBackendProfile:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchBackendProfile.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchBackendProfile.");return t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readBackendProfile:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readBackendProfile.");return t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchBackendProfile:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/storage/backend_profiles",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},updateBackendProfile:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateBackendProfile.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateBackendProfile.");return t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function K(c){return{createBackendProfile:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,S(c).createBackendProfile(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteBackendProfile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,S(c).deleteBackendProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchBackendProfile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,S(c).patchBackendProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readBackendProfile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,S(c).readBackendProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchBackendProfile:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,S(c).searchBackendProfile(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateBackendProfile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,S(c).updateBackendProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var P,O=(P=e,D.__extends(T,P),T.prototype.createBackendProfile=function(e,t){var n=this;return K(this.configuration).createBackendProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},T.prototype.deleteBackendProfile=function(e,t,n){var r=this;return K(this.configuration).deleteBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},T.prototype.patchBackendProfile=function(e,t,n){var r=this;return K(this.configuration).patchBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},T.prototype.readBackendProfile=function(e,t,n){var r=this;return K(this.configuration).readBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},T.prototype.searchBackendProfile=function(e,t,n,r,i,a,s){var o=this;return K(this.configuration).searchBackendProfile(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},T.prototype.updateBackendProfile=function(e,t,n){var r=this;return K(this.configuration).updateBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},T);function T(){return null!==P&&P.apply(this,arguments)||this}function I(f){var e=this;return{createBucket:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createBucket.");return t=F.parse("/call_center/buckets",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteBucket:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteBucket.");return t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readBucket:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readBucket.");return t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchBucket:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/buckets",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},updateBucket:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateBucket.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateBucket.");return t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function W(c){return{createBucket:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,I(c).createBucket(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteBucket:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,I(c).deleteBucket(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readBucket:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,I(c).readBucket(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchBucket:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,I(c).searchBucket(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateBucket:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,I(c).updateBucket(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var X,x=(X=e,D.__extends(E,X),E.prototype.createBucket=function(e,t){var n=this;return W(this.configuration).createBucket(e,t).then(function(e){return e(n.axios,n.basePath)})},E.prototype.deleteBucket=function(e,t,n){var r=this;return W(this.configuration).deleteBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},E.prototype.readBucket=function(e,t,n){var r=this;return W(this.configuration).readBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},E.prototype.searchBucket=function(e,t,n,r,i,a,s){var o=this;return W(this.configuration).searchBucket(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},E.prototype.updateBucket=function(e,t,n){var r=this;return W(this.configuration).updateBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},E);function E(){return null!==X&&X.apply(this,arguments)||this}function Q(f){var e=this;return{createCalendar:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createCalendar.");return t=F.parse("/calendars",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteCalendar:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteCalendar.");return t="/calendars/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readCalendar:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readCalendar.");return t="/calendars/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchCalendar:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/calendars",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},searchTimezones:function(u,c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/calendars/timezones",!0),f&&(n=f.baseOptions),r=D.__assign(D.__assign({method:"GET"},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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),d.headers),[2,{url:F.format(t),options:r}]}})})},updateCalendar:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateCalendar.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateCalendar.");return t="/calendars/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function j(c){return{createCalendar:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Q(c).createCalendar(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteCalendar:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Q(c).deleteCalendar(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readCalendar:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Q(c).readCalendar(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchCalendar:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Q(c).searchCalendar(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchTimezones:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Q(c).searchTimezones(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateCalendar:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Q(c).updateCalendar(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var B,M=(B=e,D.__extends(H,B),H.prototype.createCalendar=function(e,t){var n=this;return j(this.configuration).createCalendar(e,t).then(function(e){return e(n.axios,n.basePath)})},H.prototype.deleteCalendar=function(e,t,n){var r=this;return j(this.configuration).deleteCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})},H.prototype.readCalendar=function(e,t,n){var r=this;return j(this.configuration).readCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})},H.prototype.searchCalendar=function(e,t,n,r,i,a,s){var o=this;return j(this.configuration).searchCalendar(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},H.prototype.searchTimezones=function(e,t,n,r){var i=this;return j(this.configuration).searchTimezones(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},H.prototype.updateCalendar=function(e,t,n){var r=this;return j(this.configuration).updateCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})},H);function H(){return null!==B&&B.apply(this,arguments)||this}function L(L){var e=this;return{aggregateHistoryCall:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling aggregateHistoryCall.");return t=F.parse("/calls/history/aggregate",!0),L&&(n=L.baseOptions),r=D.__assign(D.__assign({method:"POST"},n),l),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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},blindTransferCall:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling blindTransferCall.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling blindTransferCall.");return t="/calls/active/{id}/transfer".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},confirmPush:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling confirmPush.");return t="/calls/active/{id}/confirm_push".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),l),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},createCall:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createCall.");return t=F.parse("/calls",!0),L&&(n=L.baseOptions),r=D.__assign(D.__assign({method:"POST"},n),l),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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},createCallAnnotation:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("callId","Required parameter callId was null or undefined when calling createCallAnnotation.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling createCallAnnotation.");return t="/calls/history/{call_id}/annotation".replace("{call_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteCallAnnotation:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("callId","Required parameter callId was null or undefined when calling deleteCallAnnotation.");if(null==l)throw new k("id","Required parameter id was null or undefined when calling deleteCallAnnotation.");return t="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},dtmfCall:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling dtmfCall.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling dtmfCall.");return t="/calls/active/{id}/dtmf".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},eavesdropCall:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling eavesdropCall.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling eavesdropCall.");return t="/calls/active/{id}/eavesdrop".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},hangupCall:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling hangupCall.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling hangupCall.");return t="/calls/active/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),_),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},holdCall:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling holdCall.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling holdCall.");return t="/calls/active/{id}/hold".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readCall:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readCall.");return t="/calls/active/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchActiveCall:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,T,k,I,W,X,x,E,Q){return void 0===Q&&(Q={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/calls/active",!0),L&&(n=L.baseOptions),r=D.__assign(D.__assign({method:"GET"},n),Q),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:i["X-Webitel-Access"]=s,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),O&&(a.direction=O),void 0!==T&&(a["answered_at.from"]=T),void 0!==k&&(a["answered_at.to"]=k),void 0!==I&&(a.missed=I),void 0!==W&&(a["stored_at.from"]=W),void 0!==X&&(a["stored_at.to"]=X),x&&(a.supervisor_id=x),E&&(a.state=E),t.query=D.__assign(D.__assign(D.__assign({},t.query),a),Q.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),Q.headers),[2,{url:F.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,O,T,k,I,W,X,x,E,Q,j,U,G,B,M,H){return void 0===H&&(H={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/calls/history",!0),L&&(n=L.baseOptions),r=D.__assign(D.__assign({method:"GET"},n),H),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:i["X-Webitel-Access"]=s,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!==O&&(a.direction=O),void 0!==T&&(a["answered_at.from"]=T),void 0!==k&&(a["answered_at.to"]=k),void 0!==I&&(a.missed=I),void 0!==W&&(a["stored_at.from"]=W),void 0!==X&&(a["stored_at.to"]=X),x&&(a.id=x),E&&(a.transfer_from=E),Q&&(a.transfer_to=Q),j&&(a.dependency_id=j),U&&(a.tags=U),G&&(a.amd_result=G),void 0!==B&&(a.fts=B),M&&(a.directions=M),t.query=D.__assign(D.__assign(D.__assign({},t.query),a),H.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),H.headers),[2,{url:F.format(t),options:r}]}})})},unHoldCall:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling unHoldCall.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling unHoldCall.");return t="/calls/active/{id}/unhold".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},updateCallAnnotation:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("callId","Required parameter callId was null or undefined when calling updateCallAnnotation.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateCallAnnotation.");if(null==_)throw new k("body","Required parameter body was null or undefined when calling updateCallAnnotation.");return t="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),L&&(r=L.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},L&&L.apiKey?"function"!=typeof L.apiKey?[3,2]:[4,L.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,L.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function N(j){return{aggregateHistoryCall:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).aggregateHistoryCall(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},blindTransferCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).blindTransferCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},confirmPush:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).confirmPush(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createCall:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).createCall(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createCallAnnotation:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).createCallAnnotation(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteCallAnnotation:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).deleteCallAnnotation(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},dtmfCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).dtmfCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},eavesdropCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).eavesdropCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},hangupCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).hangupCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},holdCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).holdCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).readCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchActiveCall:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,T,k){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).searchActiveCall(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,T,k)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchHistoryCall:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,T,k,I,W,X,x,E,Q){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).searchHistoryCall(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,T,k,I,W,X,x,E,Q)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},unHoldCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).unHoldCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateCallAnnotation:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,L(j).updateCallAnnotation(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var J,z=(J=e,D.__extends(V,J),V.prototype.aggregateHistoryCall=function(e,t){var n=this;return N(this.configuration).aggregateHistoryCall(e,t).then(function(e){return e(n.axios,n.basePath)})},V.prototype.blindTransferCall=function(e,t,n){var r=this;return N(this.configuration).blindTransferCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.confirmPush=function(e,t){var n=this;return N(this.configuration).confirmPush(e,t).then(function(e){return e(n.axios,n.basePath)})},V.prototype.createCall=function(e,t){var n=this;return N(this.configuration).createCall(e,t).then(function(e){return e(n.axios,n.basePath)})},V.prototype.createCallAnnotation=function(e,t,n){var r=this;return N(this.configuration).createCallAnnotation(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.deleteCallAnnotation=function(e,t,n){var r=this;return N(this.configuration).deleteCallAnnotation(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.dtmfCall=function(e,t,n){var r=this;return N(this.configuration).dtmfCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.eavesdropCall=function(e,t,n){var r=this;return N(this.configuration).eavesdropCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.hangupCall=function(e,t,n){var r=this;return N(this.configuration).hangupCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.holdCall=function(e,t,n){var r=this;return N(this.configuration).holdCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.readCall=function(e,t,n){var r=this;return N(this.configuration).readCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.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,O){var T=this;return N(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,O).then(function(e){return e(T.axios,T.basePath)})},V.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,O,T,k,I,W,X,x){var E=this;return N(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,O,T,k,I,W,X,x).then(function(e){return e(E.axios,E.basePath)})},V.prototype.unHoldCall=function(e,t,n){var r=this;return N(this.configuration).unHoldCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},V.prototype.updateCallAnnotation=function(e,t,n,r){var i=this;return N(this.configuration).updateCallAnnotation(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},V);function V(){return null!==J&&J.apply(this,arguments)||this}function $(v){var e=this;return{createCognitiveProfile:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createCognitiveProfile.");return t=F.parse("/storage/cognitive_profiles",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteCognitiveProfile:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteCognitiveProfile.");return t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),l),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},patchCognitiveProfile:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchCognitiveProfile.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchCognitiveProfile.");return t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readCognitiveProfile:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readCognitiveProfile.");return t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),l),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},searchCognitiveProfile:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/storage/cognitive_profiles",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),g.headers),[2,{url:F.format(t),options:r}]}})})},updateCognitiveProfile:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateCognitiveProfile.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateCognitiveProfile.");return t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function Y(d){return{createCognitiveProfile:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,$(d).createCognitiveProfile(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteCognitiveProfile:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,$(d).deleteCognitiveProfile(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchCognitiveProfile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,$(d).patchCognitiveProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readCognitiveProfile:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,$(d).readCognitiveProfile(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchCognitiveProfile:function(t,n,i,a,s,o,u,c,l){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,$(d).searchCognitiveProfile(t,n,i,a,s,o,u,c,l)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateCognitiveProfile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,$(d).updateCognitiveProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Z,ee=(Z=e,D.__extends(te,Z),te.prototype.createCognitiveProfile=function(e,t){var n=this;return Y(this.configuration).createCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},te.prototype.deleteCognitiveProfile=function(e,t){var n=this;return Y(this.configuration).deleteCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},te.prototype.patchCognitiveProfile=function(e,t,n){var r=this;return Y(this.configuration).patchCognitiveProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},te.prototype.readCognitiveProfile=function(e,t){var n=this;return Y(this.configuration).readCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},te.prototype.searchCognitiveProfile=function(e,t,n,r,i,a,s,o,u){var c=this;return Y(this.configuration).searchCognitiveProfile(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},te.prototype.updateCognitiveProfile=function(e,t,n){var r=this;return Y(this.configuration).updateCognitiveProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},te);function te(){return null!==Z&&Z.apply(this,arguments)||this}function ne(f){var e=this;return{createCommunicationType:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createCommunicationType.");return t=F.parse("/call_center/communication_type",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteCommunicationType:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteCommunicationType.");return t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readCommunicationType:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readCommunicationType.");return t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchCommunicationType:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/communication_type",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},updateCommunicationType:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateCommunicationType.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateCommunicationType.");return t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function re(c){return{createCommunicationType:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ne(c).createCommunicationType(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteCommunicationType:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ne(c).deleteCommunicationType(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readCommunicationType:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ne(c).readCommunicationType(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchCommunicationType:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ne(c).searchCommunicationType(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateCommunicationType:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ne(c).updateCommunicationType(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var ie,ae=(ie=e,D.__extends(se,ie),se.prototype.createCommunicationType=function(e,t){var n=this;return re(this.configuration).createCommunicationType(e,t).then(function(e){return e(n.axios,n.basePath)})},se.prototype.deleteCommunicationType=function(e,t,n){var r=this;return re(this.configuration).deleteCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})},se.prototype.readCommunicationType=function(e,t,n){var r=this;return re(this.configuration).readCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})},se.prototype.searchCommunicationType=function(e,t,n,r,i,a,s){var o=this;return re(this.configuration).searchCommunicationType(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},se.prototype.updateCommunicationType=function(e,t,n){var r=this;return re(this.configuration).updateCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})},se);function se(){return null!==ie&&ie.apply(this,arguments)||this}function oe(p){var e=this;return{createEmailProfile:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createEmailProfile.");return t=F.parse("/email/profile",!0),p&&(n=p.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteEmailProfile:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteEmailProfile.");return t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),p&&(r=p.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),l),a={},s={},p&&p.apiKey?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},patchEmailProfile:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchEmailProfile.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchEmailProfile.");return t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),p&&(r=p.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},p&&p.apiKey?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readEmailProfile:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readEmailProfile.");return t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),p&&(r=p.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),l),a={},s={},p&&p.apiKey?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},searchEmailProfile:function(u,c,l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/email/profile",!0),p&&(n=p.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),h.headers),[2,{url:F.format(t),options:r}]}})})},updateEmailProfile:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateEmailProfile.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateEmailProfile.");return t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),p&&(r=p.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},p&&p.apiKey?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function ue(u){return{createEmailProfile:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,oe(u).createEmailProfile(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteEmailProfile:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,oe(u).deleteEmailProfile(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchEmailProfile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,oe(u).patchEmailProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readEmailProfile:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,oe(u).readEmailProfile(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchEmailProfile:function(t,n,i,a,s,o){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,oe(u).searchEmailProfile(t,n,i,a,s,o)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateEmailProfile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,oe(u).updateEmailProfile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var ce,le=(ce=e,D.__extends(de,ce),de.prototype.createEmailProfile=function(e,t){var n=this;return ue(this.configuration).createEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},de.prototype.deleteEmailProfile=function(e,t){var n=this;return ue(this.configuration).deleteEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},de.prototype.patchEmailProfile=function(e,t,n){var r=this;return ue(this.configuration).patchEmailProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},de.prototype.readEmailProfile=function(e,t){var n=this;return ue(this.configuration).readEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},de.prototype.searchEmailProfile=function(e,t,n,r,i,a){var s=this;return ue(this.configuration).searchEmailProfile(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},de.prototype.updateEmailProfile=function(e,t,n){var r=this;return ue(this.configuration).updateEmailProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},de);function de(){return null!==ce&&ce.apply(this,arguments)||this}function _e(d){var e=this;return{deleteFiles:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling deleteFiles.");return t=F.parse("/storage/file",!0),d&&(n=d.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})}}}function he(i){return{deleteFiles:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,_e(i).deleteFiles(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var pe,fe=(pe=e,D.__extends(ge,pe),ge.prototype.deleteFiles=function(e,t){var n=this;return he(this.configuration).deleteFiles(e,t).then(function(e){return e(n.axios,n.basePath)})},ge);function ge(){return null!==pe&&pe.apply(this,arguments)||this}function ve(h){var e=this;return{createFileTranscript:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createFileTranscript.");return t=F.parse("/storage/transcript_file",!0),h&&(n=h.baseOptions),r=D.__assign(D.__assign({method:"POST"},n),l),i={},a={},h&&h.apiKey?"function"!=typeof h.apiKey?[3,2]:[4,h.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,h.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},getFileTranscriptPhrases:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling getFileTranscriptPhrases.");return t="/storage/transcript_file/{id}/phrases".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),h&&(r=h.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),_),a={},s={},h&&h.apiKey?"function"!=typeof h.apiKey?[3,2]:[4,h.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,h.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})}}}function ye(s){return{createFileTranscript:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ve(s).createFileTranscript(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},getFileTranscriptPhrases:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ve(s).getFileTranscriptPhrases(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var be,we=(be=e,D.__extends(me,be),me.prototype.createFileTranscript=function(e,t){var n=this;return ye(this.configuration).createFileTranscript(e,t).then(function(e){return e(n.axios,n.basePath)})},me.prototype.getFileTranscriptPhrases=function(e,t,n,r){var i=this;return ye(this.configuration).getFileTranscriptPhrases(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},me);function me(){return null!==be&&be.apply(this,arguments)||this}function qe(f){var e=this;return{createImportTemplate:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createImportTemplate.");return t=F.parse("/storage/import_templates",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteImportTemplate:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteImportTemplate.");return t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),l),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},patchImportTemplate:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchImportTemplate.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchImportTemplate.");return t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readImportTemplate:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readImportTemplate.");return t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),l),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},searchImportTemplate:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/storage/import_templates",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},updateImportTemplate:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateImportTemplate.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateImportTemplate.");return t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function Ae(c){return{createImportTemplate:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,qe(c).createImportTemplate(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteImportTemplate:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,qe(c).deleteImportTemplate(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchImportTemplate:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,qe(c).patchImportTemplate(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readImportTemplate:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,qe(c).readImportTemplate(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchImportTemplate:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,qe(c).searchImportTemplate(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateImportTemplate:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,qe(c).updateImportTemplate(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Ce,Re=(Ce=e,D.__extends(Se,Ce),Se.prototype.createImportTemplate=function(e,t){var n=this;return Ae(this.configuration).createImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},Se.prototype.deleteImportTemplate=function(e,t){var n=this;return Ae(this.configuration).deleteImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},Se.prototype.patchImportTemplate=function(e,t,n){var r=this;return Ae(this.configuration).patchImportTemplate(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Se.prototype.readImportTemplate=function(e,t){var n=this;return Ae(this.configuration).readImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},Se.prototype.searchImportTemplate=function(e,t,n,r,i,a,s){var o=this;return Ae(this.configuration).searchImportTemplate(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Se.prototype.updateImportTemplate=function(e,t,n){var r=this;return Ae(this.configuration).updateImportTemplate(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Se);function Se(){return null!==Ce&&Ce.apply(this,arguments)||this}function Ke(v){var e=this;return{createList:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createList.");return t=F.parse("/call_center/list",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},createListCommunication:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("listId","Required parameter listId was null or undefined when calling createListCommunication.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling createListCommunication.");return t="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteList:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteList.");return t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},deleteListCommunication:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("listId","Required parameter listId was null or undefined when calling deleteListCommunication.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},readList:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readList.");return t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readListCommunication:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("listId","Required parameter listId was null or undefined when calling readListCommunication.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},searchList:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/list",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},searchListCommunication:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("listId","Required parameter listId was null or undefined when calling searchListCommunication.");return t="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),g),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),g.headers),[2,{url:F.format(n),options:i}]}})})},updateList:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateList.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateList.");return t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},updateListCommunication:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("listId","Required parameter listId was null or undefined when calling updateListCommunication.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateListCommunication.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function Pe(l){return{createList:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).createList(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createListCommunication:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).createListCommunication(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteList:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).deleteList(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteListCommunication:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).deleteListCommunication(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readList:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).readList(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readListCommunication:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).readListCommunication(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchList:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).searchList(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchListCommunication:function(t,n,i,a,s,o,u,c){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).searchListCommunication(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateList:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).updateList(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateListCommunication:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ke(l).updateListCommunication(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Oe,Te=(Oe=e,D.__extends(ke,Oe),ke.prototype.createList=function(e,t){var n=this;return Pe(this.configuration).createList(e,t).then(function(e){return e(n.axios,n.basePath)})},ke.prototype.createListCommunication=function(e,t,n){var r=this;return Pe(this.configuration).createListCommunication(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ke.prototype.deleteList=function(e,t,n){var r=this;return Pe(this.configuration).deleteList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ke.prototype.deleteListCommunication=function(e,t,n,r){var i=this;return Pe(this.configuration).deleteListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},ke.prototype.readList=function(e,t,n){var r=this;return Pe(this.configuration).readList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ke.prototype.readListCommunication=function(e,t,n,r){var i=this;return Pe(this.configuration).readListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},ke.prototype.searchList=function(e,t,n,r,i,a,s){var o=this;return Pe(this.configuration).searchList(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},ke.prototype.searchListCommunication=function(e,t,n,r,i,a,s,o){var u=this;return Pe(this.configuration).searchListCommunication(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},ke.prototype.updateList=function(e,t,n){var r=this;return Pe(this.configuration).updateList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ke.prototype.updateListCommunication=function(e,t,n,r){var i=this;return Pe(this.configuration).updateListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},ke);function ke(){return null!==Oe&&Oe.apply(this,arguments)||this}function Ie(f){var e=this;return{deleteMediaFile:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteMediaFile.");return t="/storage/media/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readMediaFile:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readMediaFile.");return t="/storage/media/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchMediaFile:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/storage/media",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})}}}function We(c){return{deleteMediaFile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ie(c).deleteMediaFile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readMediaFile:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ie(c).readMediaFile(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchMediaFile:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ie(c).searchMediaFile(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Xe,xe=(Xe=e,D.__extends(Ee,Xe),Ee.prototype.deleteMediaFile=function(e,t,n){var r=this;return We(this.configuration).deleteMediaFile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ee.prototype.readMediaFile=function(e,t,n){var r=this;return We(this.configuration).readMediaFile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ee.prototype.searchMediaFile=function(e,t,n,r,i,a,s){var o=this;return We(this.configuration).searchMediaFile(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Ee);function Ee(){return null!==Xe&&Xe.apply(this,arguments)||this}function Qe(T){var e=this;return{attemptCallback:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("attemptId","Required parameter attemptId was null or undefined when calling attemptCallback.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling attemptCallback.");return t="/call_center/attempts/{attempt_id}".replace("{attempt_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},attemptResult:function(l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling attemptResult.");if(null==d)throw new k("memberId","Required parameter memberId was null or undefined when calling attemptResult.");if(null==_)throw new k("attemptId","Required parameter attemptId was null or undefined when calling attemptResult.");if(null==h)throw new k("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(l))).replace("{member_id}",encodeURIComponent(String(d))).replace("{attempt_id}",encodeURIComponent(String(_))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),p),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),p.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),p.headers),c="string"!=typeof h||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==h?h:{}):h||"",[2,{url:F.format(n),options:i}]}})})},attemptsRenewalResult:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("attemptId","Required parameter attemptId was null or undefined when calling attemptsRenewalResult.");if(null==d)throw new k("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(l))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},createAttempt:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling createAttempt.");if(null==d)throw new k("memberId","Required parameter memberId was null or undefined when calling createAttempt.");if(null==_)throw new k("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(l))).replace("{member_id}",encodeURIComponent(String(d))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),h),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})},createMember:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling createMember.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling createMember.");return t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},createMemberBulk:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling createMemberBulk.");if(null==d)throw new k("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(l))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteMember:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling deleteMember.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),_),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},deleteMembers:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling deleteMembers.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling deleteMembers.");return t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),_),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},patchMember:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling patchMember.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling patchMember.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),h),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})},readMember:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling readMember.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),_),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},resetMembers:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling resetMembers.");if(null==d)throw new k("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(l))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},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={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/queues/attempts/active",!0),T&&(n=T.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),K.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),K.headers),[2,{url:F.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={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/queues/attempts/history",!0),T&&(n=T.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),K.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),K.headers),[2,{url:F.format(t),options:r}]}})})},searchMemberAttempts:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling searchMemberAttempts.");if(null==l)throw new k("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(c))).replace("{member_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),_),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},searchMemberInQueue:function(c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O){return void 0===O&&(O={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling searchMemberInQueue.");return t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(c))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),O),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),g&&(s.bucket_id=g),void 0!==v&&(s.destination=v),void 0!==y&&(s["created_at.from"]=y),void 0!==b&&(s["created_at.to"]=b),void 0!==w&&(s["offering_at.from"]=w),void 0!==m&&(s["offering_at.to"]=m),q&&(s.stop_cause=q),void 0!==A&&(s["priority.from"]=A),void 0!==C&&(s["priority.to"]=C),void 0!==R&&(s.name=R),void 0!==S&&(s["attempts.from"]=S),void 0!==K&&(s["attempts.to"]=K),P&&(s.agent_id=P),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),O.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),O.headers),[2,{url:F.format(n),options:i}]}})})},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={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/members",!0),T&&(n=T.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),P.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),P.headers),[2,{url:F.format(t),options:r}]}})})},updateMember:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling updateMember.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateMember.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),T&&(r=T.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},T&&T.apiKey?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function je(A){return{attemptCallback:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).attemptCallback(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},attemptResult:function(t,n,i,a,s){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).attemptResult(t,n,i,a,s)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},attemptsRenewalResult:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).attemptsRenewalResult(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createAttempt:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).createAttempt(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createMember:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).createMember(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createMemberBulk:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).createMemberBulk(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteMember:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).deleteMember(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteMembers:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).deleteMembers(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchMember:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).patchMember(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readMember:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).readMember(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},resetMembers:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).resetMembers(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAttempts:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).searchAttempts(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchAttemptsHistory:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).searchAttemptsHistory(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchMemberAttempts:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).searchMemberAttempts(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchMemberInQueue:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).searchMemberInQueue(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchMembers:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).searchMembers(t,n,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateMember:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Qe(A).updateMember(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Ue,Ge=(Ue=e,D.__extends(Be,Ue),Be.prototype.attemptCallback=function(e,t,n){var r=this;return je(this.configuration).attemptCallback(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Be.prototype.attemptResult=function(e,t,n,r,i){var a=this;return je(this.configuration).attemptResult(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},Be.prototype.attemptsRenewalResult=function(e,t,n){var r=this;return je(this.configuration).attemptsRenewalResult(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Be.prototype.createAttempt=function(e,t,n,r){var i=this;return je(this.configuration).createAttempt(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Be.prototype.createMember=function(e,t,n){var r=this;return je(this.configuration).createMember(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Be.prototype.createMemberBulk=function(e,t,n){var r=this;return je(this.configuration).createMemberBulk(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Be.prototype.deleteMember=function(e,t,n,r){var i=this;return je(this.configuration).deleteMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Be.prototype.deleteMembers=function(e,t,n){var r=this;return je(this.configuration).deleteMembers(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Be.prototype.patchMember=function(e,t,n,r){var i=this;return je(this.configuration).patchMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Be.prototype.readMember=function(e,t,n,r){var i=this;return je(this.configuration).readMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Be.prototype.resetMembers=function(e,t,n){var r=this;return je(this.configuration).resetMembers(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Be.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 je(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)})},Be.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 je(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)})},Be.prototype.searchMemberAttempts=function(e,t,n,r){var i=this;return je(this.configuration).searchMemberAttempts(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Be.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 je(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)})},Be.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 je(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)})},Be.prototype.updateMember=function(e,t,n,r){var i=this;return je(this.configuration).updateMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Be);function Be(){return null!==Ue&&Ue.apply(this,arguments)||this}function Me(v){var e=this;return{createOutboundResourceGroup:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createOutboundResourceGroup.");return t=F.parse("/call_center/resource_group",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},createOutboundResourceInGroup:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("groupId","Required parameter groupId was null or undefined when calling createOutboundResourceInGroup.");if(null==d)throw new k("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(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteOutboundResourceGroup:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteOutboundResourceGroup.");return t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},deleteOutboundResourceInGroup:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("groupId","Required parameter groupId was null or undefined when calling deleteOutboundResourceInGroup.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},readOutboundResourceGroup:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readOutboundResourceGroup.");return t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readOutboundResourceInGroup:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("groupId","Required parameter groupId was null or undefined when calling readOutboundResourceInGroup.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},searchOutboundResourceGroup:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/resource_group",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},searchOutboundResourceInGroup:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("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(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),g),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),g.headers),[2,{url:F.format(n),options:i}]}})})},updateOutboundResourceGroup:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateOutboundResourceGroup.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateOutboundResourceGroup.");return t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},updateOutboundResourceInGroup:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("groupId","Required parameter groupId was null or undefined when calling updateOutboundResourceInGroup.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateOutboundResourceInGroup.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function He(l){return{createOutboundResourceGroup:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).createOutboundResourceGroup(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createOutboundResourceInGroup:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).createOutboundResourceInGroup(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteOutboundResourceGroup:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).deleteOutboundResourceGroup(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteOutboundResourceInGroup:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).deleteOutboundResourceInGroup(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readOutboundResourceGroup:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).readOutboundResourceGroup(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readOutboundResourceInGroup:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).readOutboundResourceInGroup(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchOutboundResourceGroup:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).searchOutboundResourceGroup(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchOutboundResourceInGroup:function(t,n,i,a,s,o,u,c){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).searchOutboundResourceInGroup(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateOutboundResourceGroup:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).updateOutboundResourceGroup(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateOutboundResourceInGroup:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Me(l).updateOutboundResourceInGroup(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Le,De=(Le=e,D.__extends(Fe,Le),Fe.prototype.createOutboundResourceGroup=function(e,t){var n=this;return He(this.configuration).createOutboundResourceGroup(e,t).then(function(e){return e(n.axios,n.basePath)})},Fe.prototype.createOutboundResourceInGroup=function(e,t,n){var r=this;return He(this.configuration).createOutboundResourceInGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Fe.prototype.deleteOutboundResourceGroup=function(e,t,n){var r=this;return He(this.configuration).deleteOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Fe.prototype.deleteOutboundResourceInGroup=function(e,t,n,r){var i=this;return He(this.configuration).deleteOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Fe.prototype.readOutboundResourceGroup=function(e,t,n){var r=this;return He(this.configuration).readOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Fe.prototype.readOutboundResourceInGroup=function(e,t,n,r){var i=this;return He(this.configuration).readOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Fe.prototype.searchOutboundResourceGroup=function(e,t,n,r,i,a,s){var o=this;return He(this.configuration).searchOutboundResourceGroup(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Fe.prototype.searchOutboundResourceInGroup=function(e,t,n,r,i,a,s,o){var u=this;return He(this.configuration).searchOutboundResourceInGroup(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},Fe.prototype.updateOutboundResourceGroup=function(e,t,n){var r=this;return He(this.configuration).updateOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Fe.prototype.updateOutboundResourceInGroup=function(e,t,n,r){var i=this;return He(this.configuration).updateOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Fe);function Fe(){return null!==Le&&Le.apply(this,arguments)||this}function Ne(v){var e=this;return{createOutboundResource:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createOutboundResource.");return t=F.parse("/call_center/resources",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},createOutboundResourceDisplay:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("resourceId","Required parameter resourceId was null or undefined when calling createOutboundResourceDisplay.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling createOutboundResourceDisplay.");return t="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteOutboundResource:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteOutboundResource.");return t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},deleteOutboundResourceDisplay:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("resourceId","Required parameter resourceId was null or undefined when calling deleteOutboundResourceDisplay.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},patchOutboundResource:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchOutboundResource.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchOutboundResource.");return t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readOutboundResource:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readOutboundResource.");return t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readOutboundResourceDisplay:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("resourceId","Required parameter resourceId was null or undefined when calling readOutboundResourceDisplay.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},searchOutboundResource:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/resources",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},searchOutboundResourceDisplay:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("resourceId","Required parameter resourceId was null or undefined when calling searchOutboundResourceDisplay.");return t="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),g),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),g.headers),[2,{url:F.format(n),options:i}]}})})},updateOutboundResource:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateOutboundResource.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateOutboundResource.");return t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},updateOutboundResourceDisplay:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("resourceId","Required parameter resourceId was null or undefined when calling updateOutboundResourceDisplay.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateOutboundResourceDisplay.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function Je(l){return{createOutboundResource:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).createOutboundResource(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},createOutboundResourceDisplay:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).createOutboundResourceDisplay(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteOutboundResource:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).deleteOutboundResource(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteOutboundResourceDisplay:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).deleteOutboundResourceDisplay(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchOutboundResource:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).patchOutboundResource(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readOutboundResource:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).readOutboundResource(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readOutboundResourceDisplay:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).readOutboundResourceDisplay(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchOutboundResource:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).searchOutboundResource(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchOutboundResourceDisplay:function(t,n,i,a,s,o,u,c){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).searchOutboundResourceDisplay(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateOutboundResource:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).updateOutboundResource(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateOutboundResourceDisplay:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(l).updateOutboundResourceDisplay(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var ze,Ve=(ze=e,D.__extends($e,ze),$e.prototype.createOutboundResource=function(e,t){var n=this;return Je(this.configuration).createOutboundResource(e,t).then(function(e){return e(n.axios,n.basePath)})},$e.prototype.createOutboundResourceDisplay=function(e,t,n){var r=this;return Je(this.configuration).createOutboundResourceDisplay(e,t,n).then(function(e){return e(r.axios,r.basePath)})},$e.prototype.deleteOutboundResource=function(e,t,n){var r=this;return Je(this.configuration).deleteOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},$e.prototype.deleteOutboundResourceDisplay=function(e,t,n,r){var i=this;return Je(this.configuration).deleteOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},$e.prototype.patchOutboundResource=function(e,t,n){var r=this;return Je(this.configuration).patchOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},$e.prototype.readOutboundResource=function(e,t,n){var r=this;return Je(this.configuration).readOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},$e.prototype.readOutboundResourceDisplay=function(e,t,n,r){var i=this;return Je(this.configuration).readOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},$e.prototype.searchOutboundResource=function(e,t,n,r,i,a,s){var o=this;return Je(this.configuration).searchOutboundResource(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},$e.prototype.searchOutboundResourceDisplay=function(e,t,n,r,i,a,s,o){var u=this;return Je(this.configuration).searchOutboundResourceDisplay(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},$e.prototype.updateOutboundResource=function(e,t,n){var r=this;return Je(this.configuration).updateOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},$e.prototype.updateOutboundResourceDisplay=function(e,t,n,r){var i=this;return Je(this.configuration).updateOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},$e);function $e(){return null!==ze&&ze.apply(this,arguments)||this}function Ye(v){var e=this;return{createQueueBucket:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling createQueueBucket.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling createQueueBucket.");return t="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteQueueBucket:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling deleteQueueBucket.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},patchQueueBucket:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling patchQueueBucket.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling patchQueueBucket.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})},readQueueBucket:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling readQueueBucket.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchQueueBucket:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling searchQueueBucket.");return t="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),g),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),g.headers),[2,{url:F.format(n),options:i}]}})})},updateQueueBucket:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling updateQueueBucket.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateQueueBucket.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function Ze(l){return{createQueueBucket:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ye(l).createQueueBucket(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteQueueBucket:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ye(l).deleteQueueBucket(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchQueueBucket:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ye(l).patchQueueBucket(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readQueueBucket:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ye(l).readQueueBucket(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchQueueBucket:function(t,n,i,a,s,o,u,c){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ye(l).searchQueueBucket(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateQueueBucket:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ye(l).updateQueueBucket(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var et,tt=(et=e,D.__extends(nt,et),nt.prototype.createQueueBucket=function(e,t,n){var r=this;return Ze(this.configuration).createQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},nt.prototype.deleteQueueBucket=function(e,t,n){var r=this;return Ze(this.configuration).deleteQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},nt.prototype.patchQueueBucket=function(e,t,n,r){var i=this;return Ze(this.configuration).patchQueueBucket(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},nt.prototype.readQueueBucket=function(e,t,n){var r=this;return Ze(this.configuration).readQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},nt.prototype.searchQueueBucket=function(e,t,n,r,i,a,s,o){var u=this;return Ze(this.configuration).searchQueueBucket(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},nt.prototype.updateQueueBucket=function(e,t,n,r){var i=this;return Ze(this.configuration).updateQueueBucket(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},nt);function nt(){return null!==et&&et.apply(this,arguments)||this}function rt(b){var e=this;return{createQueueHook:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling createQueueHook.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling createQueueHook.");return t="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteQueueHook:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling deleteQueueHook.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},patchQueueHook:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling patchQueueHook.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling patchQueueHook.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),h),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})},readQueueHook:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling readQueueHook.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchQueueHook:function(c,l,d,_,h,p,f,g,v,y){return void 0===y&&(y={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling searchQueueHook.");return t="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(c))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),y),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),g&&(s.schema_id=g),v&&(s.event=v),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),y.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),y.headers),[2,{url:F.format(n),options:i}]}})})},updateQueueHook:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling updateQueueHook.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateQueueHook.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function it(_){return{createQueueHook:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,rt(_).createQueueHook(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteQueueHook:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,rt(_).deleteQueueHook(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchQueueHook:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,rt(_).patchQueueHook(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readQueueHook:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,rt(_).readQueueHook(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchQueueHook:function(t,n,i,a,s,o,u,c,l,d){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,rt(_).searchQueueHook(t,n,i,a,s,o,u,c,l,d)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateQueueHook:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,rt(_).updateQueueHook(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var at,st=(at=e,D.__extends(ot,at),ot.prototype.createQueueHook=function(e,t,n){var r=this;return it(this.configuration).createQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ot.prototype.deleteQueueHook=function(e,t,n){var r=this;return it(this.configuration).deleteQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ot.prototype.patchQueueHook=function(e,t,n,r){var i=this;return it(this.configuration).patchQueueHook(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},ot.prototype.readQueueHook=function(e,t,n){var r=this;return it(this.configuration).readQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ot.prototype.searchQueueHook=function(e,t,n,r,i,a,s,o,u,c){var l=this;return it(this.configuration).searchQueueHook(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},ot.prototype.updateQueueHook=function(e,t,n,r){var i=this;return it(this.configuration).updateQueueHook(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},ot);function ot(){return null!==at&&at.apply(this,arguments)||this}function ut(v){var e=this;return{createQueueResourceGroup:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling createQueueResourceGroup.");if(null==d)throw new k("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(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteQueueResourceGroup:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling deleteQueueResourceGroup.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},readQueueResourceGroup:function(c,l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling readQueueResourceGroup.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==d&&(s.domain_id=d),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),[2,{url:F.format(n),options:i}]}})})},searchQueueResourceGroup:function(c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("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(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),g),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),g.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),g.headers),[2,{url:F.format(n),options:i}]}})})},updateQueueResourceGroup:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling updateQueueResourceGroup.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateQueueResourceGroup.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function ct(l){return{createQueueResourceGroup:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ut(l).createQueueResourceGroup(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteQueueResourceGroup:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ut(l).deleteQueueResourceGroup(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readQueueResourceGroup:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ut(l).readQueueResourceGroup(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchQueueResourceGroup:function(t,n,i,a,s,o,u,c){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ut(l).searchQueueResourceGroup(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateQueueResourceGroup:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ut(l).updateQueueResourceGroup(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var lt,dt=(lt=e,D.__extends(_t,lt),_t.prototype.createQueueResourceGroup=function(e,t,n){var r=this;return ct(this.configuration).createQueueResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},_t.prototype.deleteQueueResourceGroup=function(e,t,n,r){var i=this;return ct(this.configuration).deleteQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},_t.prototype.readQueueResourceGroup=function(e,t,n,r){var i=this;return ct(this.configuration).readQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},_t.prototype.searchQueueResourceGroup=function(e,t,n,r,i,a,s,o){var u=this;return ct(this.configuration).searchQueueResourceGroup(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},_t.prototype.updateQueueResourceGroup=function(e,t,n,r){var i=this;return ct(this.configuration).updateQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},_t);function _t(){return null!==lt&&lt.apply(this,arguments)||this}function ht(w){var e=this;return{createQueue:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createQueue.");return t=F.parse("/call_center/queues",!0),w&&(n=w.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteQueue:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteQueue.");return t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),w&&(r=w.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},w&&w.apiKey?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},patchQueue:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchQueue.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchQueue.");return t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),w&&(r=w.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},w&&w.apiKey?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readQueue:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readQueue.");return t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),w&&(r=w.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},w&&w.apiKey?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchQueue:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/queues",!0),w&&(n=w.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),f.headers),[2,{url:F.format(t),options:r}]}})})},searchQueueReportGeneral:function(u,c,l,d,_,h,p,f,g,v,y,b){return void 0===b&&(b={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/queues/reports/general",!0),w&&(n=w.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),b.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),b.headers),[2,{url:F.format(t),options:r}]}})})},updateQueue:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateQueue.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateQueue.");return t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),w&&(r=w.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},w&&w.apiKey?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function pt(p){return{createQueue:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ht(p).createQueue(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteQueue:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ht(p).deleteQueue(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchQueue:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ht(p).patchQueue(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readQueue:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ht(p).readQueue(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchQueue:function(t,n,i,a,s,o,u,c){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ht(p).searchQueue(t,n,i,a,s,o,u,c)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchQueueReportGeneral:function(t,n,i,a,s,o,u,c,l,d,_,h){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ht(p).searchQueueReportGeneral(t,n,i,a,s,o,u,c,l,d,_,h)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateQueue:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,ht(p).updateQueue(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var ft,gt=(ft=e,D.__extends(vt,ft),vt.prototype.createQueue=function(e,t){var n=this;return pt(this.configuration).createQueue(e,t).then(function(e){return e(n.axios,n.basePath)})},vt.prototype.deleteQueue=function(e,t,n){var r=this;return pt(this.configuration).deleteQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},vt.prototype.patchQueue=function(e,t,n){var r=this;return pt(this.configuration).patchQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},vt.prototype.readQueue=function(e,t,n){var r=this;return pt(this.configuration).readQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},vt.prototype.searchQueue=function(e,t,n,r,i,a,s,o){var u=this;return pt(this.configuration).searchQueue(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},vt.prototype.searchQueueReportGeneral=function(e,t,n,r,i,a,s,o,u,c,l,d){var _=this;return pt(this.configuration).searchQueueReportGeneral(e,t,n,r,i,a,s,o,u,c,l,d).then(function(e){return e(_.axios,_.basePath)})},vt.prototype.updateQueue=function(e,t,n){var r=this;return pt(this.configuration).updateQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},vt);function vt(){return null!==ft&&ft.apply(this,arguments)||this}function yt(A){var e=this;return{createQueueSkill:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling createQueueSkill.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling createQueueSkill.");return t="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(l))),n=F.parse(t,!0),A&&(r=A.baseOptions),i=D.__assign(D.__assign({method:"POST"},r),_),a={},s={},A&&A.apiKey?"function"!=typeof A.apiKey?[3,2]:[4,A.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,A.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},deleteQueueSkill:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling deleteQueueSkill.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),A&&(r=A.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},A&&A.apiKey?"function"!=typeof A.apiKey?[3,2]:[4,A.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,A.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},patchQueueSkill:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling patchQueueSkill.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling patchQueueSkill.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),A&&(r=A.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),h),a={},s={},A&&A.apiKey?"function"!=typeof A.apiKey?[3,2]:[4,A.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,A.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})},readQueueSkill:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling readQueueSkill.");if(null==l)throw new k("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(c))).replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),A&&(r=A.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},A&&A.apiKey?"function"!=typeof A.apiKey?[3,2]:[4,A.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,A.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchQueueSkill:function(c,l,d,_,h,p,f,g,v,y,b,w,m,q){return void 0===q&&(q={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("queueId","Required parameter queueId was null or undefined when calling searchQueueSkill.");return t="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(c))),n=F.parse(t,!0),A&&(r=A.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),q),a={},s={},A&&A.apiKey?"function"!=typeof A.apiKey?[3,2]:[4,A.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,A.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.page=l),void 0!==d&&(s.size=d),void 0!==_&&(s.q=_),void 0!==h&&(s.sort=h),p&&(s.fields=p),f&&(s.id=f),g&&(s.skill_id=g),v&&(s.bucket_id=v),y&&(s.lvl=y),b&&(s.min_capacity=b),w&&(s.max_capacity=w),void 0!==m&&(s.enabled=m),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),q.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),q.headers),[2,{url:F.format(n),options:i}]}})})},updateQueueSkill:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("queueId","Required parameter queueId was null or undefined when calling updateQueueSkill.");if(null==d)throw new k("id","Required parameter id was null or undefined when calling updateQueueSkill.");if(null==_)throw new k("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(l))).replace("{id}",encodeURIComponent(String(d))),n=F.parse(t,!0),A&&(r=A.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),h),a={},s={},A&&A.apiKey?"function"!=typeof A.apiKey?[3,2]:[4,A.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,A.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})}}}function bt(g){return{createQueueSkill:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,yt(g).createQueueSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteQueueSkill:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,yt(g).deleteQueueSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchQueueSkill:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,yt(g).patchQueueSkill(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readQueueSkill:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,yt(g).readQueueSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchQueueSkill:function(t,n,i,a,s,o,u,c,l,d,_,h,p,f){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,yt(g).searchQueueSkill(t,n,i,a,s,o,u,c,l,d,_,h,p,f)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateQueueSkill:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,yt(g).updateQueueSkill(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var wt,mt=(wt=e,D.__extends(qt,wt),qt.prototype.createQueueSkill=function(e,t,n){var r=this;return bt(this.configuration).createQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},qt.prototype.deleteQueueSkill=function(e,t,n){var r=this;return bt(this.configuration).deleteQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},qt.prototype.patchQueueSkill=function(e,t,n,r){var i=this;return bt(this.configuration).patchQueueSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},qt.prototype.readQueueSkill=function(e,t,n){var r=this;return bt(this.configuration).readQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},qt.prototype.searchQueueSkill=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){var p=this;return bt(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)})},qt.prototype.updateQueueSkill=function(e,t,n,r){var i=this;return bt(this.configuration).updateQueueSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},qt);function qt(){return null!==wt&&wt.apply(this,arguments)||this}function At(y){var e=this;return{createRegion:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createRegion.");return t=F.parse("/regions",!0),y&&(n=y.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteRegion:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteRegion.");return t="/regions/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),y&&(r=y.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),l),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},patchRegion:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchRegion.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchRegion.");return t="/regions/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),y&&(r=y.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readRegion:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readRegion.");return t="/regions/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),y&&(r=y.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),l),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},searchRegion:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/regions",!0),y&&(n=y.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),v.headers),[2,{url:F.format(t),options:r}]}})})},updateRegion:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateRegion.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateRegion.");return t="/regions/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),y&&(r=y.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function Ct(_){return{createRegion:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,At(_).createRegion(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteRegion:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,At(_).deleteRegion(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchRegion:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,At(_).patchRegion(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readRegion:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,At(_).readRegion(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchRegion:function(t,n,i,a,s,o,u,c,l,d){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,At(_).searchRegion(t,n,i,a,s,o,u,c,l,d)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateRegion:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,At(_).updateRegion(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Rt,St=(Rt=e,D.__extends(Kt,Rt),Kt.prototype.createRegion=function(e,t){var n=this;return Ct(this.configuration).createRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},Kt.prototype.deleteRegion=function(e,t){var n=this;return Ct(this.configuration).deleteRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},Kt.prototype.patchRegion=function(e,t,n){var r=this;return Ct(this.configuration).patchRegion(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Kt.prototype.readRegion=function(e,t){var n=this;return Ct(this.configuration).readRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},Kt.prototype.searchRegion=function(e,t,n,r,i,a,s,o,u,c){var l=this;return Ct(this.configuration).searchRegion(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},Kt.prototype.updateRegion=function(e,t,n){var r=this;return Ct(this.configuration).updateRegion(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Kt);function Kt(){return null!==Rt&&Rt.apply(this,arguments)||this}function Pt(v){var e=this;return{createChatPlan:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createChatPlan.");return t=F.parse("/routing/outbound/chat",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteChatPlan:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteChatPlan.");return t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),l),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},patchChatPlan:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchChatPlan.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchChatPlan.");return t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readChatPlan:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readChatPlan.");return t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),l),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})},searchChatPlan:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/routing/outbound/chat",!0),v&&(n=v.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),g.headers),[2,{url:F.format(t),options:r}]}})})},updateChatPlan:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateChatPlan.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateChatPlan.");return t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),v&&(r=v.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},v&&v.apiKey?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function Ot(d){return{createChatPlan:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Pt(d).createChatPlan(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteChatPlan:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Pt(d).deleteChatPlan(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchChatPlan:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Pt(d).patchChatPlan(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readChatPlan:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Pt(d).readChatPlan(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchChatPlan:function(t,n,i,a,s,o,u,c,l){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Pt(d).searchChatPlan(t,n,i,a,s,o,u,c,l)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateChatPlan:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Pt(d).updateChatPlan(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Tt,kt=(Tt=e,D.__extends(It,Tt),It.prototype.createChatPlan=function(e,t){var n=this;return Ot(this.configuration).createChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},It.prototype.deleteChatPlan=function(e,t){var n=this;return Ot(this.configuration).deleteChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},It.prototype.patchChatPlan=function(e,t,n){var r=this;return Ot(this.configuration).patchChatPlan(e,t,n).then(function(e){return e(r.axios,r.basePath)})},It.prototype.readChatPlan=function(e,t){var n=this;return Ot(this.configuration).readChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},It.prototype.searchChatPlan=function(e,t,n,r,i,a,s,o,u){var c=this;return Ot(this.configuration).searchChatPlan(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},It.prototype.updateChatPlan=function(e,t,n){var r=this;return Ot(this.configuration).updateChatPlan(e,t,n).then(function(e){return e(r.axios,r.basePath)})},It);function It(){return null!==Tt&&Tt.apply(this,arguments)||this}function Wt(b){var e=this;return{createRoutingOutboundCall:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createRoutingOutboundCall.");return t=F.parse("/routing/outbound/calls",!0),b&&(n=b.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteRoutingOutboundCall:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteRoutingOutboundCall.");return t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},movePositionRoutingOutboundCall:function(l,d,_,h){return void 0===h&&(h={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("fromId","Required parameter fromId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==d)throw new k("toId","Required parameter toId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==_)throw new k("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(l))).replace("{to_id}",encodeURIComponent(String(d))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),h),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),h.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),h.headers),c="string"!=typeof _||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:F.format(n),options:i}]}})})},patchRoutingOutboundCall:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchRoutingOutboundCall.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchRoutingOutboundCall.");return t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readRoutingOutboundCall:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readRoutingOutboundCall.");return t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchRoutingOutboundCall:function(u,c,l,d,_,h,p,f,g,v,y){return void 0===y&&(y={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/routing/outbound/calls",!0),b&&(n=b.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),y.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),y.headers),[2,{url:F.format(t),options:r}]}})})},updateRoutingOutboundCall:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateRoutingOutboundCall.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateRoutingOutboundCall.");return t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),b&&(r=b.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},b&&b.apiKey?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function Xt(h){return{createRoutingOutboundCall:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(h).createRoutingOutboundCall(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteRoutingOutboundCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(h).deleteRoutingOutboundCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},movePositionRoutingOutboundCall:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(h).movePositionRoutingOutboundCall(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchRoutingOutboundCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(h).patchRoutingOutboundCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readRoutingOutboundCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(h).readRoutingOutboundCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchRoutingOutboundCall:function(t,n,i,a,s,o,u,c,l,d,_){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(h).searchRoutingOutboundCall(t,n,i,a,s,o,u,c,l,d,_)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateRoutingOutboundCall:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(h).updateRoutingOutboundCall(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var xt,Et=(xt=e,D.__extends(Qt,xt),Qt.prototype.createRoutingOutboundCall=function(e,t){var n=this;return Xt(this.configuration).createRoutingOutboundCall(e,t).then(function(e){return e(n.axios,n.basePath)})},Qt.prototype.deleteRoutingOutboundCall=function(e,t,n){var r=this;return Xt(this.configuration).deleteRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Qt.prototype.movePositionRoutingOutboundCall=function(e,t,n,r){var i=this;return Xt(this.configuration).movePositionRoutingOutboundCall(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Qt.prototype.patchRoutingOutboundCall=function(e,t,n){var r=this;return Xt(this.configuration).patchRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Qt.prototype.readRoutingOutboundCall=function(e,t,n){var r=this;return Xt(this.configuration).readRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Qt.prototype.searchRoutingOutboundCall=function(e,t,n,r,i,a,s,o,u,c,l){var d=this;return Xt(this.configuration).searchRoutingOutboundCall(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(d.axios,d.basePath)})},Qt.prototype.updateRoutingOutboundCall=function(e,t,n){var r=this;return Xt(this.configuration).updateRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Qt);function Qt(){return null!==xt&&xt.apply(this,arguments)||this}function jt(y){var e=this;return{createRoutingSchema:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createRoutingSchema.");return t=F.parse("/routing/schema",!0),y&&(n=y.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteRoutingSchema:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteRoutingSchema.");return t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),y&&(r=y.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},patchRoutingSchema:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling patchRoutingSchema.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling patchRoutingSchema.");return t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),y&&(r=y.baseOptions),i=D.__assign(D.__assign({method:"PATCH"},r),_),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})},readRoutingSchema:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readRoutingSchema.");return t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),y&&(r=y.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchRoutingSchema:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/routing/schema",!0),y&&(n=y.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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),t.query=D.__assign(D.__assign(D.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),v.headers),[2,{url:F.format(t),options:r}]}})})},updateRoutingSchema:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateRoutingSchema.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateRoutingSchema.");return t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),y&&(r=y.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},y&&y.apiKey?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function Ut(_){return{createRoutingSchema:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,jt(_).createRoutingSchema(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteRoutingSchema:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,jt(_).deleteRoutingSchema(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},patchRoutingSchema:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,jt(_).patchRoutingSchema(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readRoutingSchema:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,jt(_).readRoutingSchema(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchRoutingSchema:function(t,n,i,a,s,o,u,c,l,d){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,jt(_).searchRoutingSchema(t,n,i,a,s,o,u,c,l,d)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateRoutingSchema:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,jt(_).updateRoutingSchema(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Gt,Bt=(Gt=e,D.__extends(Mt,Gt),Mt.prototype.createRoutingSchema=function(e,t){var n=this;return Ut(this.configuration).createRoutingSchema(e,t).then(function(e){return e(n.axios,n.basePath)})},Mt.prototype.deleteRoutingSchema=function(e,t,n){var r=this;return Ut(this.configuration).deleteRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Mt.prototype.patchRoutingSchema=function(e,t,n){var r=this;return Ut(this.configuration).patchRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Mt.prototype.readRoutingSchema=function(e,t,n){var r=this;return Ut(this.configuration).readRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Mt.prototype.searchRoutingSchema=function(e,t,n,r,i,a,s,o,u,c){var l=this;return Ut(this.configuration).searchRoutingSchema(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},Mt.prototype.updateRoutingSchema=function(e,t,n){var r=this;return Ut(this.configuration).updateRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Mt);function Mt(){return null!==Gt&&Gt.apply(this,arguments)||this}function Ht(h){var e=this;return{createRoutingVariable:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createRoutingVariable.");return t=F.parse("/routing/variables",!0),h&&(n=h.baseOptions),r=D.__assign(D.__assign({method:"POST"},n),l),i={},a={},h&&h.apiKey?"function"!=typeof h.apiKey?[3,2]:[4,h.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,h.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteRoutingVariable:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteRoutingVariable.");return t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),h&&(r=h.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},h&&h.apiKey?"function"!=typeof h.apiKey?[3,2]:[4,h.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,h.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readRoutingVariable:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readRoutingVariable.");return t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),h&&(r=h.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},h&&h.apiKey?"function"!=typeof h.apiKey?[3,2]:[4,h.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,h.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchRoutingVariable:function(u,c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/routing/variables",!0),h&&(n=h.baseOptions),r=D.__assign(D.__assign({method:"GET"},n),d),i={},a={},h&&h.apiKey?"function"!=typeof h.apiKey?[3,2]:[4,h.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,h.apiKey];case 3:s=e.sent(),e.label=4;case 4:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),d.headers),[2,{url:F.format(t),options:r}]}})})},updateRoutingVariable:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateRoutingVariable.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateRoutingVariable.");return t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),h&&(r=h.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},h&&h.apiKey?"function"!=typeof h.apiKey?[3,2]:[4,h.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,h.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function Lt(s){return{createRoutingVariable:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ht(s).createRoutingVariable(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteRoutingVariable:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ht(s).deleteRoutingVariable(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readRoutingVariable:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ht(s).readRoutingVariable(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchRoutingVariable:function(t,n,i,a){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ht(s).searchRoutingVariable(t,n,i,a)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateRoutingVariable:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Ht(s).updateRoutingVariable(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Dt,Ft=(Dt=e,D.__extends(Nt,Dt),Nt.prototype.createRoutingVariable=function(e,t){var n=this;return Lt(this.configuration).createRoutingVariable(e,t).then(function(e){return e(n.axios,n.basePath)})},Nt.prototype.deleteRoutingVariable=function(e,t,n){var r=this;return Lt(this.configuration).deleteRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Nt.prototype.readRoutingVariable=function(e,t,n){var r=this;return Lt(this.configuration).readRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Nt.prototype.searchRoutingVariable=function(e,t,n,r){var i=this;return Lt(this.configuration).searchRoutingVariable(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Nt.prototype.updateRoutingVariable=function(e,t,n){var r=this;return Lt(this.configuration).updateRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Nt);function Nt(){return null!==Dt&&Dt.apply(this,arguments)||this}function Jt(f){var e=this;return{createSkill:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("body","Required parameter body was null or undefined when calling createSkill.");return t=F.parse("/call_center/skills",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=D.__assign(D.__assign(D.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__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:F.format(t),options:r}]}})})},deleteSkill:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling deleteSkill.");return t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"DELETE"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},readSkill:function(c,l,d){return void 0===d&&(d={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("id","Required parameter id was null or undefined when calling readSkill.");return t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(c))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),d),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(s.domain_id=l),n.query=D.__assign(D.__assign(D.__assign({},n.query),s),d.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),d.headers),[2,{url:F.format(n),options:i}]}})})},searchSkill:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return D.__generator(this,function(e){switch(e.label){case 0:return t=F.parse("/call_center/skills",!0),f&&(n=f.baseOptions),r=D.__assign(D.__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:i["X-Webitel-Access"]=s,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=D.__assign(D.__assign(D.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=D.__assign(D.__assign(D.__assign({},i),o),p.headers),[2,{url:F.format(t),options:r}]}})})},updateSkill:function(l,d,_){return void 0===_&&(_={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return D.__generator(this,function(e){switch(e.label){case 0:if(null==l)throw new k("id","Required parameter id was null or undefined when calling updateSkill.");if(null==d)throw new k("body","Required parameter body was null or undefined when calling updateSkill.");return t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(l))),n=F.parse(t,!0),f&&(r=f.baseOptions),i=D.__assign(D.__assign({method:"PUT"},r),_),a={},s={},f&&f.apiKey?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return a["Content-Type"]="application/json",n.query=D.__assign(D.__assign(D.__assign({},n.query),s),_.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),_.headers),c="string"!=typeof d||"application/json"===i.headers["Content-Type"],i.data=c?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:F.format(n),options:i}]}})})}}}function zt(c){return{createSkill:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(c).createSkill(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},deleteSkill:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(c).deleteSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},readSkill:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(c).readSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},searchSkill:function(t,n,i,a,s,o,u){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(c).searchSkill(t,n,i,a,s,o,u)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})},updateSkill:function(t,n,i){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(c).updateSkill(t,n,i)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var Vt,$t=(Vt=e,D.__extends(Yt,Vt),Yt.prototype.createSkill=function(e,t){var n=this;return zt(this.configuration).createSkill(e,t).then(function(e){return e(n.axios,n.basePath)})},Yt.prototype.deleteSkill=function(e,t,n){var r=this;return zt(this.configuration).deleteSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Yt.prototype.readSkill=function(e,t,n){var r=this;return zt(this.configuration).readSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Yt.prototype.searchSkill=function(e,t,n,r,i,a,s){var o=this;return zt(this.configuration).searchSkill(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Yt.prototype.updateSkill=function(e,t,n){var r=this;return zt(this.configuration).updateSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Yt);function Yt(){return null!==Vt&&Vt.apply(this,arguments)||this}function Zt(d){var e=this;return{defaultDeviceConfig:function(c,l){return void 0===l&&(l={}),D.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return D.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new k("type","Required parameter type was null or undefined when calling defaultDeviceConfig.");return t="/user/device/config/{type}".replace("{type}",encodeURIComponent(String(c))),n=F.parse(t,!0),d&&(r=d.baseOptions),i=D.__assign(D.__assign({method:"GET"},r),l),a={},s={},d&&d.apiKey?"function"!=typeof d.apiKey?[3,2]:[4,d.apiKey("X-Webitel-Access")]:[3,5];case 1:return o=e.sent(),[3,4];case 2:return[4,d.apiKey];case 3:o=e.sent(),e.label=4;case 4:a["X-Webitel-Access"]=o,e.label=5;case 5:return n.query=D.__assign(D.__assign(D.__assign({},n.query),s),l.query),delete n.search,u=r&&r.headers?r.headers:{},i.headers=D.__assign(D.__assign(D.__assign({},a),u),l.headers),[2,{url:F.format(n),options:i}]}})})}}}function en(i){return{defaultDeviceConfig:function(t,n){return D.__awaiter(this,void 0,void 0,function(){var r;return D.__generator(this,function(e){switch(e.label){case 0:return[4,Zt(i).defaultDeviceConfig(t,n)];case 1:return r=e.sent(),[2,function(e,t){void 0===e&&(e=U),void 0===t&&(t=G);var n=D.__assign(D.__assign({},r.options),{url:t+r.url});return e.request(n)}]}})})}}}var tn,nn=(tn=e,D.__extends(rn,tn),rn.prototype.defaultDeviceConfig=function(e,t){var n=this;return en(this.configuration).defaultDeviceConfig(e,t).then(function(e){return e(n.axios,n.basePath)})},rn);function rn(){return null!==tn&&tn.apply(this,arguments)||this}function an(e){void 0===e&&(e={}),this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions}var sn,on,un,cn;(f.ProtobufNullValue||(f.ProtobufNullValue={})).NULLVALUE="NULL_VALUE",(sn=f.StorageImportSourceType||(f.StorageImportSourceType={})).DefaultSourceType="DefaultSourceType",sn.Dialer="Dialer",(on=f.StorageProviderType||(f.StorageProviderType={})).DefaultProvider="DefaultProvider",on.Microsoft="Microsoft",(un=f.StorageServiceType||(f.StorageServiceType={})).DefaultService="DefaultService",un.STT="STT",un.TTS="TTS",(cn=f.StorageUploadStatusCode||(f.StorageUploadStatusCode={})).Unknown="Unknown",cn.Ok="Ok",cn.Failed="Failed";var ln=(dn.prototype.debug=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("debug",e,t)},dn.prototype.info=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("info",e,t)},dn.prototype.warn=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("warn",e,t)},dn.prototype.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("error",e,t)},dn.prototype.emitLogMessage=function(e,t,n){0<n.length?console[e].apply(console,D.__spreadArrays([t],n)):console[e](t)},dn);function dn(){}var _n=(Object.defineProperty(hn.prototype,"id",{get:function(){return this.session.id},enumerable:!0,configurable:!0}),hn.prototype.getLocalMedia=function(){if(this.session.connection){var e=this.session.connection.getLocalStreams();if(e.length)return e}return[]},hn.prototype.getPeerMedia=function(){if(this.session.connection){var e=this.session.connection.getRemoteStreams();if(e.length)return e}return[]},hn.prototype.answer=function(e){var t=this;return new Promise(function(){t.session.answer(e)})},hn);function hn(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")}var pn,fn=(pn=i.EventEmitter,D.__extends(gn,pn),gn.prototype.callOption=function(n){return void 0===n&&(n={}),D.__awaiter(this,void 0,void 0,function(){var t;return D.__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}]}})})},gn.prototype.answer=function(r,i){return D.__awaiter(this,void 0,void 0,function(){var t,n;return D.__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]}})})},gn.prototype.call=function(i){return D.__awaiter(this,void 0,void 0,function(){var t,n,r;return D.__generator(this,function(e){switch(e.label){case 0:if(t={},n=null,i.params&&(t.audio=i.params.audio,t.video=i.params.video||!1,t.screen=i.params.screen||!1,t.disableStun=i.params.disableStun||!1),"string"!=typeof i.destination)throw new Error("bad destination type");return[4,this.callOption(t)];case 1:return r=e.sent(),i.params&&i.params.display&&(n={extraHeaders:["X-Webitel-Display: "+i.params.display]}),[4,this.ua.call(i.destination,D.__assign(D.__assign({},r),n))];case 2:return e.sent(),[2]}})})},gn.prototype.register=function(a){return D.__awaiter(this,void 0,void 0,function(){var t,n,r,i=this;return D.__generator(this,function(e){return t=new s.WebSocketInterface(a.server),n={realm:a.realm,uri:a.uri,authorization_user:a.authorization_user,ha1:a.ha1,user_agent:gn.userAgent,sockets:[t],session_timers:!0,display_name:a.display_name,register_expires:a.register_expires||90,connection_recovery_min_interval:5,connection_recovery_max_interval:60},(r=this.ua=new s.UA(n)).on("newRTCSession",function(e){var t=e.session,n=t.id,r=new _n(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 D.__awaiter(i,void 0,void 0,function(){return D.__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)}),r.on("disconnected",function(e){i.emit("unregistered")}),r.on("unregistered",function(e){i.emit("unregistered")}),r.on("registrationFailed",function(e){i.log.error("registrationFailed",e)}),r.on("registered",function(e){i.emit("registered")}),r.start(),[2]})})},gn.prototype.unregister=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__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]}})})},gn.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},gn.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},gn.prototype.removeSession=function(e,t){var n,r;return t&&(n=t.getLocalStreams(),r=t.getRemoteStreams(),n&&n.forEach(function(e){e.getTracks().forEach(function(e){e.stop()})}),r&&r.forEach(function(e){e.getTracks().forEach(function(e){e.stop()})})),!!this.sessionCache.has(e)&&(this.sessionCache.delete(e),!0)},gn.prototype.storeSession=function(e,t){if(this.sessionCache.has(e))throw new Error("Session already store");this.sessionCache.set(e,t)},Object.defineProperty(gn.prototype,"allSession",{get:function(){return Array.from(this.sessionCache.values())},enumerable:!0,configurable:!0}),gn.prototype.getMediaConstraints=function(e){return e.screen?{video:!1,audio:!1,screen:!0}:{video:e.video||!1,audio:!0}},gn.prototype.getSession=function(e){return this.sessionCache.has(e)?this.sessionCache.get(e):null},gn.prototype.hasSession=function(e){return this.sessionCache.has(e)},gn.prototype.getUserScreen=function(){return D.__awaiter(this,void 0,void 0,function(){var t=this;return D.__generator(this,function(e){return[2,new Promise(function(r,i){return D.__awaiter(t,void 0,void 0,function(){var t,n;return D.__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(),r(t),[3,3];case 2:return n=e.sent(),i(n),[3,3];case 3:return[2]}})})})]})})},gn.prototype.getUserCallStream=function(r){return D.__awaiter(this,void 0,void 0,function(){var t,n;return D.__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)throw new Error("bad stream request");return[2,t]}})})},gn.prototype.getUserMedia=function(i,a){return D.__awaiter(this,void 0,void 0,function(){var t=this;return D.__generator(this,function(e){return[2,new Promise(function(n,r){return D.__awaiter(t,void 0,void 0,function(){var t;return D.__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 D.__awaiter(this,void 0,void 0,function(){return D.__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)]})})})]})})},gn.userAgent="Webitel-Phone/0.0.1",gn);function gn(e,t){var n=pn.call(this)||this;return n.instanceId=e,n.type="webrtc",n.sessionCache=new Map,t?s.debug.enable("*"):s.debug.disable(),n.log=new ln,n.on("unregistered",function(){n.sessionCache.clear()}),n}var vn,yn,bn;(vn=f.JobState||(f.JobState={})).Distribute="distribute",vn.Offering="offering",vn.Bridged="bridged",vn.Missed="missed",vn.Processing="processing",vn.Closed="closed",vn.Destroy="destroy",(bn=yn=yn||{}).Call="call",bn.Chat="chat",bn.Task="task";var wn,mn,qn,An=(Object.defineProperty(Cn.prototype,"queue",{get:function(){return{id:this.distribute.queue_id,name:this.distribute.queue_name}},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"duration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"hasForm",{get:function(){return this.distribute.has_form||!1},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"channel",{get:function(){return this.distribute.channel},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"allowAccept",{get:function(){return this.channel===yn.Task&&0===this.bridgedAt&&0===this.closedAt},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"allowDecline",{get:function(){return this.allowAccept},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"allowClose",{get:function(){return this.channel===yn.Task&&0===this.closedAt&&0<this.bridgedAt},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"memberId",{get:function(){return this.distribute.member_id},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"queueId",{get:function(){return this.distribute.queue_id},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"hasReporting",{get:function(){return this.distribute.has_reporting},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"allowReporting",{get:function(){return this.hasReporting&&0<this.bridgedAt},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"agentChannelId",{get:function(){return this.distribute.agent_channel_id},enumerable:!0,configurable:!0}),Cn.prototype.setState=function(e){this.state=e},Cn.prototype.setAnswered=function(e){this.answeredAt=e,this.lastStatusChange=Date.now()},Cn.prototype.setOffering=function(e){this.offeringAt=e.timestamp},Cn.prototype.setBridged=function(e){this.bridgedAt=e.timestamp,this.lastStatusChange=Date.now(),e.form&&(this.form=e.form)},Cn.prototype.setProcessing=function(e,t){this.state=f.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},Cn.prototype.setClosed=function(e){this.stopAt=e,this.state=f.JobState.Closed},Cn.prototype.setTransferred=function(e){this.distribute=e,this.history.push(e)},Cn.prototype.setMissed=function(){this.state=f.JobState.Missed},Object.defineProperty(Cn.prototype,"processingTimeoutAt",{get:function(){return this._processing&&this._processing.timeout?this._processing.timeout:null},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"processingSec",{get:function(){return this._processing&&this._processing.sec?this._processing.sec:null},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"attempt",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"variables",{get:function(){var e={};for(var t in this.distribute.variables)t.startsWith("cc_")||(e[t]=this.distribute.variables[t]);return e},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"isMember",{get:function(){return!!this.memberId},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"displayNumber",{get:function(){return this.communication.destination},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"displayName",{get:function(){return this.distribute.member_name||null},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"display",{get:function(){return this.displayName+" ("+this.displayNumber+")"},enumerable:!0,configurable:!0}),Object.defineProperty(Cn.prototype,"renewalSec",{get:function(){return this._processing&&this._processing.renewal_sec?this._processing.renewal_sec:null},enumerable:!0,configurable:!0}),Cn.prototype.accept=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__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})]})})},Cn.prototype.close=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__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})]})})},Cn.prototype.decline=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__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})]})})},Cn.prototype.reporting=function(n){return D.__awaiter(this,void 0,void 0,function(){var t;return D.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.request("cc_reporting",D.__assign({attempt_id:this.id},n))];case 1:return t=e.sent(),this.reportedAt=Date.now(),[2,t]}})})},Cn.prototype.renew=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.request("cc_renewal",{attempt_id:this.id,renewal_sec:t||this.processingSec})]})})},Cn.prototype.formAction=function(t,n){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.form)throw new Error("not found active form");return[2,this.client.request("cc_form_action",{attempt_id:this.id,app_id:this.distribute.app_id,action:t,fields:n})]})})},Cn);function Cn(e,t,n){this.client=e,this.distribute=n,this.id=t.attempt_id,this.state=f.JobState.Offering,this.setState(t.status),this.lastStatusChange=t.timestamp,this.createdAt=t.timestamp,this._processing=null,this.offeringAt=0,this.answeredAt=0,this.bridgedAt=0,this.reportedAt=0,this.startProcessingAt=0,this.stopAt=0,this.closedAt=0,this.form=null,this.communication=n.communication,this.history=[n]}(wn=f.AgentStatus||(f.AgentStatus={})).Online="online",wn.Offline="offline",wn.Pause="pause",wn.BreakOut="break_out",(mn=f.ChannelState||(f.ChannelState={})).Waiting="waiting",mn.Distribute="distribute",mn.Offering="offering",mn.Answered="answered",mn.Active="active",mn.Bridged="bridged",mn.Hold="hold",mn.Missed="missed",mn.WrapTime="wrap_time",mn.Processing="processing",mn.Transfer="transfer",mn.Form="form",(qn=f.ChannelType||(f.ChannelType={})).Call="call",qn.Email="email",qn.Chat="chat",qn.Job="task";var Rn,Sn,Kn,Pn=(Object.defineProperty(On.prototype,"agentId",{get:function(){return this.info.agent_id},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"onDemand",{get:function(){return this.info.on_demand},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"status",{get:function(){return this.info.status},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"statusPayload",{get:function(){return this.info.status_payload},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"isAdmin",{get:function(){return this.info.is_admin},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"isSupervisor",{get:function(){return this.info.is_supervisor},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"team",{get:function(){return this.info.team},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"supervisor",{get:function(){return this.info.supervisor},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"auditor",{get:function(){return this.info.auditor},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"channels",{get:function(){return[this._channel]},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"channel",{get:function(){return this._channel},enumerable:!0,configurable:!0}),Object.defineProperty(On.prototype,"stateDuration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!0,configurable:!0}),On.prototype.onChannelEvent=function(e){var t=this;switch(e.status){case f.ChannelState.Distribute:var n=e;if(!n)throw new Error("bad event");if(a=new An(this.client,e,n.distribute),this.task.set(a.id,a),a.agentChannelId)switch(a.channel){case f.ChannelType.Call:var r=this.client.callById(a.agentChannelId);r&&!r.task&&(r.task=a);break;case f.ChannelType.Chat:var i=this.client.conversationById(a.agentChannelId);i&&!i.task&&(i.task=a)}break;case f.ChannelState.Offering:var a,s=e;(a=this.task.get(e.attempt_id))&&(a.setOffering(s),s.offering.auto_answer&&a.channel===f.ChannelType.Job&&a.accept().catch(function(e){t.client.emit("error",e)}));break;case f.ChannelState.Bridged:var o=e;(a=this.task.get(o.attempt_id))&&a.setBridged(o);break;case f.ChannelState.Transfer:var u=e;(a=this.task.get(u.to_attempt_id))&&(this.task.delete(a.id),a.id=u.attempt_id,a.setTransferred(u.distribute),this.task.set(a.id,a));break;case f.ChannelState.Answered:(a=this.task.get(e.attempt_id))&&(a.answeredAt=e.timestamp);break;case f.ChannelState.Form:var c=e;return void((a=this.task.get(e.attempt_id))&&(a.form=c.form||null));case f.ChannelState.Missed:if(e.attempt_id&&(a=this.task.get(e.attempt_id))){a.stopAt=e.timestamp;var l=e;if(!l)throw new Error("bad event");return a.setMissed(),this.setChannelStateTimeout(e.channel,e,l.missed.timeout),this.task.delete(e.attempt_id),this.client.reportingChannelTask(a),a}break;case f.ChannelState.WrapTime:if(e.attempt_id){if(!e)throw new Error("bad event");a=this.task.get(e.attempt_id),this.task.delete(e.attempt_id),this.client.reportingChannelTask(a)}break;case f.ChannelState.Processing:if(e.attempt_id){var d=e;if(!d)throw new Error("bad event");if(a=this.task.get(e.attempt_id))return a.setProcessing(e.timestamp,d.processing),this.setChannelStateTimeout(e.channel,e,d.processing.timeout||0),a}break;case f.ChannelState.Waiting:e.attempt_id&&(a=this.task.get(e.attempt_id))&&(a.setClosed(e.timestamp),this.task.delete(e.attempt_id),this.client.reportingChannelTask(a))}return this.setChannelState(e.channel,e),a?(a.setState(e.status),a):void 0},On.prototype.online=function(t,n){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.agentSetOnline(this.agentId,t,n)]})})},On.prototype.waiting=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.agentSetWaiting(this.agentId,t)]})})},On.prototype.pause=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.agentSetPause(this.agentId,t)]})})},On.prototype.offline=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.agentSetOffline(this.agentId)]})})},On.prototype.setStatus=function(e){e.status===f.AgentStatus.Online&&(this.info.on_demand=e.on_demand||!1,this._channel=e.channels[0]),this.info.status=e.status,this.info.status_payload=e.status_payload?e.status_payload:null,this.lastStatusChange=Date.now()},On.prototype.directMember=function(t,n){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.request("cc_member_direct",{agent_id:this.agentId,member_id:t,communication_id:n})]})})},On.prototype.offlineMembers=function(t,n,r){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.request("cc_fetch_offline_members",{agent_id:this.agentId,page:n,q:t,per_page:r})]})})},On.prototype.hasTask=function(e){return this.task.has(e.id)},On.prototype.setChannelState=function(e,t){this._channel.channel=e||null,this._channel.state=t.status,this._channel.joined_at=t.timestamp,this._channel.timeout=void 0},On.prototype.setChannelStateTimeout=function(e,t,n){this._channel.channel=e||null,this._channel.state=t.status,this._channel.timeout=n,this._channel.joined_at=t.timestamp},On);function On(e,t){this.client=e,this.info=t,this.task=new Map,this._channel=t.channels[0],this.lastStatusChange=Date.now()-1e3*this.info.status_duration}(Rn=f.CallReportingStatus||(f.CallReportingStatus={})).Abandoned="abandoned",Rn.Cancel="cancel",Rn.Success="success",(Sn=f.CallActions||(f.CallActions={})).Ringing="ringing",Sn.Active="active",Sn.Bridge="bridge",Sn.Hold="hold",Sn.DTMF="dtmf",Sn.Voice="voice",Sn.Silence="silence",Sn.Execute="execute",Sn.Update="update",Sn.Hangup="hangup",Sn.Reporting="reporting",Sn.PeerStream="peerStream",Sn.LocalStream="localStream",Sn.Destroy="destroy",(Kn=f.CallDirection||(f.CallDirection={})).Inbound="inbound",Kn.Outbound="outbound";var Tn=(kn.prototype.setState=function(e){this.state=e.event},kn.prototype.setSip=function(e){e&&!this.sip&&(this.sip=e,this.localStreams=e.getLocalMedia(),this.peerStreams=e.getPeerMedia())},Object.defineProperty(kn.prototype,"duration",{get:function(){return 0===this.hangupAt?Math.round((Date.now()-this.createdAt)/1e3):Math.round((this.hangupAt-this.createdAt)/1e3)},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"allowDtmf",{get:function(){return 0<this.answeredAt&&this.allowHangup},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"allowHangup",{get:function(){return 0===this.hangupAt},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"allowHold",{get:function(){return 0===this.hangupAt&&("active"===this.state||"bridge"===this.state)},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"allowAnswer",{get:function(){return this.client.phone&&0===this.hangupAt&&0===this.answeredAt&&(this.queue||this.direction===f.CallDirection.Inbound||this.params&&!this.params.autoAnswer)},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"allowUnHold",{get:function(){return 0===this.hangupAt&&"hold"===this.state},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"memberCommunication",{get:function(){return this.task?this.task.communication:null},enumerable:!0,configurable:!0}),kn.prototype.getMember=function(e){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.isMember)throw new Error("call is not from outbound queue");return[2,this.client.request("cc_member_page",{queue_id:this.task.queueId,member_id:this.task.memberId})]})})},Object.defineProperty(kn.prototype,"isMember",{get:function(){return!(!this.task||!this.task.isMember)},enumerable:!0,configurable:!0}),kn.prototype.setActive=function(e){this.answeredAt||(this.direction===f.CallDirection.Inbound&&(this.bridgedAt=+e.timestamp,this.parentId&&(this.bridgedId=this.parentId)),this.answeredAt=+e.timestamp),this.setState(e)},kn.prototype.setBridged=function(e){var t=e.data;this.bridgedAt||(this.bridgedAt=+e.timestamp),this.bridgedId=t.bridged_id,t.to&&(this.direction===f.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)},kn.prototype.setHold=function(e){this.setState(e)},kn.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},kn.prototype.setPeerStreams=function(e){this.peerStreams=e||[]},kn.prototype.setLocalStreams=function(e){this.localStreams=e||[]},kn.prototype.setVoice=function(){this.voice=!0},kn.prototype.setSilence=function(){this.voice=!1},kn.prototype.setExecute=function(e){this.applications.push(e.application)},kn.prototype.addDigit=function(e){this.digits.push(e.digit)},kn.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(kn.prototype,"allowReporting",{get:function(){return 0<this.answeredAt&&this.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"hasReporting",{get:function(){return!!this.task&&this.task.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"display",{get:function(){return this.displayNumber+" ("+this.displayName+")"},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"muted",{get:function(){return this._muted},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"isHold",{get:function(){return this.state===f.CallActions.Hold},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"allowInboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"allowOutboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"active",{get:function(){return 0===this.hangupAt},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"displayNumber",{get:function(){return"inbound"===this.direction?this.from.number:this.to?this.to.number:this.destination},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"displayName",{get:function(){return"inbound"===this.direction?this.from.name:this.to?this.to.name:this.destination},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"autoAnswer",{get:function(){return this.queue&&"offline"===this.queue.queue_type||this.params&&!0===this.params.autoAnswer},enumerable:!0,configurable:!0}),Object.defineProperty(kn.prototype,"attempt",{get:function(){return this.task},enumerable:!0,configurable:!0}),kn.prototype.answer=function(r){return D.__awaiter(this,void 0,void 0,function(){var t,n;return D.__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(r)];case 2:return t=e.sent(),[4,this.sip.answer(t)];case 3:return e.sent(),[3,5];case 4:return n=e.sent(),this.client.handleError(n),[3,5];case 5:return[2,!0];case 6:return[2,!1]}})})},kn.prototype.answerDelay=function(t,e){var n=this;this.autoAnswered||(this.autoAnswered=!0,setTimeout(function(){return D.__awaiter(n,void 0,void 0,function(){return D.__generator(this,function(e){switch(e.label){case 0:return[4,this.answer(t)];case 1:return e.sent(),[2]}})})},e))},kn.prototype.hangup=function(n){return D.__awaiter(this,void 0,void 0,function(){var t;return D.__generator(this,function(e){return t=n,0!==this.answeredAt||n||(t=this.direction===f.CallDirection.Inbound?"USER_BUSY":"ORIGINATOR_CANCEL"),[2,this.client.request("call_hangup",{id:this.id,app_id:this.appId,cause:t})]})})},kn.prototype.eavesdrop=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return t.id=this.id,[2,this.client.request("call_eavesdrop",t)]})})},kn.prototype.toggleHold=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return this.state===f.CallActions.Hold?[2,this.unHold()]:[2,this.hold()]})})},kn.prototype.hold=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(this.state===f.CallActions.Hold)throw new Error("Call is hold");return[2,this.client.request("call_hold",{id:this.id,app_id:this.appId})]})})},kn.prototype.unHold=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(this.state!==f.CallActions.Hold)throw new Error("Call is active");return[2,this.client.request("call_unhold",{id:this.id,app_id:this.appId})]})})},kn.prototype.sendDTMF=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.request("call_dtmf",{id:this.id,app_id:this.appId,dtmf:t})]})})},kn.prototype.blindTransfer=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.request("call_blind_transfer",{id:this.id,app_id:this.appId,destination:t})]})})},kn.prototype.mute=function(n){return void 0===n&&(n=!1),D.__awaiter(this,void 0,void 0,function(){var t;return D.__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]}})})},kn.prototype.bridgeTo=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__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})]})})},kn.prototype.reporting=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.task)throw new Error("this call not in queue");return[2,this.task.reporting(t)]})})},kn.prototype.renew=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.task)throw new Error("this conversation not in queue");return[2,this.task.renew(t)]})})},kn.prototype.callToUser=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return t.nodeId=this.appId,t.parentCallId=this.id||null,t.sendToCallId=this.parentId||null,[2,this.client.inviteToUser(t)]})})},kn);function kn(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.answeredAt=0,this.hangupAt=0,this.bridgedAt=0,this.reportingAt=0,this.autoAnswered=!1,this.peerStreams=[],this.localStreams=[],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)}var In,Wn;(In=f.ChatActions||(f.ChatActions={})).Message="message",In.UserInvite="user_invite",In.Invite="invite_conversation",In.Joined="join_conversation",In.Close="close_conversation",In.Leave="leave_conversation",In.Decline="decline_invite",In.Update="update_channel",In.Destroy="destroy",(Wn=f.ConversationState||(f.ConversationState={})).Init="init",Wn.Invite="invite",Wn.Active="active",Wn.Pending="pending",Wn.Closed="closed";var Xn=(xn.prototype.setInvite=function(e,t){var n=this;this.inviteId=e,this.invitedAt=t,this._autoAnswer&&this.join().catch(function(e){n.client.emit("error",e)})},xn.prototype.setAnswered=function(e,t,n){this.state=f.ConversationState.Active,this.answeredAt=t,this.channelId=e,this.member=En(n),this.inviteId=null},xn.prototype.setClosed=function(e){this.state=f.ConversationState.Closed,this.closedAt=e},Object.defineProperty(xn.prototype,"id",{get:function(){return this.channelId||this.inviteId||this.conversationId},enumerable:!0,configurable:!0}),Object.defineProperty(xn.prototype,"messages",{get:function(){return this.getMessages()},enumerable:!0,configurable:!0}),xn.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.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})},xn.prototype.next=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){throw new Error("TODO")})})},xn.prototype.pagination=function(e,t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){throw new Error("TODO")})})},xn.prototype.newMessage=function(e){this._messages.push(e)},Object.defineProperty(xn.prototype,"allowDecline",{get:function(){return!!this.inviteId},enumerable:!0,configurable:!0}),Object.defineProperty(xn.prototype,"allowJoin",{get:function(){return!!this.inviteId},enumerable:!0,configurable:!0}),Object.defineProperty(xn.prototype,"allowLeave",{get:function(){return!!this.channelId&&0===this.closedAt},enumerable:!0,configurable:!0}),Object.defineProperty(xn.prototype,"allowReporting",{get:function(){return 0<this.answeredAt&&this.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(xn.prototype,"hasReporting",{get:function(){return this._hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(xn.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:!0,configurable:!0}),Object.defineProperty(xn.prototype,"attempt",{get:function(){return this.task},enumerable:!0,configurable:!0}),xn.prototype.decline=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.inviteId)throw new Error("This conversation is joined");return[2,this.client.request("decline_chat",{invite_id:this.inviteId})]})})},xn.prototype.join=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.inviteId)throw new Error("This conversation is joined");return[2,this.client.request("join_chat",{invite_id:this.inviteId})]})})},xn.prototype.close=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.channelId)throw new Error("This conversation not active");return[2,this.client.request("close_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:t})]})})},xn.prototype.leave=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.channelId)throw new Error("This conversation not active");return[2,this.client.request("leave_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:t})]})})},xn.prototype.sendText=function(r){return D.__awaiter(this,void 0,void 0,function(){var t,n;return D.__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.substr(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]}})})},xn.prototype.sendFile=function(r,i){return D.__awaiter(this,void 0,void 0,function(){var t,n;return D.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.storeFile(this.conversationId,[r],i)];case 1:return t=e.sent(),n=t[0],[2,this.client.request("send_file_chat",{channel_id:this.channelId,conversation_id:this.conversationId,id:n.id,name:r.name,mime:n.mime,url:n.shared,size:n.size})]}})})},xn.prototype.send=function(t,n){return D.__awaiter(this,void 0,void 0,function(){return D.__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")})})},xn.prototype.addToChat=function(t,n){return D.__awaiter(this,void 0,void 0,function(){return D.__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})]})})},xn.prototype.startChat=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.request("start_chat",{user_id:t})]})})},xn.prototype.updateChannel=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.request("update_channel_chat",{channel_id:this.channelId})]})})},xn.prototype.reporting=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.task)throw new Error("this conversation not in queue");return[2,this.task.reporting(t)]})})},xn.prototype.renew=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){if(!this.task)throw new Error("this conversation not in queue");return[2,this.task.renew(t)]})})},xn.prototype.transferToPlan=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.request("blind_transfer_chat",{conversation_id:this.conversationId,channel_id:this.channelId,plan_id:t})]})})},xn.prototype.transferToUser=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.client.request("transfer_user_chat",{conversation_id:this.conversationId,channel_id:this.channelId,user_id:t})]})})},xn.prototype.sendMessageTextChunk=function(e){return this.client.request("send_text_chat",{channel_id:this.channelId,conversation_id:this.conversationId,text:e})},xn.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},xn);function xn(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.members=(r||[]).map(En),this._messages=i||[],this.state=f.ConversationState.Invite,this.variables={},this._hasReporting=!(!a||"true"!==a.cc_reporting),this._autoAnswer=!1,a)!s.startsWith("cc_")&&a.hasOwnProperty(s)&&("wbt_auto_answer"===s?this._autoAnswer="true"===a.wbt_auto_answer:this.variables[s]=a[s]);a&&a.hasOwnProperty("cc_attempt_id")&&this.client.agent&&(this.task=this.client.agent.task.get(+a.cc_attempt_id)||null)}function En(e){return e.messenger=e.type,e}var Qn,jn=(Qn=Error,D.__extends(Un,Qn),Un.id="device_not_found",Un);function Un(e){var t=Qn.call(this,e)||this;return t.id=Un.id,t}var Gn,Bn=(Gn=Error,D.__extends(Mn,Gn),Mn.id="device_not_allow",Mn);function Mn(e){var t=Gn.call(this,e)||this;return t.id=Mn.id,t}var Hn,Ln=(Hn=i.EventEmitter,D.__extends(Dn,Hn),Dn.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()}},Dn.prototype.send=function(e){return this.socket.send(JSON.stringify(e)),null},Dn.prototype.close=function(e){this.socket.close(e||1e3),delete this.socket},Dn.prototype.onOpen=function(){this.emit("open")},Dn.prototype.onClose=function(e){this.emit("close",e),this.off("*")},Dn.prototype.onMessage=function(e){var t;"\0\0\0\0"!==e&&(t=JSON.parse(e),this.emit("message",t))},Dn);function Dn(e){var t=Hn.call(this)||this;return t.host=e,t}var Fn,Nn,Jn,zn="call",Vn="chat",$n="user_state",Yn="agent_status";(Nn=Fn=Fn||{}).NotFoundError="NotFoundError",Nn.NotAllowedError="NotAllowedError",(Jn=f.Response||(f.Response={})).STATUS_FAIL="FAIL",Jn.STATUS_OK="OK";var Zn,er=(Zn=i.EventEmitter,D.__extends(tr,Zn),tr.prototype.connect=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){switch(e.label){case 0:return[4,this.connectToSocket()];case 1:return e.sent(),[2]}})})},tr.prototype.disconnect=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return this.socket.close(),[2]})})},tr.prototype.subscribeCall=function(o,u){return D.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s;return D.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("subscribe_call",u)];case 1:if(t=e.sent(),this.eventHandler.on(zn,o),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}},(s=new Tn(this,a)).createdAt=i.created_at,s.answeredAt=i.answered_at||0,s.bridgedAt=i.bridged_at||0,s.hangupAt=i.hangup_at||0,i.task&&(s.task=new An(this,{attempt_id:i.task.attempt_id,channel:i.task.channel,status:i.task.status,timestamp:Date.now()},i.task),s.queue.reporting="true",s.task.form=i.task.form||null,i.leaving_at&&i.task.processing_sec&&(s.task.startProcessingAt=i.leaving_at,s.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(s.id,s));return[2,t]}})})},tr.prototype.subscribeChat=function(o,u){return D.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s;return D.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("subscribe_chat",u)];case 1:if(t=e.sent(),this.eventHandler.on(Vn,o),t&&t.items)for(n=0,r=t.items;n<r.length;n++){if(i=r[n],a=i.messages.reverse(),(s=new Xn(this,i.id,i.title,i.members,a,i.variables)).createdAt=i.created_at,s.closedAt=i.closed_at,i.task&&(s.task=new An(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&&(s.task.startProcessingAt=i.leaving_at,s.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})),s.task.form=i.task.form||null),i.invite_id)s.setInvite(i.invite_id,i.created_at);else{if(!i.channel_id){this.log.error("conversation "+i.id+" not valid");continue}s.setAnswered(i.channel_id,i.joined_at,{id:i.channel_id,name:"TODO",type:"webitel"})}this.conversationStore.set(s.id,s)}return[2,t]}})})},tr.prototype.subscribeUsersStatus=function(n,r){return D.__awaiter(this,void 0,void 0,function(){var t;return D.__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($n,n),[2,t]}})})},tr.prototype.subscribeAgentsStatus=function(n,r){return D.__awaiter(this,void 0,void 0,function(){var t;return D.__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(Yn,n),[2,t]}})})},tr.prototype.subscribeTask=function(e){this.eventHandler.on("task",e)},tr.prototype.subscribeJob=function(e){this.eventHandler.on("job",e)},tr.prototype.unSubscribe=function(t,e,n){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("un_subscribe_"+t,n)]})})},tr.prototype.destroy=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__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]}})})},tr.prototype.allCall=function(){return Array.from(this.callStore.values())},tr.prototype.allConversations=function(){return Array.from(this.conversationStore.values())},tr.prototype.allTask=function(){return this.agent?Array.from(this.agent.task.values()):[]},tr.prototype.allJob=function(){return this.allTask().filter(nr)},tr.prototype.callById=function(e){if(this.callStore.has(e))return this.callStore.get(e)},tr.prototype.conversationById=function(e){if(this.conversationStore.has(e))return this.conversationStore.get(e)},tr.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}},tr.prototype.reportingTask=function(t,n){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("cc_reporting",D.__assign({attempt_id:t},n))]})})},tr.prototype.agentActiveTasks=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("cc_agent_tasks",{agent_id:t})]})})},tr.prototype.auth=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("authentication_challenge",{token:this._config.token})]})})},tr.prototype.ping=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("ping",{ping:1})]})})},tr.prototype.sessionInfo=function(){return this.connectionInfo.session},Object.defineProperty(tr.prototype,"version",{get:function(){return this.connectionInfo.server_version},enumerable:!0,configurable:!0}),Object.defineProperty(tr.prototype,"buildVersion",{get:function(){return'"0.1.136"'},enumerable:!0,configurable:!0}),Object.defineProperty(tr.prototype,"instanceId",{get:function(){return this.connectionInfo.sock_id},enumerable:!0,configurable:!0}),tr.prototype.agentSession=function(){return D.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l,d,_;return D.__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 Pn(this,t),[4,this.agentActiveTasks(this.agent.agentId)];case 2:for(n=e.sent(),r=0,i=n.items;r<i.length;r++)a=i[r],(s=new An(this,{status:a.status,timestamp:Date.now(),channel:a.channel,attempt_id:a.attempt_id},a)).postProcessData={},s.setState(a.state),a.bridged_at&&(s.bridgedAt=a.bridged_at,s.answeredAt=a.bridged_at),a.leaving_at&&(s.closedAt=a.leaving_at),a.leaving_at&&a.processing_sec&&(s.startProcessingAt=a.leaving_at,s.setProcessing(a.leaving_at,{sec:a.processing_sec||0,timeout:a.processing_timeout_at||null,renewal_sec:a.processing_renewal_sec||0})),s.form=a.form||null,this.agent.task.set(s.id,s);for(o=0,u=this.allCall();o<u.length;o++)(c=u[o]).task&&this.agent.task.set(c.task.id,c.task);for(l=0,d=this.allConversations();l<d.length;l++)(_=d[l]).task&&this.agent.task.set(_.task.id,_.task);return[2,this.agent]}})})},tr.prototype.invite=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("call_invite",t)]})})},tr.prototype.call=function(n){return D.__awaiter(this,void 0,void 0,function(){var t;return D.__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]}})})},tr.prototype.callRecordId=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("call_recordings",{id:t})]})})},tr.prototype.eavesdrop=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("call_eavesdrop",t)]})})},tr.prototype.agentSetOnline=function(t,n,r){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("cc_agent_online",{agent_id:t,channels:n,on_demand:r})]})})},tr.prototype.agentSetWaiting=function(t,n){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("cc_agent_waiting",{agent_id:t,channel:n})]})})},tr.prototype.agentSetPause=function(t,n){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("cc_agent_pause",{agent_id:t,payload:n})]})})},tr.prototype.agentSetOffline=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("cc_agent_offline",{agent_id:t})]})})},tr.prototype.inviteToUser=function(e){return this.request("call_user",e)},tr.prototype.answer=function(n,r){return D.__awaiter(this,void 0,void 0,function(){var t;return D.__generator(this,function(e){return(t=this.callById(n))?[2,t.answer(r)]:[2]})})},tr.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})})},tr.prototype.useWebPhone=function(){return this._config.registerWebDevice||!1},tr.prototype.callDestroyed=function(e){return 0<e.hangupAt&&!this.hasAgentTask(e.task)},tr.prototype.conversationDestroyed=function(e){return 0<e.closedAt&&!this.hasAgentTask(e.task)},tr.prototype.reportingChannelTask=function(e){switch(e.channel){case yn.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 yn.Chat:if(e.agentChannelId){var i=this.conversationById(e.agentChannelId);if(i&&this.conversationDestroyed(i))return void this.destroyConversation(i)}}},tr.prototype.registerCallClient=function(i){return D.__awaiter(this,void 0,void 0,function(){var t,n,r=this;return D.__generator(this,function(e){switch(e.label){case 0:this.phone=i,this.phone.on("peerStreams",function(e,t){var n=r.callBySession(e);n&&!n.peerStreams.length&&(n.setPeerStreams(t),r.eventHandler.emit(zn,f.CallActions.PeerStream,n))}),this.phone.on("localStreams",function(e,t){var n=r.callBySession(e);n&&!n.localStreams.length&&(n.setLocalStreams(t),r.eventHandler.emit(zn,f.CallActions.LocalStream,n))}),this.phone.on("newSession",this.onNewCallSession.bind(this)),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 n=e.sent(),this.log.error(n),[3,5];case 5:return[2]}})})},tr.prototype.deviceConfig=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,this.request("user_default_device",{name:t})]})})},tr.prototype.storeFile=function(d,_,h){return D.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l;return D.__generator(this,function(e){switch(e.label){case 0:if(!_||_.length<1)throw new Error("no files");for(t=new FormData,n=0,r=_;n<r.length;n++)i=r[n],t.append(i.name,i);return[4,U.post(this.basePath+"/api/storage/file/"+d+"/upload",t,{headers:((l={})["X-Webitel-Access"]=this._config.token,l),onUploadProgress:h})];case 1:for(a=e.sent(),s=a.data,o=0,u=s;o<u.length;o++)(c=u[o]).shared=this.basePath+c.shared;return[2,s]}})})},tr.prototype.fileUrlDownload=function(e){return this.basePath+"/api/storage/file/"+e+"/download?access_token="+this._config.token},tr.prototype.fileUrlStream=function(e){return this.basePath+"/api/storage/file/"+e+"/stream?access_token="+this._config.token},tr.prototype.handleError=function(e){if(e)switch(e.name){case Fn.NotFoundError:this.emit("error",new jn(e.message));break;case Fn.NotAllowedError:this.emit("error",new Bn(e.message));break;default:this.emit("error",e)}},tr.prototype.onMessage=function(n){return D.__awaiter(this,void 0,void 0,function(){var t;return D.__generator(this,function(e){switch(e.label){case 0:return this.log.debug("receive message: ",n),0<n.seq_reply?(this.queueRequest.has(n.seq_reply)&&(t=this.queueRequest.get(n.seq_reply),this.queueRequest.delete(n.seq_reply),n.status===f.Response.STATUS_OK?t.resolve(n.data):t.reject(n.error)),[3,13]):[3,1];case 1:switch(n.event){case"hello":return[3,2];case zn:return[3,4];case Vn:return[3,6];case $n:return[3,8];case"sip":return[3,9];case Yn:return[3,10];case"channel":return[3,11]}return[3,12];case 2:return[4,this.connected(n.data)];case 3:return e.sent(),this.log.debug("opened session "+this.connectionInfo.sock_id+" for userId="+this.connectionInfo.session.user_id),[3,13];case 4:return[4,this.handleCallEvents(n.data.call)];case 5:return e.sent(),[3,13];case 6:return[4,this.handleChatEvents(n.data)];case 7:return e.sent(),[3,13];case 8:return this.handleUserStateEvent(n.data.state),[3,13];case 9:return this.eventHandler.emit("sip",n.data),[3,13];case 10:return this.handleAgentStatus(n.data),[3,13];case 11:return this.handleChannelEvents(n.data),[3,13];case 12:this.log.error("event "+n.event+" not handler"),e.label=13;case 13:return[2]}})})},tr.prototype.handleAgentStatus=function(e){this.agent&&e.agent_id===this.agent.agentId&&this.agent.setStatus(e),this.eventHandler.emit(Yn,e,this.agent)},tr.prototype.handleChannelEvents=function(e){var t,n;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),n=t.state,-1<[f.ChannelState.Missed.toString(),f.ChannelState.Waiting,f.ChannelState.WrapTime,f.JobState.Closed].indexOf(n)&&this.eventHandler.emit("job",f.JobState.Destroy,t)))},tr.prototype.pingServer=function(){return D.__awaiter(this,void 0,void 0,function(){var t,n=this;return D.__generator(this,function(e){switch(e.label){case 0:return this.pingTimer&&this.connectionInfo.ping_interval?(t=setTimeout(function(){return D.__awaiter(n,void 0,void 0,function(){return D.__generator(this,function(e){return this.socket.close(3005),[2]})})},this.connectionInfo.ping_interval/2),[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]}})})},tr.prototype.connected=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__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 fn(this.instanceId,this._config.debug))]:[2]}})})},tr.prototype.callBySession=function(e){for(var t=0,n=this.allCall();t<n.length;t++){var r=n[t];if(r.sip===e)return r}},tr.prototype.onNewCallSession=function(n){return D.__awaiter(this,void 0,void 0,function(){var t;return D.__generator(this,function(e){return(t=n.callId?this.callById(n.callId):this.callBySipId(n.id))&&(t.setSip(n),this.checkAutoAnswer(t)),[2]})})},tr.prototype.checkAutoAnswer=function(e){e.autoAnswer&&e.answerDelay({video:e.params.video,screen:e.params.screen,disableStun:e.params.disableStun},300)},tr.prototype.connectToSocket=function(){var n=this;return new Promise(function(e,t){try{n.socket=new Ln(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),n.eventHandler.off("*"),1e3!==e&&(n.emit("disconnected",e),t(new Error("close socket code: "+e)))}),n.socket.on("open",function(){e(null),n.emit("connected")})})},tr.prototype.handleUserStateEvent=function(e){this.eventHandler.emit($n,e)},tr.prototype.handleCallEvents=function(n){return D.__awaiter(this,void 0,void 0,function(){var t;return D.__generator(this,function(e){switch(n.timestamp=Date.now(),n.event){case f.CallActions.Ringing:t=new Tn(this,n),this.callStore.set(t.id,t),this.checkAutoAnswer(t);break;case f.CallActions.Active:(t=this.callById(n.id))&&t.setActive(n);break;case f.CallActions.Bridge:(t=this.callById(n.id))&&t.setBridged(n);break;case f.CallActions.Execute:(t=this.callById(n.id))&&t.setExecute(n.data);break;case f.CallActions.DTMF:(t=this.callById(n.id))&&t.addDigit(n.data);break;case f.CallActions.Voice:(t=this.callById(n.id))&&t.setVoice();break;case f.CallActions.Silence:(t=this.callById(n.id))&&t.setSilence();break;case f.CallActions.Hold:(t=this.callById(n.id))&&t.setHold(n);break;case f.CallActions.Hangup:(t=this.callById(n.id))&&t.setHangup(n);break;default:throw new Error("Unhandled action")}return t&&(this.eventHandler.emit(zn,n.event,t),this.callDestroyed(t)&&this.destroyCall(t)),[2]})})},tr.prototype.handleChatEvents=function(p){return D.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l,d,_,h;return D.__generator(this,function(e){switch(n=Date.now(),p.action){case f.ChatActions.UserInvite:r=p.data,(t=new Xn(this,r.conversation_id,r.title,r.members,r.messages,r.variables)).setInvite(r.invite_id,n),this.conversationStore.set(t.id,t);break;case f.ChatActions.Joined:i=p.data,(t=this.conversationById(i.member.id))&&t.setAnswered(i.member.id,n,i.member);break;case f.ChatActions.Message:for((a=p.data).timestamp=n,s=0,o=this.allConversations();s<o.length;s++)!(d=o[s]).closedAt&&-1<d.membersId.indexOf(a.channel_id)&&(t=d);t&&t.newMessage(a);break;case f.ChatActions.Close:for(u=p.data,c=0,l=this.allConversations();c<l.length;c++)!(d=l[c]).closedAt&&-1<d.membersId.indexOf(u.from_channel_id)&&(t=d);t&&t.setClosed(n);break;case f.ChatActions.Leave:_=p.data,(t=this.conversationById(_.leaved_channel_id))&&t.setClosed(n);break;case f.ChatActions.Decline:h=p.data,(t=this.conversationById(h.invite_id))&&t.setClosed(n)}return t&&(this.eventHandler.emit(Vn,p.action,t),this.conversationDestroyed(t)&&this.destroyConversation(t)),[2]})})},tr.prototype.hasAgentTask=function(e){return!(!this.agent||!e)&&this.agent.hasTask(e)},tr.prototype.destroyCall=function(e){this.callStore.delete(e.id),this.eventHandler.emit(zn,f.CallActions.Destroy,e)},tr.prototype.destroyConversation=function(e){this.conversationStore.delete(e.id),this.eventHandler.emit(Vn,f.ChatActions.Destroy,e)},tr);function tr(e){var t,n,r=Zn.call(this)||this;return r._config=e,r.reqSeq=0,r.queueRequest=new Map,r.log=new ln,r.eventHandler=new i.EventEmitter,r.callStore=new Map,r.conversationStore=new Map,r.pingTimer=null,r.basePath=""+(t=e.storageEndpoint||e.endpoint,(n=t.replace(/^ws/,"http")).endsWith("/")&&(n=n.slice(0,-1)),n.endsWith("/ws")&&(n=n.slice(0,-3)),n),r}function nr(e){return e.channel===yn.Task}var rr,ir=(rr=i.EventEmitter,D.__extends(ar,rr),ar);function ar(){return null!==rr&&rr.apply(this,arguments)||this}var sr="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var or,ur,cr=(function(c){var e=sr&&sr.__generator||function(n,r){var i,a,s,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[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(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,s&&(t=[2&t[0],s.value]),t[0]){case 0:case 1:s=t;break;case 4:return o.label++,{value:t[1],done:!1};case 5:o.label++,a=t[1],t=[0];continue;case 7:t=o.ops.pop(),o.trys.pop();continue;default:if(!(s=0<(s=o.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){o=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){o.label=t[1];break}if(6===t[0]&&o.label<s[1]){o.label=s[1],s=t;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(t);break}s[2]&&o.ops.pop(),o.trys.pop();continue}t=r.call(n,o)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}};Object.defineProperty(c,"__esModule",{value:!0}),c.$listeners=Symbol("EventEmitter.listeners"),c.$addListener=Symbol("EventEmitter.addListener");var t=(n.count=function(e,t){var n=0,r=e[c.$listeners][t];if(r)for(var i=r.first;++n&&i.next;)i=i.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);return this}if("function"==typeof t){var i=this[c.$listeners][e];if(i&&function(e,t){for(var n=null,r=e.first;;)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}(i,function(e){return e.fn==t}))return this}return delete this[c.$listeners][e],this._onEventUnhandled&&this._onEventUnhandled(e),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;var o=s.apply(void 0,n);void 0!==o&&(t=o)}},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&&(t=n,a=l(this[c.$listeners],t,{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}((or={exports:{}},or.exports)),or.exports);(ur=cr)&&ur.__esModule&&Object.prototype.hasOwnProperty.call(ur,"default")&&ur.default;cr.$listeners,cr.$addListener;var lr=cr.EventEmitter,dr=(Object.defineProperty(_r.prototype,"id",{get:function(){return this.callId},enumerable:!0,configurable:!0}),_r.prototype.getLocalMedia=function(){return[]},_r.prototype.getPeerMedia=function(){return[]},_r.prototype.answer=function(e){var t=this;return new Promise(function(e){t.client.answer(t.id),e()})},_r);function _r(e,t){this.client=e,this.callId=t,this.incoming=!1,this.instanceId="fixme"}var hr,pr=(hr=lr,D.__extends(fr,hr),fr.prototype.callOption=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2,t]})})},fr.prototype.register=function(e){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2]})})},fr.prototype.unregister=function(){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return[2]})})},fr.prototype.call=function(t){return D.__awaiter(this,void 0,void 0,function(){return D.__generator(this,function(e){return t.destination&&this.exec(t.destination),[2]})})},fr.prototype.answer=function(e){this.exec(e,"answer")},fr.prototype.sipSessionByCallId=function(e){return new dr(this,e)},fr.prototype.sipSessionBySipId=function(e){return null},fr.prototype.open=function(e){this.exec(encodeURIComponent(JSON.stringify(D.__assign({token:e},this.config))),"open")},fr.prototype.exec=function(e,t){var n=""+this.schema+e;t&&(n+=" "+t);var r=document.createElement("a");r.download="File name",r.href=n,r.click()},fr);function fr(e){var t=hr.call(this)||this;return t.config=e,t.type="external",t.schema="wtel://",t}f.AgentPauseCauseServiceApiAxiosParamCreator=l,f.AgentPauseCauseServiceApiFp=d,f.AgentPauseCauseServiceApiFactory=function(o,u,c){return{createAgentPauseCause:function(e,t){return d(o).createAgentPauseCause(e,t).then(function(e){return e(c,u)})},deleteAgentPauseCause:function(e,t){return d(o).deleteAgentPauseCause(e,t).then(function(e){return e(c,u)})},patchAgentPauseCause:function(e,t,n){return d(o).patchAgentPauseCause(e,t,n).then(function(e){return e(c,u)})},readAgentPauseCause:function(e,t){return d(o).readAgentPauseCause(e,t).then(function(e){return e(c,u)})},searchAgentPauseCause:function(e,t,n,r,i,a,s){return d(o).searchAgentPauseCause(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateAgentPauseCause:function(e,t,n){return d(o).updateAgentPauseCause(e,t,n).then(function(e){return e(c,u)})}}},f.AgentPauseCauseServiceApi=a,f.AgentServiceApiAxiosParamCreator=q,f.AgentServiceApiFp=A,f.AgentServiceApiFactory=function(b,w,m){return{agentSetState:function(e,t,n){return A(b).agentSetState(e,t,n).then(function(e){return e(m,w)})},agentStateHistory:function(e,t,n,r,i,a,s,o){return A(b).agentStateHistory(e,t,n,r,i,a,s,o).then(function(e){return e(m,w)})},agentTodayStatistics:function(e,t,n){return A(b).agentTodayStatistics(e,t,n).then(function(e){return e(m,w)})},createAgent:function(e,t){return A(b).createAgent(e,t).then(function(e){return e(m,w)})},deleteAgent:function(e,t,n){return A(b).deleteAgent(e,t,n).then(function(e){return e(m,w)})},patchAgent:function(e,t,n){return A(b).patchAgent(e,t,n).then(function(e){return e(m,w)})},readAgent:function(e,t,n){return A(b).readAgent(e,t,n).then(function(e){return e(m,w)})},searchAgent:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y){return A(b).searchAgent(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y).then(function(e){return e(m,w)})},searchAgentCallStatistics:function(e,t,n,r,i,a,s,o,u,c){return A(b).searchAgentCallStatistics(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(m,w)})},searchAgentInQueue:function(e,t,n,r,i,a,s){return A(b).searchAgentInQueue(e,t,n,r,i,a,s).then(function(e){return e(m,w)})},searchAgentInQueueStatistics:function(e,t,n){return A(b).searchAgentInQueueStatistics(e,t,n).then(function(e){return e(m,w)})},searchAgentInTeam:function(e,t,n,r,i,a){return A(b).searchAgentInTeam(e,t,n,r,i,a).then(function(e){return e(m,w)})},searchAgentStateHistory:function(e,t,n,r,i,a,s,o,u){return A(b).searchAgentStateHistory(e,t,n,r,i,a,s,o,u).then(function(e){return e(m,w)})},searchAgentStatusStatistic:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y){return A(b).searchAgentStatusStatistic(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y).then(function(e){return e(m,w)})},searchAgentStatusStatisticItem:function(e,t,n,r){return A(b).searchAgentStatusStatisticItem(e,t,n,r).then(function(e){return e(m,w)})},searchLookupUsersAgentNotExists:function(e,t,n,r,i){return A(b).searchLookupUsersAgentNotExists(e,t,n,r,i).then(function(e){return e(m,w)})},searchPauseCauseForAgent:function(e,t,n){return A(b).searchPauseCauseForAgent(e,t,n).then(function(e){return e(m,w)})},updateAgent:function(e,t,n){return A(b).updateAgent(e,t,n).then(function(e){return e(m,w)})},updateAgentStatus:function(e,t,n){return A(b).updateAgentStatus(e,t,n).then(function(e){return e(m,w)})}}},f.AgentServiceApi=c,f.AgentSkillServiceApiAxiosParamCreator=h,f.AgentSkillServiceApiFp=p,f.AgentSkillServiceApiFactory=function(u,c,l){return{createAgentSkill:function(e,t,n){return p(u).createAgentSkill(e,t,n).then(function(e){return e(l,c)})},deleteAgentSkill:function(e,t,n,r){return p(u).deleteAgentSkill(e,t,n,r).then(function(e){return e(l,c)})},patchAgentSkill:function(e,t,n,r){return p(u).patchAgentSkill(e,t,n,r).then(function(e){return e(l,c)})},readAgentSkill:function(e,t,n,r){return p(u).readAgentSkill(e,t,n,r).then(function(e){return e(l,c)})},searchAgentSkill:function(e,t,n,r,i,a,s,o){return p(u).searchAgentSkill(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},searchLookupAgentNotExistsSkill:function(e,t,n,r,i,a){return p(u).searchLookupAgentNotExistsSkill(e,t,n,r,i,a).then(function(e){return e(l,c)})},updateAgentSkill:function(e,t,n,r){return p(u).updateAgentSkill(e,t,n,r).then(function(e){return e(l,c)})}}},f.AgentSkillServiceApi=v,f.AgentTeamServiceApiAxiosParamCreator=b,f.AgentTeamServiceApiFp=w,f.AgentTeamServiceApiFactory=function(c,l,d){return{createAgentTeam:function(e,t){return w(c).createAgentTeam(e,t).then(function(e){return e(d,l)})},deleteAgentTeam:function(e,t,n){return w(c).deleteAgentTeam(e,t,n).then(function(e){return e(d,l)})},readAgentTeam:function(e,t,n){return w(c).readAgentTeam(e,t,n).then(function(e){return e(d,l)})},searchAgentTeam:function(e,t,n,r,i,a,s,o,u){return w(c).searchAgentTeam(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateAgentTeam:function(e,t,n){return w(c).updateAgentTeam(e,t,n).then(function(e){return e(d,l)})}}},f.AgentTeamServiceApi=C,f.BackendProfileServiceApiAxiosParamCreator=S,f.BackendProfileServiceApiFp=K,f.BackendProfileServiceApiFactory=function(o,u,c){return{createBackendProfile:function(e,t){return K(o).createBackendProfile(e,t).then(function(e){return e(c,u)})},deleteBackendProfile:function(e,t,n){return K(o).deleteBackendProfile(e,t,n).then(function(e){return e(c,u)})},patchBackendProfile:function(e,t,n){return K(o).patchBackendProfile(e,t,n).then(function(e){return e(c,u)})},readBackendProfile:function(e,t,n){return K(o).readBackendProfile(e,t,n).then(function(e){return e(c,u)})},searchBackendProfile:function(e,t,n,r,i,a,s){return K(o).searchBackendProfile(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateBackendProfile:function(e,t,n){return K(o).updateBackendProfile(e,t,n).then(function(e){return e(c,u)})}}},f.BackendProfileServiceApi=O,f.BucketServiceApiAxiosParamCreator=I,f.BucketServiceApiFp=W,f.BucketServiceApiFactory=function(o,u,c){return{createBucket:function(e,t){return W(o).createBucket(e,t).then(function(e){return e(c,u)})},deleteBucket:function(e,t,n){return W(o).deleteBucket(e,t,n).then(function(e){return e(c,u)})},readBucket:function(e,t,n){return W(o).readBucket(e,t,n).then(function(e){return e(c,u)})},searchBucket:function(e,t,n,r,i,a,s){return W(o).searchBucket(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateBucket:function(e,t,n){return W(o).updateBucket(e,t,n).then(function(e){return e(c,u)})}}},f.BucketServiceApi=x,f.CalendarServiceApiAxiosParamCreator=Q,f.CalendarServiceApiFp=j,f.CalendarServiceApiFactory=function(o,u,c){return{createCalendar:function(e,t){return j(o).createCalendar(e,t).then(function(e){return e(c,u)})},deleteCalendar:function(e,t,n){return j(o).deleteCalendar(e,t,n).then(function(e){return e(c,u)})},readCalendar:function(e,t,n){return j(o).readCalendar(e,t,n).then(function(e){return e(c,u)})},searchCalendar:function(e,t,n,r,i,a,s){return j(o).searchCalendar(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},searchTimezones:function(e,t,n,r){return j(o).searchTimezones(e,t,n,r).then(function(e){return e(c,u)})},updateCalendar:function(e,t,n){return j(o).updateCalendar(e,t,n).then(function(e){return e(c,u)})}}},f.CalendarServiceApi=M,f.CallServiceApiAxiosParamCreator=L,f.CallServiceApiFp=N,f.CallServiceApiFactory=function(E,Q,j){return{aggregateHistoryCall:function(e,t){return N(E).aggregateHistoryCall(e,t).then(function(e){return e(j,Q)})},blindTransferCall:function(e,t,n){return N(E).blindTransferCall(e,t,n).then(function(e){return e(j,Q)})},confirmPush:function(e,t){return N(E).confirmPush(e,t).then(function(e){return e(j,Q)})},createCall:function(e,t){return N(E).createCall(e,t).then(function(e){return e(j,Q)})},createCallAnnotation:function(e,t,n){return N(E).createCallAnnotation(e,t,n).then(function(e){return e(j,Q)})},deleteCallAnnotation:function(e,t,n){return N(E).deleteCallAnnotation(e,t,n).then(function(e){return e(j,Q)})},dtmfCall:function(e,t,n){return N(E).dtmfCall(e,t,n).then(function(e){return e(j,Q)})},eavesdropCall:function(e,t,n){return N(E).eavesdropCall(e,t,n).then(function(e){return e(j,Q)})},hangupCall:function(e,t,n){return N(E).hangupCall(e,t,n).then(function(e){return e(j,Q)})},holdCall:function(e,t,n){return N(E).holdCall(e,t,n).then(function(e){return e(j,Q)})},readCall:function(e,t,n){return N(E).readCall(e,t,n).then(function(e){return e(j,Q)})},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,O){return N(E).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,O).then(function(e){return e(j,Q)})},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,O,T,k,I,W,X,x){return N(E).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,O,T,k,I,W,X,x).then(function(e){return e(j,Q)})},unHoldCall:function(e,t,n){return N(E).unHoldCall(e,t,n).then(function(e){return e(j,Q)})},updateCallAnnotation:function(e,t,n,r){return N(E).updateCallAnnotation(e,t,n,r).then(function(e){return e(j,Q)})}}},f.CallServiceApi=z,f.CognitiveProfileServiceApiAxiosParamCreator=$,f.CognitiveProfileServiceApiFp=Y,f.CognitiveProfileServiceApiFactory=function(c,l,d){return{createCognitiveProfile:function(e,t){return Y(c).createCognitiveProfile(e,t).then(function(e){return e(d,l)})},deleteCognitiveProfile:function(e,t){return Y(c).deleteCognitiveProfile(e,t).then(function(e){return e(d,l)})},patchCognitiveProfile:function(e,t,n){return Y(c).patchCognitiveProfile(e,t,n).then(function(e){return e(d,l)})},readCognitiveProfile:function(e,t){return Y(c).readCognitiveProfile(e,t).then(function(e){return e(d,l)})},searchCognitiveProfile:function(e,t,n,r,i,a,s,o,u){return Y(c).searchCognitiveProfile(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateCognitiveProfile:function(e,t,n){return Y(c).updateCognitiveProfile(e,t,n).then(function(e){return e(d,l)})}}},f.CognitiveProfileServiceApi=ee,f.CommunicationTypeServiceApiAxiosParamCreator=ne,f.CommunicationTypeServiceApiFp=re,f.CommunicationTypeServiceApiFactory=function(o,u,c){return{createCommunicationType:function(e,t){return re(o).createCommunicationType(e,t).then(function(e){return e(c,u)})},deleteCommunicationType:function(e,t,n){return re(o).deleteCommunicationType(e,t,n).then(function(e){return e(c,u)})},readCommunicationType:function(e,t,n){return re(o).readCommunicationType(e,t,n).then(function(e){return e(c,u)})},searchCommunicationType:function(e,t,n,r,i,a,s){return re(o).searchCommunicationType(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateCommunicationType:function(e,t,n){return re(o).updateCommunicationType(e,t,n).then(function(e){return e(c,u)})}}},f.CommunicationTypeServiceApi=ae,f.EmailProfileServiceApiAxiosParamCreator=oe,f.EmailProfileServiceApiFp=ue,f.EmailProfileServiceApiFactory=function(s,o,u){return{createEmailProfile:function(e,t){return ue(s).createEmailProfile(e,t).then(function(e){return e(u,o)})},deleteEmailProfile:function(e,t){return ue(s).deleteEmailProfile(e,t).then(function(e){return e(u,o)})},patchEmailProfile:function(e,t,n){return ue(s).patchEmailProfile(e,t,n).then(function(e){return e(u,o)})},readEmailProfile:function(e,t){return ue(s).readEmailProfile(e,t).then(function(e){return e(u,o)})},searchEmailProfile:function(e,t,n,r,i,a){return ue(s).searchEmailProfile(e,t,n,r,i,a).then(function(e){return e(u,o)})},updateEmailProfile:function(e,t,n){return ue(s).updateEmailProfile(e,t,n).then(function(e){return e(u,o)})}}},f.EmailProfileServiceApi=le,f.FileServiceApiAxiosParamCreator=_e,f.FileServiceApiFp=he,f.FileServiceApiFactory=function(n,r,i){return{deleteFiles:function(e,t){return he(n).deleteFiles(e,t).then(function(e){return e(i,r)})}}},f.FileServiceApi=fe,f.FileTranscriptServiceApiAxiosParamCreator=ve,f.FileTranscriptServiceApiFp=ye,f.FileTranscriptServiceApiFactory=function(i,a,s){return{createFileTranscript:function(e,t){return ye(i).createFileTranscript(e,t).then(function(e){return e(s,a)})},getFileTranscriptPhrases:function(e,t,n,r){return ye(i).getFileTranscriptPhrases(e,t,n,r).then(function(e){return e(s,a)})}}},f.FileTranscriptServiceApi=we,f.ImportTemplateServiceApiAxiosParamCreator=qe,f.ImportTemplateServiceApiFp=Ae,f.ImportTemplateServiceApiFactory=function(o,u,c){return{createImportTemplate:function(e,t){return Ae(o).createImportTemplate(e,t).then(function(e){return e(c,u)})},deleteImportTemplate:function(e,t){return Ae(o).deleteImportTemplate(e,t).then(function(e){return e(c,u)})},patchImportTemplate:function(e,t,n){return Ae(o).patchImportTemplate(e,t,n).then(function(e){return e(c,u)})},readImportTemplate:function(e,t){return Ae(o).readImportTemplate(e,t).then(function(e){return e(c,u)})},searchImportTemplate:function(e,t,n,r,i,a,s){return Ae(o).searchImportTemplate(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateImportTemplate:function(e,t,n){return Ae(o).updateImportTemplate(e,t,n).then(function(e){return e(c,u)})}}},f.ImportTemplateServiceApi=Re,f.ListServiceApiAxiosParamCreator=Ke,f.ListServiceApiFp=Pe,f.ListServiceApiFactory=function(u,c,l){return{createList:function(e,t){return Pe(u).createList(e,t).then(function(e){return e(l,c)})},createListCommunication:function(e,t,n){return Pe(u).createListCommunication(e,t,n).then(function(e){return e(l,c)})},deleteList:function(e,t,n){return Pe(u).deleteList(e,t,n).then(function(e){return e(l,c)})},deleteListCommunication:function(e,t,n,r){return Pe(u).deleteListCommunication(e,t,n,r).then(function(e){return e(l,c)})},readList:function(e,t,n){return Pe(u).readList(e,t,n).then(function(e){return e(l,c)})},readListCommunication:function(e,t,n,r){return Pe(u).readListCommunication(e,t,n,r).then(function(e){return e(l,c)})},searchList:function(e,t,n,r,i,a,s){return Pe(u).searchList(e,t,n,r,i,a,s).then(function(e){return e(l,c)})},searchListCommunication:function(e,t,n,r,i,a,s,o){return Pe(u).searchListCommunication(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateList:function(e,t,n){return Pe(u).updateList(e,t,n).then(function(e){return e(l,c)})},updateListCommunication:function(e,t,n,r){return Pe(u).updateListCommunication(e,t,n,r).then(function(e){return e(l,c)})}}},f.ListServiceApi=Te,f.MediaFileServiceApiAxiosParamCreator=Ie,f.MediaFileServiceApiFp=We,f.MediaFileServiceApiFactory=function(o,u,c){return{deleteMediaFile:function(e,t,n){return We(o).deleteMediaFile(e,t,n).then(function(e){return e(c,u)})},readMediaFile:function(e,t,n){return We(o).readMediaFile(e,t,n).then(function(e){return e(c,u)})},searchMediaFile:function(e,t,n,r,i,a,s){return We(o).searchMediaFile(e,t,n,r,i,a,s).then(function(e){return e(c,u)})}}},f.MediaFileServiceApi=xe,f.MemberServiceApiAxiosParamCreator=Qe,f.MemberServiceApiFp=je,f.MemberServiceApiFactory=function(m,q,A){return{attemptCallback:function(e,t,n){return je(m).attemptCallback(e,t,n).then(function(e){return e(A,q)})},attemptResult:function(e,t,n,r,i){return je(m).attemptResult(e,t,n,r,i).then(function(e){return e(A,q)})},attemptsRenewalResult:function(e,t,n){return je(m).attemptsRenewalResult(e,t,n).then(function(e){return e(A,q)})},createAttempt:function(e,t,n,r){return je(m).createAttempt(e,t,n,r).then(function(e){return e(A,q)})},createMember:function(e,t,n){return je(m).createMember(e,t,n).then(function(e){return e(A,q)})},createMemberBulk:function(e,t,n){return je(m).createMemberBulk(e,t,n).then(function(e){return e(A,q)})},deleteMember:function(e,t,n,r){return je(m).deleteMember(e,t,n,r).then(function(e){return e(A,q)})},deleteMembers:function(e,t,n){return je(m).deleteMembers(e,t,n).then(function(e){return e(A,q)})},patchMember:function(e,t,n,r){return je(m).patchMember(e,t,n,r).then(function(e){return e(A,q)})},readMember:function(e,t,n,r){return je(m).readMember(e,t,n,r).then(function(e){return e(A,q)})},resetMembers:function(e,t,n){return je(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 je(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 je(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 je(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 je(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 je(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 je(m).updateMember(e,t,n,r).then(function(e){return e(A,q)})}}},f.MemberServiceApi=Ge,f.OutboundResourceGroupServiceApiAxiosParamCreator=Me,f.OutboundResourceGroupServiceApiFp=He,f.OutboundResourceGroupServiceApiFactory=function(u,c,l){return{createOutboundResourceGroup:function(e,t){return He(u).createOutboundResourceGroup(e,t).then(function(e){return e(l,c)})},createOutboundResourceInGroup:function(e,t,n){return He(u).createOutboundResourceInGroup(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceGroup:function(e,t,n){return He(u).deleteOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceInGroup:function(e,t,n,r){return He(u).deleteOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})},readOutboundResourceGroup:function(e,t,n){return He(u).readOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},readOutboundResourceInGroup:function(e,t,n,r){return He(u).readOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})},searchOutboundResourceGroup:function(e,t,n,r,i,a,s){return He(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 He(u).searchOutboundResourceInGroup(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateOutboundResourceGroup:function(e,t,n){return He(u).updateOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},updateOutboundResourceInGroup:function(e,t,n,r){return He(u).updateOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})}}},f.OutboundResourceGroupServiceApi=De,f.OutboundResourceServiceApiAxiosParamCreator=Ne,f.OutboundResourceServiceApiFp=Je,f.OutboundResourceServiceApiFactory=function(u,c,l){return{createOutboundResource:function(e,t){return Je(u).createOutboundResource(e,t).then(function(e){return e(l,c)})},createOutboundResourceDisplay:function(e,t,n){return Je(u).createOutboundResourceDisplay(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResource:function(e,t,n){return Je(u).deleteOutboundResource(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceDisplay:function(e,t,n,r){return Je(u).deleteOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})},patchOutboundResource:function(e,t,n){return Je(u).patchOutboundResource(e,t,n).then(function(e){return e(l,c)})},readOutboundResource:function(e,t,n){return Je(u).readOutboundResource(e,t,n).then(function(e){return e(l,c)})},readOutboundResourceDisplay:function(e,t,n,r){return Je(u).readOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})},searchOutboundResource:function(e,t,n,r,i,a,s){return Je(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 Je(u).searchOutboundResourceDisplay(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateOutboundResource:function(e,t,n){return Je(u).updateOutboundResource(e,t,n).then(function(e){return e(l,c)})},updateOutboundResourceDisplay:function(e,t,n,r){return Je(u).updateOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})}}},f.OutboundResourceServiceApi=Ve,f.QueueBucketServiceApiAxiosParamCreator=Ye,f.QueueBucketServiceApiFp=Ze,f.QueueBucketServiceApiFactory=function(u,c,l){return{createQueueBucket:function(e,t,n){return Ze(u).createQueueBucket(e,t,n).then(function(e){return e(l,c)})},deleteQueueBucket:function(e,t,n){return Ze(u).deleteQueueBucket(e,t,n).then(function(e){return e(l,c)})},patchQueueBucket:function(e,t,n,r){return Ze(u).patchQueueBucket(e,t,n,r).then(function(e){return e(l,c)})},readQueueBucket:function(e,t,n){return Ze(u).readQueueBucket(e,t,n).then(function(e){return e(l,c)})},searchQueueBucket:function(e,t,n,r,i,a,s,o){return Ze(u).searchQueueBucket(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateQueueBucket:function(e,t,n,r){return Ze(u).updateQueueBucket(e,t,n,r).then(function(e){return e(l,c)})}}},f.QueueBucketServiceApi=tt,f.QueueHookServiceApiAxiosParamCreator=rt,f.QueueHookServiceApiFp=it,f.QueueHookServiceApiFactory=function(l,d,_){return{createQueueHook:function(e,t,n){return it(l).createQueueHook(e,t,n).then(function(e){return e(_,d)})},deleteQueueHook:function(e,t,n){return it(l).deleteQueueHook(e,t,n).then(function(e){return e(_,d)})},patchQueueHook:function(e,t,n,r){return it(l).patchQueueHook(e,t,n,r).then(function(e){return e(_,d)})},readQueueHook:function(e,t,n){return it(l).readQueueHook(e,t,n).then(function(e){return e(_,d)})},searchQueueHook:function(e,t,n,r,i,a,s,o,u,c){return it(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 it(l).updateQueueHook(e,t,n,r).then(function(e){return e(_,d)})}}},f.QueueHookServiceApi=st,f.QueueResourcesServiceApiAxiosParamCreator=ut,f.QueueResourcesServiceApiFp=ct,f.QueueResourcesServiceApiFactory=function(u,c,l){return{createQueueResourceGroup:function(e,t,n){return ct(u).createQueueResourceGroup(e,t,n).then(function(e){return e(l,c)})},deleteQueueResourceGroup:function(e,t,n,r){return ct(u).deleteQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})},readQueueResourceGroup:function(e,t,n,r){return ct(u).readQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})},searchQueueResourceGroup:function(e,t,n,r,i,a,s,o){return ct(u).searchQueueResourceGroup(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateQueueResourceGroup:function(e,t,n,r){return ct(u).updateQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})}}},f.QueueResourcesServiceApi=dt,f.QueueServiceApiAxiosParamCreator=ht,f.QueueServiceApiFp=pt,f.QueueServiceApiFactory=function(_,h,p){return{createQueue:function(e,t){return pt(_).createQueue(e,t).then(function(e){return e(p,h)})},deleteQueue:function(e,t,n){return pt(_).deleteQueue(e,t,n).then(function(e){return e(p,h)})},patchQueue:function(e,t,n){return pt(_).patchQueue(e,t,n).then(function(e){return e(p,h)})},readQueue:function(e,t,n){return pt(_).readQueue(e,t,n).then(function(e){return e(p,h)})},searchQueue:function(e,t,n,r,i,a,s,o){return pt(_).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 pt(_).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 pt(_).updateQueue(e,t,n).then(function(e){return e(p,h)})}}},f.QueueServiceApi=gt,f.QueueSkillServiceApiAxiosParamCreator=yt,f.QueueSkillServiceApiFp=bt,f.QueueSkillServiceApiFactory=function(p,f,g){return{createQueueSkill:function(e,t,n){return bt(p).createQueueSkill(e,t,n).then(function(e){return e(g,f)})},deleteQueueSkill:function(e,t,n){return bt(p).deleteQueueSkill(e,t,n).then(function(e){return e(g,f)})},patchQueueSkill:function(e,t,n,r){return bt(p).patchQueueSkill(e,t,n,r).then(function(e){return e(g,f)})},readQueueSkill:function(e,t,n){return bt(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 bt(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 bt(p).updateQueueSkill(e,t,n,r).then(function(e){return e(g,f)})}}},f.QueueSkillServiceApi=mt,f.RegionServiceApiAxiosParamCreator=At,f.RegionServiceApiFp=Ct,f.RegionServiceApiFactory=function(l,d,_){return{createRegion:function(e,t){return Ct(l).createRegion(e,t).then(function(e){return e(_,d)})},deleteRegion:function(e,t){return Ct(l).deleteRegion(e,t).then(function(e){return e(_,d)})},patchRegion:function(e,t,n){return Ct(l).patchRegion(e,t,n).then(function(e){return e(_,d)})},readRegion:function(e,t){return Ct(l).readRegion(e,t).then(function(e){return e(_,d)})},searchRegion:function(e,t,n,r,i,a,s,o,u,c){return Ct(l).searchRegion(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},updateRegion:function(e,t,n){return Ct(l).updateRegion(e,t,n).then(function(e){return e(_,d)})}}},f.RegionServiceApi=St,f.RoutingChatPlanServiceApiAxiosParamCreator=Pt,f.RoutingChatPlanServiceApiFp=Ot,f.RoutingChatPlanServiceApiFactory=function(c,l,d){return{createChatPlan:function(e,t){return Ot(c).createChatPlan(e,t).then(function(e){return e(d,l)})},deleteChatPlan:function(e,t){return Ot(c).deleteChatPlan(e,t).then(function(e){return e(d,l)})},patchChatPlan:function(e,t,n){return Ot(c).patchChatPlan(e,t,n).then(function(e){return e(d,l)})},readChatPlan:function(e,t){return Ot(c).readChatPlan(e,t).then(function(e){return e(d,l)})},searchChatPlan:function(e,t,n,r,i,a,s,o,u){return Ot(c).searchChatPlan(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateChatPlan:function(e,t,n){return Ot(c).updateChatPlan(e,t,n).then(function(e){return e(d,l)})}}},f.RoutingChatPlanServiceApi=kt,f.RoutingOutboundCallServiceApiAxiosParamCreator=Wt,f.RoutingOutboundCallServiceApiFp=Xt,f.RoutingOutboundCallServiceApiFactory=function(d,_,h){return{createRoutingOutboundCall:function(e,t){return Xt(d).createRoutingOutboundCall(e,t).then(function(e){return e(h,_)})},deleteRoutingOutboundCall:function(e,t,n){return Xt(d).deleteRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},movePositionRoutingOutboundCall:function(e,t,n,r){return Xt(d).movePositionRoutingOutboundCall(e,t,n,r).then(function(e){return e(h,_)})},patchRoutingOutboundCall:function(e,t,n){return Xt(d).patchRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},readRoutingOutboundCall:function(e,t,n){return Xt(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 Xt(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 Xt(d).updateRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})}}},f.RoutingOutboundCallServiceApi=Et,f.RoutingSchemaServiceApiAxiosParamCreator=jt,f.RoutingSchemaServiceApiFp=Ut,f.RoutingSchemaServiceApiFactory=function(l,d,_){return{createRoutingSchema:function(e,t){return Ut(l).createRoutingSchema(e,t).then(function(e){return e(_,d)})},deleteRoutingSchema:function(e,t,n){return Ut(l).deleteRoutingSchema(e,t,n).then(function(e){return e(_,d)})},patchRoutingSchema:function(e,t,n){return Ut(l).patchRoutingSchema(e,t,n).then(function(e){return e(_,d)})},readRoutingSchema:function(e,t,n){return Ut(l).readRoutingSchema(e,t,n).then(function(e){return e(_,d)})},searchRoutingSchema:function(e,t,n,r,i,a,s,o,u,c){return Ut(l).searchRoutingSchema(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},updateRoutingSchema:function(e,t,n){return Ut(l).updateRoutingSchema(e,t,n).then(function(e){return e(_,d)})}}},f.RoutingSchemaServiceApi=Bt,f.RoutingVariableServiceApiAxiosParamCreator=Ht,f.RoutingVariableServiceApiFp=Lt,f.RoutingVariableServiceApiFactory=function(i,a,s){return{createRoutingVariable:function(e,t){return Lt(i).createRoutingVariable(e,t).then(function(e){return e(s,a)})},deleteRoutingVariable:function(e,t,n){return Lt(i).deleteRoutingVariable(e,t,n).then(function(e){return e(s,a)})},readRoutingVariable:function(e,t,n){return Lt(i).readRoutingVariable(e,t,n).then(function(e){return e(s,a)})},searchRoutingVariable:function(e,t,n,r){return Lt(i).searchRoutingVariable(e,t,n,r).then(function(e){return e(s,a)})},updateRoutingVariable:function(e,t,n){return Lt(i).updateRoutingVariable(e,t,n).then(function(e){return e(s,a)})}}},f.RoutingVariableServiceApi=Ft,f.SkillServiceApiAxiosParamCreator=Jt,f.SkillServiceApiFp=zt,f.SkillServiceApiFactory=function(o,u,c){return{createSkill:function(e,t){return zt(o).createSkill(e,t).then(function(e){return e(c,u)})},deleteSkill:function(e,t,n){return zt(o).deleteSkill(e,t,n).then(function(e){return e(c,u)})},readSkill:function(e,t,n){return zt(o).readSkill(e,t,n).then(function(e){return e(c,u)})},searchSkill:function(e,t,n,r,i,a,s){return zt(o).searchSkill(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateSkill:function(e,t,n){return zt(o).updateSkill(e,t,n).then(function(e){return e(c,u)})}}},f.SkillServiceApi=$t,f.UserHelperServiceApiAxiosParamCreator=Zt,f.UserHelperServiceApiFp=en,f.UserHelperServiceApiFactory=function(n,r,i){return{defaultDeviceConfig:function(e,t){return en(n).defaultDeviceConfig(e,t).then(function(e){return e(i,r)})}}},f.UserHelperServiceApi=nn,f.Configuration=an,f.Client=er,f.Call=Tn,f.Agent=Pn,f.Conversation=Xn,f.DeviceNotFoundError=jn,f.DeviceNotAllowPermissionError=Bn,f.SipClient=ir,f.ExternalClient=pr,f.SipPhone=fn,f.Log=ln,Object.defineProperty(f,"__esModule",{value:!0})});
2
2
  //# sourceMappingURL=index.umd.min.js.map