webitel-sdk 0.1.147 → 0.1.148

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.
@@ -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(h,N,J,B,O,k){"use strict";B=B&&B.hasOwnProperty("default")?B.default:B;function e(e,t,n){void 0===n&&(n=B),this.basePath=t=void 0===t?M:t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}var I,M="https://dev.webitel.com/api".replace(/\/+$/,""),T=(I=Error,N.__extends(W,I),W);function W(e,t){t=I.call(this,t)||this;return t.field=e,t.name="RequiredError",t}function X(f){var e=this;return{createAgentPauseCause:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createAgentPauseCause.");return(t=J.parse("/call_center/pause_causes",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteAgentPauseCause:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),c),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},patchAgentPauseCause:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling patchAgentPauseCause.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling patchAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readAgentPauseCause:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),c),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},searchAgentPauseCause:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/pause_causes",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},updateAgentPauseCause:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateAgentPauseCause.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function l(c){return{createAgentPauseCause:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,X(c).createAgentPauseCause(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgentPauseCause:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,X(c).deleteAgentPauseCause(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchAgentPauseCause:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,X(c).patchAgentPauseCause(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgentPauseCause:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,X(c).readAgentPauseCause(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentPauseCause:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,X(c).searchAgentPauseCause(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentPauseCause:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,X(c).updateAgentPauseCause(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}x=e,N.__extends(Q,x),Q.prototype.createAgentPauseCause=function(e,t){var n=this;return l(this.configuration).createAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},Q.prototype.deleteAgentPauseCause=function(e,t){var n=this;return l(this.configuration).deleteAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},Q.prototype.patchAgentPauseCause=function(e,t,n){var r=this;return l(this.configuration).patchAgentPauseCause(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Q.prototype.readAgentPauseCause=function(e,t){var n=this;return l(this.configuration).readAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},Q.prototype.searchAgentPauseCause=function(e,t,n,r,i,a,s){var o=this;return l(this.configuration).searchAgentPauseCause(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Q.prototype.updateAgentPauseCause=function(e,t,n){var r=this;return l(this.configuration).updateAgentPauseCause(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var x,E=Q;function Q(){return null!==x&&x.apply(this,arguments)||this}function q(K){var e=this;return{agentSetState:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("agentId","Required parameter agentId was null or undefined when calling agentSetState.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling agentSetState.");return(t="/call_center/agents/{agent_id}/states/waiting".replace("{agent_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},agentStateHistory:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("agentId","Required parameter agentId was null or undefined when calling agentStateHistory.");return(t="/call_center/agents/{agent_id}/states/history".replace("{agent_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),f),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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.time_from=d),void 0!==_&&(a.time_to=_),void 0!==h&&(a.q=h),void 0!==p&&(a.domain_id=p),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),f.headers),[2,{url:J.format(t),options:r}]}})})},agentTodayStatistics:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("agentId","Required parameter agentId was null or undefined when calling agentTodayStatistics.");return(t="/call_center/agents/{agent_id}/statistics/today".replace("{agent_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"GET"},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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return c&&(a.fields=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},createAgent:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createAgent.");return(t=J.parse("/call_center/agents",!0),K&&(n=K.baseOptions),r=N.__assign(N.__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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteAgent:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},patchAgent:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling patchAgent.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling patchAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readAgent:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"GET"},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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},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={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/agents",!0),K&&(n=K.baseOptions),r=N.__assign(N.__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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.allow_channels=p),f&&(a.supervisor_id=f),g&&(a.team_id=g),v&&(a.region_id=v),y&&(a.auditor_id=y),void 0!==b&&(a.is_supervisor=b),w&&(a.skill_id=w),m&&(a.queue_id=m),void 0!==q&&(a.not_supervisor=q),A&&(a.user_id=A),C&&(a.extension=C),R&&(a.not_team_id=R),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),S.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),S.headers),[2,{url:J.format(t),options:r}]}})})},searchAgentCallStatistics:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/agents/reports/call",!0),K&&(n=K.baseOptions),r=N.__assign(N.__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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a["time.from"]=l),void 0!==d&&(a["time.to"]=d),_&&(a.agent_id=_),void 0!==h&&(a.domain_id=h),void 0!==p&&(a.q=p),f&&(a.fields=f),void 0!==g&&(a.sort=g),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),v.headers),[2,{url:J.format(t),options:r}]}})})},searchAgentInQueue:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling searchAgentInQueue.");return(t="/call_center/agents/{id}/queues".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},searchAgentInQueueStatistics:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("agentId","Required parameter agentId was null or undefined when calling searchAgentInQueueStatistics.");return(t="/call_center/agents/{agent_id}/statistics/queues".replace("{agent_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"GET"},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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchAgentInTeam:function(u,c,l,d,_,h){return void 0===h&&(h={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling searchAgentInTeam.");return(t="/call_center/agents/{id}/teams".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),h),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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.domain_id=_),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),h.headers),[2,{url:J.format(t),options:r}]}})})},searchAgentStateHistory:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/agents/states/history",!0),K&&(n=K.baseOptions),r=N.__assign(N.__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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a["joined_at.from"]=l),void 0!==d&&(a["joined_at.to"]=d),_&&(a.agent_id=_),void 0!==h&&(a.sort=h),void 0!==p&&(a.domain_id=p),void 0!==f&&(a.from_id=f),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),g.headers),[2,{url:J.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={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/agents/reports/status",!0),K&&(n=K.baseOptions),r=N.__assign(N.__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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.agent_id=h),void 0!==p&&(a["time.from"]=p),void 0!==f&&(a["time.to"]=f),g&&(a.status=g),v&&(a.queue_id=v),y&&(a.team_id=y),void 0!==b&&(a["utilization.from"]=b),void 0!==w&&(a["utilization.to"]=w),void 0!==m&&(a.has_call=m),q&&(a.skill_id=q),A&&(a.region_id=A),C&&(a.supervisor_id=C),R&&(a.auditor_id=R),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),S.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),S.headers),[2,{url:J.format(t),options:r}]}})})},searchAgentStatusStatisticItem:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("agentId","Required parameter agentId was null or undefined when calling searchAgentStatusStatisticItem.");return(t="/call_center/agents/reports/status/{agent_id}".replace("{agent_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a["time.from"]=c),void 0!==l&&(a["time.to"]=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},searchLookupUsersAgentNotExists:function(u,c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/lookups/agents/users",!0),K&&(n=K.baseOptions),r=N.__assign(N.__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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.domain_id=d),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),[2,{url:J.format(t),options:r}]}})})},searchPauseCauseForAgent:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("agentId","Required parameter agentId was null or undefined when calling searchPauseCauseForAgent.");return(t="/call_center/agents/{agent_id}/pause_causes".replace("{agent_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"GET"},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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.allow_change=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},updateAgent:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateAgent.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},updateAgentStatus:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateAgentStatus.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateAgentStatus.");return(t="/call_center/agents/{id}/status".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function A(m){return{agentSetState:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).agentSetState(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentStateHistory:function(t,r,i,a,s,o,u,c){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).agentStateHistory(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentTodayStatistics:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).agentTodayStatistics(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createAgent:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).createAgent(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgent:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).deleteAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchAgent:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).patchAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgent:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).readAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgent:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgent(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentCallStatistics:function(t,r,i,a,s,o,u,c,l,d){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentCallStatistics(t,r,i,a,s,o,u,c,l,d)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentInQueue:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentInQueue(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentInQueueStatistics:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentInQueueStatistics(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentInTeam:function(t,r,i,a,s,o){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentInTeam(t,r,i,a,s,o)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentStateHistory:function(t,r,i,a,s,o,u,c,l){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentStateHistory(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentStatusStatistic:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentStatusStatistic(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentStatusStatisticItem:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentStatusStatisticItem(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchLookupUsersAgentNotExists:function(t,r,i,a,s){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchLookupUsersAgentNotExists(t,r,i,a,s)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchPauseCauseForAgent:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchPauseCauseForAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgent:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).updateAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentStatus:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).updateAgentStatus(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}j=e,N.__extends(t,j),t.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)})},t.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)})},t.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)})},t.prototype.createAgent=function(e,t){var n=this;return A(this.configuration).createAgent(e,t).then(function(e){return e(n.axios,n.basePath)})},t.prototype.deleteAgent=function(e,t,n){var r=this;return A(this.configuration).deleteAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.patchAgent=function(e,t,n){var r=this;return A(this.configuration).patchAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.readAgent=function(e,t,n){var r=this;return A(this.configuration).readAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.searchAgent=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y){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)})},t.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)})},t.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)})},t.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)})},t.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)})},t.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)})},t.prototype.searchAgentStatusStatistic=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y){var b=this;return 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)})},t.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)})},t.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)})},t.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)})},t.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)})},t.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)})};var j,U=t;function t(){return null!==j&&j.apply(this,arguments)||this}function G(g){var e=this;return{createAgentSkill:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("agentId","Required parameter agentId was null or undefined when calling createAgentSkill.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling createAgentSkill.");return(t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteAgentSkill:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("agentId","Required parameter agentId was null or undefined when calling deleteAgentSkill.");if(null==c)throw new T("id","Required parameter id was null or undefined when calling deleteAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},patchAgentSkill:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("agentId","Required parameter agentId was null or undefined when calling patchAgentSkill.");if(null==l)throw new T("id","Required parameter id was null or undefined when calling patchAgentSkill.");if(null==d)throw new T("body","Required parameter body was null or undefined when calling patchAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})},readAgentSkill:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("agentId","Required parameter agentId was null or undefined when calling readAgentSkill.");if(null==c)throw new T("id","Required parameter id was null or undefined when calling readAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},searchAgentSkill:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("agentId","Required parameter agentId was null or undefined when calling searchAgentSkill.");return(t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),f.headers),[2,{url:J.format(t),options:r}]}})})},searchLookupAgentNotExistsSkill:function(u,c,l,d,_,h){return void 0===h&&(h={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("agentId","Required parameter agentId was null or undefined when calling searchLookupAgentNotExistsSkill.");return(t="/call_center/lookups/agents/skills/{agent_id}".replace("{agent_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),h),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.domain_id=_),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),h.headers),[2,{url:J.format(t),options:r}]}})})},updateAgentSkill:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("agentId","Required parameter agentId was null or undefined when calling updateAgentSkill.");if(null==l)throw new T("id","Required parameter id was null or undefined when calling updateAgentSkill.");if(null==d)throw new T("body","Required parameter body was null or undefined when calling updateAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function d(l){return{createAgentSkill:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,G(l).createAgentSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgentSkill:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,G(l).deleteAgentSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchAgentSkill:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,G(l).patchAgentSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgentSkill:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,G(l).readAgentSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentSkill:function(t,r,i,a,s,o,u,c){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,G(l).searchAgentSkill(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchLookupAgentNotExistsSkill:function(t,r,i,a,s,o){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,G(l).searchLookupAgentNotExistsSkill(t,r,i,a,s,o)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentSkill:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,G(l).updateAgentSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}D=e,N.__extends(z,D),z.prototype.createAgentSkill=function(e,t,n){var r=this;return d(this.configuration).createAgentSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},z.prototype.deleteAgentSkill=function(e,t,n,r){var i=this;return d(this.configuration).deleteAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},z.prototype.patchAgentSkill=function(e,t,n,r){var i=this;return d(this.configuration).patchAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},z.prototype.readAgentSkill=function(e,t,n,r){var i=this;return d(this.configuration).readAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},z.prototype.searchAgentSkill=function(e,t,n,r,i,a,s,o){var u=this;return d(this.configuration).searchAgentSkill(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},z.prototype.searchLookupAgentNotExistsSkill=function(e,t,n,r,i,a){var s=this;return d(this.configuration).searchLookupAgentNotExistsSkill(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},z.prototype.updateAgentSkill=function(e,t,n,r){var i=this;return d(this.configuration).updateAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var D,F=z;function z(){return null!==D&&D.apply(this,arguments)||this}function V(v){var e=this;return{createAgentTeam:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createAgentTeam.");return(t=J.parse("/call_center/teams",!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteAgentTeam:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteAgentTeam.");return(t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readAgentTeam:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readAgentTeam.");return(t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchAgentTeam:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/teams",!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.strategy=p),f&&(a.admin_id=f),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),g.headers),[2,{url:J.format(t),options:r}]}})})},updateAgentTeam:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateAgentTeam.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateAgentTeam.");return(t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function $(d){return{createAgentTeam:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,V(d).createAgentTeam(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgentTeam:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,V(d).deleteAgentTeam(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgentTeam:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,V(d).readAgentTeam(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentTeam:function(t,r,i,a,s,o,u,c,l){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,V(d).searchAgentTeam(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentTeam:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,V(d).updateAgentTeam(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Y=e,N.__extends(ee,Y),ee.prototype.createAgentTeam=function(e,t){var n=this;return $(this.configuration).createAgentTeam(e,t).then(function(e){return e(n.axios,n.basePath)})},ee.prototype.deleteAgentTeam=function(e,t,n){var r=this;return $(this.configuration).deleteAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ee.prototype.readAgentTeam=function(e,t,n){var r=this;return $(this.configuration).readAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ee.prototype.searchAgentTeam=function(e,t,n,r,i,a,s,o,u){var c=this;return $(this.configuration).searchAgentTeam(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},ee.prototype.updateAgentTeam=function(e,t,n){var r=this;return $(this.configuration).updateAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Y,Z=ee;function ee(){return null!==Y&&Y.apply(this,arguments)||this}function te(f){var e=this;return{createBackendProfile:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createBackendProfile.");return(t=J.parse("/storage/backend_profiles",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteBackendProfile:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},patchBackendProfile:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling patchBackendProfile.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling patchBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readBackendProfile:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchBackendProfile:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/storage/backend_profiles",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},updateBackendProfile:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateBackendProfile.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function _(c){return{createBackendProfile:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,te(c).createBackendProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteBackendProfile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,te(c).deleteBackendProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchBackendProfile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,te(c).patchBackendProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readBackendProfile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,te(c).readBackendProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchBackendProfile:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,te(c).searchBackendProfile(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateBackendProfile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,te(c).updateBackendProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ne=e,N.__extends(ie,ne),ie.prototype.createBackendProfile=function(e,t){var n=this;return _(this.configuration).createBackendProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ie.prototype.deleteBackendProfile=function(e,t,n){var r=this;return _(this.configuration).deleteBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ie.prototype.patchBackendProfile=function(e,t,n){var r=this;return _(this.configuration).patchBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ie.prototype.readBackendProfile=function(e,t,n){var r=this;return _(this.configuration).readBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ie.prototype.searchBackendProfile=function(e,t,n,r,i,a,s){var o=this;return _(this.configuration).searchBackendProfile(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},ie.prototype.updateBackendProfile=function(e,t,n){var r=this;return _(this.configuration).updateBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var ne,re=ie;function ie(){return null!==ne&&ne.apply(this,arguments)||this}function ae(f){var e=this;return{createBucket:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createBucket.");return(t=J.parse("/call_center/buckets",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteBucket:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteBucket.");return(t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readBucket:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readBucket.");return(t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchBucket:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/buckets",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},updateBucket:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateBucket.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateBucket.");return(t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function se(c){return{createBucket:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ae(c).createBucket(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteBucket:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ae(c).deleteBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readBucket:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ae(c).readBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchBucket:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ae(c).searchBucket(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateBucket:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ae(c).updateBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}oe=e,N.__extends(ce,oe),ce.prototype.createBucket=function(e,t){var n=this;return se(this.configuration).createBucket(e,t).then(function(e){return e(n.axios,n.basePath)})},ce.prototype.deleteBucket=function(e,t,n){var r=this;return se(this.configuration).deleteBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ce.prototype.readBucket=function(e,t,n){var r=this;return se(this.configuration).readBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ce.prototype.searchBucket=function(e,t,n,r,i,a,s){var o=this;return se(this.configuration).searchBucket(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},ce.prototype.updateBucket=function(e,t,n){var r=this;return se(this.configuration).updateBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var oe,ue=ce;function ce(){return null!==oe&&oe.apply(this,arguments)||this}function le(f){var e=this;return{createCalendar:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createCalendar.");return(t=J.parse("/calendars",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteCalendar:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteCalendar.");return(t="/calendars/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readCalendar:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readCalendar.");return(t="/calendars/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchCalendar:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/calendars",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},searchTimezones:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/calendars/timezones",!0),f&&(n=f.baseOptions),r=N.__assign(N.__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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},updateCalendar:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateCalendar.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateCalendar.");return(t="/calendars/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function p(c){return{createCalendar:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,le(c).createCalendar(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCalendar:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,le(c).deleteCalendar(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCalendar:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,le(c).readCalendar(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchCalendar:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,le(c).searchCalendar(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchTimezones:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,le(c).searchTimezones(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCalendar:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,le(c).updateCalendar(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}de=e,N.__extends(he,de),he.prototype.createCalendar=function(e,t){var n=this;return p(this.configuration).createCalendar(e,t).then(function(e){return e(n.axios,n.basePath)})},he.prototype.deleteCalendar=function(e,t,n){var r=this;return p(this.configuration).deleteCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})},he.prototype.readCalendar=function(e,t,n){var r=this;return p(this.configuration).readCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})},he.prototype.searchCalendar=function(e,t,n,r,i,a,s){var o=this;return p(this.configuration).searchCalendar(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},he.prototype.searchTimezones=function(e,t,n,r){var i=this;return p(this.configuration).searchTimezones(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},he.prototype.updateCalendar=function(e,t,n){var r=this;return p(this.configuration).updateCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var de,_e=he;function he(){return null!==de&&de.apply(this,arguments)||this}function H(F){var e=this;return{aggregateHistoryCall:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling aggregateHistoryCall.");return(t=J.parse("/calls/history/aggregate",!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},blindTransferCall:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling blindTransferCall.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling blindTransferCall.");return(t="/calls/active/{id}/transfer".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},confirmPush:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling confirmPush.");return(t="/calls/active/{id}/confirm_push".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),c),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},createCall:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createCall.");return(t=J.parse("/calls",!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},createCallAnnotation:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("callId","Required parameter callId was null or undefined when calling createCallAnnotation.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling createCallAnnotation.");return(t="/calls/history/{call_id}/annotation".replace("{call_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteCallAnnotation:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("callId","Required parameter callId was null or undefined when calling deleteCallAnnotation.");if(null==c)throw new T("id","Required parameter id was null or undefined when calling deleteCallAnnotation.");return(t="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},dtmfCall:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling dtmfCall.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling dtmfCall.");return(t="/calls/active/{id}/dtmf".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},eavesdropCall:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling eavesdropCall.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling eavesdropCall.");return(t="/calls/active/{id}/eavesdrop".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},hangupCall:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling hangupCall.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling hangupCall.");return(t="/calls/active/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),d),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},holdCall:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling holdCall.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling holdCall.");return(t="/calls/active/{id}/hold".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readCall:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readCall.");return(t="/calls/active/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchActiveCall:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,T,k,I,W,X,x,E,Q){return void 0===Q&&(Q={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/calls/active",!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),Q),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),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=N.__assign(N.__assign(N.__assign({},t.query),a),Q.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),Q.headers),[2,{url:J.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,L,D,H){return void 0===H&&(H={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/calls/history",!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),H),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),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),void 0!==L&&(a.has_transcript=L),void 0!==D&&(a.agent_description=D),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),H.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),H.headers),[2,{url:J.format(t),options:r}]}})})},unHoldCall:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling unHoldCall.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling unHoldCall.");return(t="/calls/active/{id}/unhold".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},updateCallAnnotation:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("callId","Required parameter callId was null or undefined when calling updateCallAnnotation.");if(null==l)throw new T("id","Required parameter id was null or undefined when calling updateCallAnnotation.");if(null==d)throw new T("body","Required parameter body was null or undefined when calling updateCallAnnotation.");return(t="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function L(G){return{aggregateHistoryCall:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).aggregateHistoryCall(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},blindTransferCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).blindTransferCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},confirmPush:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).confirmPush(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createCall:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).createCall(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createCallAnnotation:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).createCallAnnotation(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCallAnnotation:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).deleteCallAnnotation(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},dtmfCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).dtmfCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},eavesdropCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).eavesdropCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},hangupCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).hangupCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},holdCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).holdCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).readCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchActiveCall:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,T,k){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).searchActiveCall(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,T,k)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchHistoryCall:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,T,k,I,W,X,x,E,Q,j,U){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).searchHistoryCall(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,T,k,I,W,X,x,E,Q,j,U)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},unHoldCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).unHoldCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCallAnnotation:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).updateCallAnnotation(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}pe=e,N.__extends(n,pe),n.prototype.aggregateHistoryCall=function(e,t){var n=this;return L(this.configuration).aggregateHistoryCall(e,t).then(function(e){return e(n.axios,n.basePath)})},n.prototype.blindTransferCall=function(e,t,n){var r=this;return L(this.configuration).blindTransferCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.confirmPush=function(e,t){var n=this;return L(this.configuration).confirmPush(e,t).then(function(e){return e(n.axios,n.basePath)})},n.prototype.createCall=function(e,t){var n=this;return L(this.configuration).createCall(e,t).then(function(e){return e(n.axios,n.basePath)})},n.prototype.createCallAnnotation=function(e,t,n){var r=this;return L(this.configuration).createCallAnnotation(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.deleteCallAnnotation=function(e,t,n){var r=this;return L(this.configuration).deleteCallAnnotation(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.dtmfCall=function(e,t,n){var r=this;return L(this.configuration).dtmfCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.eavesdropCall=function(e,t,n){var r=this;return L(this.configuration).eavesdropCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.hangupCall=function(e,t,n){var r=this;return L(this.configuration).hangupCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.holdCall=function(e,t,n){var r=this;return L(this.configuration).holdCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.readCall=function(e,t,n){var r=this;return L(this.configuration).readCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.searchActiveCall=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O){var T=this;return L(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)})},n.prototype.searchHistoryCall=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,O,T,k,I,W,X,E,Q,j){var x=this;return L(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,E,Q,j).then(function(e){return e(x.axios,x.basePath)})},n.prototype.unHoldCall=function(e,t,n){var r=this;return L(this.configuration).unHoldCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.updateCallAnnotation=function(e,t,n,r){var i=this;return L(this.configuration).updateCallAnnotation(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var pe,fe=n;function n(){return null!==pe&&pe.apply(this,arguments)||this}function ge(v){var e=this;return{createCognitiveProfile:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createCognitiveProfile.");return(t=J.parse("/storage/cognitive_profiles",!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteCognitiveProfile:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),c),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},patchCognitiveProfile:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling patchCognitiveProfile.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling patchCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readCognitiveProfile:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),c),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},searchCognitiveProfile:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/storage/cognitive_profiles",!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.service=p),void 0!==f&&(a.enabled=f),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),g.headers),[2,{url:J.format(t),options:r}]}})})},updateCognitiveProfile:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateCognitiveProfile.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function f(d){return{createCognitiveProfile:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ge(d).createCognitiveProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCognitiveProfile:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ge(d).deleteCognitiveProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchCognitiveProfile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ge(d).patchCognitiveProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCognitiveProfile:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ge(d).readCognitiveProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchCognitiveProfile:function(t,r,i,a,s,o,u,c,l){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ge(d).searchCognitiveProfile(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCognitiveProfile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ge(d).updateCognitiveProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ve=e,N.__extends(be,ve),be.prototype.createCognitiveProfile=function(e,t){var n=this;return f(this.configuration).createCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},be.prototype.deleteCognitiveProfile=function(e,t){var n=this;return f(this.configuration).deleteCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},be.prototype.patchCognitiveProfile=function(e,t,n){var r=this;return f(this.configuration).patchCognitiveProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},be.prototype.readCognitiveProfile=function(e,t){var n=this;return f(this.configuration).readCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},be.prototype.searchCognitiveProfile=function(e,t,n,r,i,a,s,o,u){var c=this;return f(this.configuration).searchCognitiveProfile(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},be.prototype.updateCognitiveProfile=function(e,t,n){var r=this;return f(this.configuration).updateCognitiveProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var ve,ye=be;function be(){return null!==ve&&ve.apply(this,arguments)||this}function we(f){var e=this;return{createCommunicationType:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createCommunicationType.");return(t=J.parse("/call_center/communication_type",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteCommunicationType:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteCommunicationType.");return(t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readCommunicationType:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readCommunicationType.");return(t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchCommunicationType:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/communication_type",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},updateCommunicationType:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateCommunicationType.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateCommunicationType.");return(t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function me(c){return{createCommunicationType:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,we(c).createCommunicationType(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCommunicationType:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,we(c).deleteCommunicationType(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCommunicationType:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,we(c).readCommunicationType(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchCommunicationType:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,we(c).searchCommunicationType(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCommunicationType:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,we(c).updateCommunicationType(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}qe=e,N.__extends(Ce,qe),Ce.prototype.createCommunicationType=function(e,t){var n=this;return me(this.configuration).createCommunicationType(e,t).then(function(e){return e(n.axios,n.basePath)})},Ce.prototype.deleteCommunicationType=function(e,t,n){var r=this;return me(this.configuration).deleteCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ce.prototype.readCommunicationType=function(e,t,n){var r=this;return me(this.configuration).readCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ce.prototype.searchCommunicationType=function(e,t,n,r,i,a,s){var o=this;return me(this.configuration).searchCommunicationType(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Ce.prototype.updateCommunicationType=function(e,t,n){var r=this;return me(this.configuration).updateCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var qe,Ae=Ce;function Ce(){return null!==qe&&qe.apply(this,arguments)||this}function Re(p){var e=this;return{createEmailProfile:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createEmailProfile.");return(t=J.parse("/email/profile",!0),p&&(n=p.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteEmailProfile:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),p&&(n=p.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),c),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},patchEmailProfile:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling patchEmailProfile.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling patchEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),p&&(n=p.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readEmailProfile:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),p&&(n=p.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),c),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},searchEmailProfile:function(u,c,l,d,_,h){return void 0===h&&(h={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/email/profile",!0),p&&(n=p.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),h),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),h.headers),[2,{url:J.format(t),options:r}]}})})},updateEmailProfile:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateEmailProfile.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),p&&(n=p.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function c(u){return{createEmailProfile:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).createEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteEmailProfile:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).deleteEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchEmailProfile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).patchEmailProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readEmailProfile:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).readEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchEmailProfile:function(t,r,i,a,s,o){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).searchEmailProfile(t,r,i,a,s,o)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateEmailProfile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).updateEmailProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Se=e,N.__extends(Pe,Se),Pe.prototype.createEmailProfile=function(e,t){var n=this;return c(this.configuration).createEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},Pe.prototype.deleteEmailProfile=function(e,t){var n=this;return c(this.configuration).deleteEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},Pe.prototype.patchEmailProfile=function(e,t,n){var r=this;return c(this.configuration).patchEmailProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Pe.prototype.readEmailProfile=function(e,t){var n=this;return c(this.configuration).readEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},Pe.prototype.searchEmailProfile=function(e,t,n,r,i,a){var s=this;return c(this.configuration).searchEmailProfile(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},Pe.prototype.updateEmailProfile=function(e,t,n){var r=this;return c(this.configuration).updateEmailProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Se,Ke=Pe;function Pe(){return null!==Se&&Se.apply(this,arguments)||this}function Oe(d){var e=this;return{deleteFiles:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling deleteFiles.");return(t=J.parse("/storage/file",!0),d&&(n=d.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},d&&d.apiKey)?"function"!=typeof d.apiKey?[3,2]:[4,d.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,d.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})}}}function Te(i){return{deleteFiles:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Oe(i).deleteFiles(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ke=e,N.__extends(We,ke),We.prototype.deleteFiles=function(e,t){var n=this;return Te(this.configuration).deleteFiles(e,t).then(function(e){return e(n.axios,n.basePath)})};var ke,Ie=We;function We(){return null!==ke&&ke.apply(this,arguments)||this}function Xe(_){var e=this;return{createFileTranscript:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createFileTranscript.");return(t=J.parse("/storage/transcript_file",!0),_&&(n=_.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteFileTranscript:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling deleteFileTranscript.");return(t=J.parse("/storage/transcript_file",!0),_&&(n=_.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},getFileTranscriptPhrases:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling getFileTranscriptPhrases.");return(t="/storage/transcript_file/{id}/phrases".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),_&&(n=_.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})}}}function xe(s){return{createFileTranscript:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Xe(s).createFileTranscript(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteFileTranscript:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Xe(s).deleteFileTranscript(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},getFileTranscriptPhrases:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Xe(s).getFileTranscriptPhrases(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Ee=e,N.__extends(je,Ee),je.prototype.createFileTranscript=function(e,t){var n=this;return xe(this.configuration).createFileTranscript(e,t).then(function(e){return e(n.axios,n.basePath)})},je.prototype.deleteFileTranscript=function(e,t){var n=this;return xe(this.configuration).deleteFileTranscript(e,t).then(function(e){return e(n.axios,n.basePath)})},je.prototype.getFileTranscriptPhrases=function(e,t,n,r){var i=this;return xe(this.configuration).getFileTranscriptPhrases(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var Ee,Qe=je;function je(){return null!==Ee&&Ee.apply(this,arguments)||this}function Ue(f){var e=this;return{createImportTemplate:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createImportTemplate.");return(t=J.parse("/storage/import_templates",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteImportTemplate:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),c),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},patchImportTemplate:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling patchImportTemplate.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling patchImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readImportTemplate:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),c),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},searchImportTemplate:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/storage/import_templates",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},updateImportTemplate:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateImportTemplate.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function g(c){return{createImportTemplate:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(c).createImportTemplate(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteImportTemplate:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(c).deleteImportTemplate(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchImportTemplate:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(c).patchImportTemplate(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readImportTemplate:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(c).readImportTemplate(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchImportTemplate:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(c).searchImportTemplate(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateImportTemplate:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(c).updateImportTemplate(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Ge=e,N.__extends(Me,Ge),Me.prototype.createImportTemplate=function(e,t){var n=this;return g(this.configuration).createImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},Me.prototype.deleteImportTemplate=function(e,t){var n=this;return g(this.configuration).deleteImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},Me.prototype.patchImportTemplate=function(e,t,n){var r=this;return g(this.configuration).patchImportTemplate(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Me.prototype.readImportTemplate=function(e,t){var n=this;return g(this.configuration).readImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},Me.prototype.searchImportTemplate=function(e,t,n,r,i,a,s){var o=this;return g(this.configuration).searchImportTemplate(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Me.prototype.updateImportTemplate=function(e,t,n){var r=this;return g(this.configuration).updateImportTemplate(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Ge,Be=Me;function Me(){return null!==Ge&&Ge.apply(this,arguments)||this}function He(g){var e=this;return{createList:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createList.");return(t=J.parse("/call_center/list",!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},createListCommunication:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("listId","Required parameter listId was null or undefined when calling createListCommunication.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling createListCommunication.");return(t="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteList:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteList.");return(t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},deleteListCommunication:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("listId","Required parameter listId was null or undefined when calling deleteListCommunication.");if(null==c)throw new T("id","Required parameter id was null or undefined when calling deleteListCommunication.");return(t="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},readList:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readList.");return(t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readListCommunication:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("listId","Required parameter listId was null or undefined when calling readListCommunication.");if(null==c)throw new T("id","Required parameter id was null or undefined when calling readListCommunication.");return(t="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},searchList:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/list",!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},searchListCommunication:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("listId","Required parameter listId was null or undefined when calling searchListCommunication.");return(t="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),f.headers),[2,{url:J.format(t),options:r}]}})})},updateList:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateList.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateList.");return(t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},updateListCommunication:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("listId","Required parameter listId was null or undefined when calling updateListCommunication.");if(null==l)throw new T("id","Required parameter id was null or undefined when calling updateListCommunication.");if(null==d)throw new T("body","Required parameter body was null or undefined when calling updateListCommunication.");return(t="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function v(l){return{createList:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).createList(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createListCommunication:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).createListCommunication(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteList:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).deleteList(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteListCommunication:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).deleteListCommunication(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readList:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).readList(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readListCommunication:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).readListCommunication(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchList:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).searchList(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchListCommunication:function(t,r,i,a,s,o,u,c){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).searchListCommunication(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateList:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).updateList(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateListCommunication:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).updateListCommunication(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Le=e,N.__extends(Fe,Le),Fe.prototype.createList=function(e,t){var n=this;return v(this.configuration).createList(e,t).then(function(e){return e(n.axios,n.basePath)})},Fe.prototype.createListCommunication=function(e,t,n){var r=this;return v(this.configuration).createListCommunication(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Fe.prototype.deleteList=function(e,t,n){var r=this;return v(this.configuration).deleteList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Fe.prototype.deleteListCommunication=function(e,t,n,r){var i=this;return v(this.configuration).deleteListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Fe.prototype.readList=function(e,t,n){var r=this;return v(this.configuration).readList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Fe.prototype.readListCommunication=function(e,t,n,r){var i=this;return v(this.configuration).readListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Fe.prototype.searchList=function(e,t,n,r,i,a,s){var o=this;return v(this.configuration).searchList(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Fe.prototype.searchListCommunication=function(e,t,n,r,i,a,s,o){var u=this;return v(this.configuration).searchListCommunication(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},Fe.prototype.updateList=function(e,t,n){var r=this;return v(this.configuration).updateList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Fe.prototype.updateListCommunication=function(e,t,n,r){var i=this;return v(this.configuration).updateListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var Le,De=Fe;function Fe(){return null!==Le&&Le.apply(this,arguments)||this}function Ne(f){var e=this;return{deleteMediaFile:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteMediaFile.");return(t="/storage/media/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readMediaFile:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readMediaFile.");return(t="/storage/media/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchMediaFile:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/storage/media",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})}}}function Je(c){return{deleteMediaFile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(c).deleteMediaFile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readMediaFile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(c).readMediaFile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchMediaFile:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(c).searchMediaFile(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ze=e,N.__extends($e,ze),$e.prototype.deleteMediaFile=function(e,t,n){var r=this;return Je(this.configuration).deleteMediaFile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},$e.prototype.readMediaFile=function(e,t,n){var r=this;return Je(this.configuration).readMediaFile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},$e.prototype.searchMediaFile=function(e,t,n,r,i,a,s){var o=this;return Je(this.configuration).searchMediaFile(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})};var ze,Ve=$e;function $e(){return null!==ze&&ze.apply(this,arguments)||this}function C(O){var e=this;return{attemptCallback:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("attemptId","Required parameter attemptId was null or undefined when calling attemptCallback.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling attemptCallback.");return(t="/call_center/attempts/{attempt_id}".replace("{attempt_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),O&&(n=O.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},O&&O.apiKey)?"function"!=typeof O.apiKey?[3,2]:[4,O.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,O.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},attemptResult:function(c,l,d,_,h){return void 0===h&&(h={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("queueId","Required parameter queueId was null or undefined when calling attemptResult.");if(null==l)throw new T("memberId","Required parameter memberId was null or undefined when calling attemptResult.");if(null==d)throw new T("attemptId","Required parameter attemptId was null or undefined when calling attemptResult.");if(null==_)throw new T("body","Required parameter body was null or undefined when calling attemptResult.");return(t="/call_center/queues/{queue_id}/members/{member_id}/attempts/{attempt_id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{member_id}",encodeURIComponent(String(l))).replace("{attempt_id}",encodeURIComponent(String(d))),t=J.parse(t,!0),O&&(n=O.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),h),i={},a={},O&&O.apiKey)?"function"!=typeof O.apiKey?[3,2]:[4,O.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,O.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),h.headers),u="string"!=typeof _||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:J.format(t),options:r}]}})})},attemptsRenewalResult:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("attemptId","Required parameter attemptId was null or undefined when calling attemptsRenewalResult.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling attemptsRenewalResult.");return(t="/call_center/queues/attempts/{attempt_id}/renewal".replace("{attempt_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),O&&(n=O.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},O&&O.apiKey)?"function"!=typeof O.apiKey?[3,2]:[4,O.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,O.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},createAttempt:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("queueId","Required parameter queueId was null or undefined when calling createAttempt.");if(null==l)throw new T("memberId","Required parameter memberId was null or undefined when calling createAttempt.");if(null==d)throw new T("body","Required parameter body was null or undefined when calling createAttempt.");return(t="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(c))).replace("{member_id}",encodeURIComponent(String(l))),t=J.parse(t,!0),O&&(n=O.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),_),i={},a={},O&&O.apiKey)?"function"!=typeof O.apiKey?[3,2]:[4,O.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,O.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})},createMember:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("queueId","Required parameter queueId was null or undefined when calling createMember.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling createMember.");return(t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),O&&(n=O.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},O&&O.apiKey)?"function"!=typeof O.apiKey?[3,2]:[4,O.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,O.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},createMemberBulk:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("queueId","Required parameter queueId was null or undefined when calling createMemberBulk.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling createMemberBulk.");return(t="/call_center/queues/{queue_id}/members/bulk".replace("{queue_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),O&&(n=O.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},O&&O.apiKey)?"function"!=typeof O.apiKey?[3,2]:[4,O.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,O.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteMember:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("queueId","Required parameter queueId was null or undefined when calling deleteMember.");if(null==c)throw new T("id","Required parameter id was null or undefined when calling deleteMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),O&&(n=O.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),d),i={},a={},O&&O.apiKey)?"function"!=typeof O.apiKey?[3,2]:[4,O.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,O.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},deleteMembers:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("queueId","Required parameter queueId was null or undefined when calling deleteMembers.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling deleteMembers.");return(t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),O&&(n=O.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),d),i={},a={},O&&O.apiKey)?"function"!=typeof O.apiKey?[3,2]:[4,O.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,O.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},patchMember:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("queueId","Required parameter queueId was null or undefined when calling patchMember.");if(null==l)throw new T("id","Required parameter id was null or undefined when calling patchMember.");if(null==d)throw new T("body","Required parameter body was null or undefined when calling patchMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),O&&(n=O.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),_),i={},a={},O&&O.apiKey)?"function"!=typeof O.apiKey?[3,2]:[4,O.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,O.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})},readMember:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("queueId","Required parameter queueId was null or undefined when calling readMember.");if(null==c)throw new T("id","Required parameter id was null or undefined when calling readMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),O&&(n=O.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),i={},a={},O&&O.apiKey)?"function"!=typeof O.apiKey?[3,2]:[4,O.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,O.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},resetMembers:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("queueId","Required parameter queueId was null or undefined when calling resetMembers.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling resetMembers.");return(t="/call_center/queues/{queue_id}/members/reset".replace("{queue_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),O&&(n=O.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},O&&O.apiKey)?"function"!=typeof O.apiKey?[3,2]:[4,O.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,O.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},searchAttempts:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K){return void 0===K&&(K={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/queues/attempts/active",!0),O&&(n=O.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),K),i={},a={},O&&O.apiKey)?"function"!=typeof O.apiKey?[3,2]:[4,O.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,O.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),void 0!==h&&(a["joined_at.from"]=h),void 0!==p&&(a["joined_at.to"]=p),f&&(a.id=f),g&&(a.queue_id=g),v&&(a.bucket_id=v),y&&(a.member_id=y),b&&(a.agent_id=b),w&&(a.result=w),void 0!==m&&(a["leaving_at.from"]=m),void 0!==q&&(a["leaving_at.to"]=q),void 0!==A&&(a["offering_at.from"]=A),void 0!==C&&(a["offering_at.to"]=C),void 0!==R&&(a["duration.from"]=R),void 0!==S&&(a["duration.to"]=S),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),K.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),K.headers),[2,{url:J.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={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/queues/attempts/history",!0),O&&(n=O.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),K),i={},a={},O&&O.apiKey)?"function"!=typeof O.apiKey?[3,2]:[4,O.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,O.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),void 0!==h&&(a["joined_at.from"]=h),void 0!==p&&(a["joined_at.to"]=p),f&&(a.id=f),g&&(a.queue_id=g),v&&(a.bucket_id=v),y&&(a.member_id=y),b&&(a.agent_id=b),w&&(a.result=w),void 0!==m&&(a["leaving_at.from"]=m),void 0!==q&&(a["leaving_at.to"]=q),void 0!==A&&(a["offering_at.from"]=A),void 0!==C&&(a["offering_at.to"]=C),void 0!==R&&(a["duration.from"]=R),void 0!==S&&(a["duration.to"]=S),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),K.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),K.headers),[2,{url:J.format(t),options:r}]}})})},searchMemberAttempts:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("queueId","Required parameter queueId was null or undefined when calling searchMemberAttempts.");if(null==c)throw new T("memberId","Required parameter memberId was null or undefined when calling searchMemberAttempts.");return(t="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(u))).replace("{member_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),O&&(n=O.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),i={},a={},O&&O.apiKey)?"function"!=typeof O.apiKey?[3,2]:[4,O.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,O.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},searchMemberInQueue:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P){return void 0===P&&(P={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("queueId","Required parameter queueId was null or undefined when calling searchMemberInQueue.");return(t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),O&&(n=O.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),P),i={},a={},O&&O.apiKey)?"function"!=typeof O.apiKey?[3,2]:[4,O.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,O.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),f&&(a.bucket_id=f),void 0!==g&&(a.destination=g),void 0!==v&&(a["created_at.from"]=v),void 0!==y&&(a["created_at.to"]=y),void 0!==b&&(a["offering_at.from"]=b),void 0!==w&&(a["offering_at.to"]=w),m&&(a.stop_cause=m),void 0!==q&&(a["priority.from"]=q),void 0!==A&&(a["priority.to"]=A),void 0!==C&&(a.name=C),void 0!==R&&(a["attempts.from"]=R),void 0!==S&&(a["attempts.to"]=S),K&&(a.agent_id=K),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),P.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),P.headers),[2,{url:J.format(t),options:r}]}})})},searchMembers:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P){return void 0===P&&(P={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/members",!0),O&&(n=O.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),P),i={},a={},O&&O.apiKey)?"function"!=typeof O.apiKey?[3,2]:[4,O.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,O.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.queue_id=p),f&&(a.bucket_id=f),void 0!==g&&(a.destination=g),void 0!==v&&(a["created_at.from"]=v),void 0!==y&&(a["created_at.to"]=y),void 0!==b&&(a["offering_at.from"]=b),void 0!==w&&(a["offering_at.to"]=w),m&&(a.stop_cause=m),void 0!==q&&(a["priority.from"]=q),void 0!==A&&(a["priority.to"]=A),void 0!==C&&(a.name=C),void 0!==R&&(a["attempts.from"]=R),void 0!==S&&(a["attempts.to"]=S),K&&(a.agent_id=K),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),P.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),P.headers),[2,{url:J.format(t),options:r}]}})})},updateMember:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("queueId","Required parameter queueId was null or undefined when calling updateMember.");if(null==l)throw new T("id","Required parameter id was null or undefined when calling updateMember.");if(null==d)throw new T("body","Required parameter body was null or undefined when calling updateMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),O&&(n=O.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},O&&O.apiKey)?"function"!=typeof O.apiKey?[3,2]:[4,O.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,O.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function R(A){return{attemptCallback:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).attemptCallback(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},attemptResult:function(t,r,i,a,s){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).attemptResult(t,r,i,a,s)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},attemptsRenewalResult:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).attemptsRenewalResult(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createAttempt:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).createAttempt(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createMember:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).createMember(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createMemberBulk:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).createMemberBulk(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteMember:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).deleteMember(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteMembers:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).deleteMembers(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchMember:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).patchMember(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readMember:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).readMember(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},resetMembers:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).resetMembers(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAttempts:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).searchAttempts(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAttemptsHistory:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).searchAttemptsHistory(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchMemberAttempts:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).searchMemberAttempts(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchMemberInQueue:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).searchMemberInQueue(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchMembers:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).searchMembers(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateMember:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).updateMember(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Ye=e,N.__extends(r,Ye),r.prototype.attemptCallback=function(e,t,n){var r=this;return R(this.configuration).attemptCallback(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.attemptResult=function(e,t,n,r,i){var a=this;return R(this.configuration).attemptResult(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},r.prototype.attemptsRenewalResult=function(e,t,n){var r=this;return R(this.configuration).attemptsRenewalResult(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.createAttempt=function(e,t,n,r){var i=this;return R(this.configuration).createAttempt(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.createMember=function(e,t,n){var r=this;return R(this.configuration).createMember(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.createMemberBulk=function(e,t,n){var r=this;return R(this.configuration).createMemberBulk(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.deleteMember=function(e,t,n,r){var i=this;return R(this.configuration).deleteMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.deleteMembers=function(e,t,n){var r=this;return R(this.configuration).deleteMembers(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.patchMember=function(e,t,n,r){var i=this;return R(this.configuration).patchMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.readMember=function(e,t,n,r){var i=this;return R(this.configuration).readMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.resetMembers=function(e,t,n){var r=this;return R(this.configuration).resetMembers(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.searchAttempts=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b){var w=this;return R(this.configuration).searchAttempts(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b).then(function(e){return e(w.axios,w.basePath)})},r.prototype.searchAttemptsHistory=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b){var w=this;return R(this.configuration).searchAttemptsHistory(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b).then(function(e){return e(w.axios,w.basePath)})},r.prototype.searchMemberAttempts=function(e,t,n,r){var i=this;return R(this.configuration).searchMemberAttempts(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.searchMemberInQueue=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){var m=this;return R(this.configuration).searchMemberInQueue(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w).then(function(e){return e(m.axios,m.basePath)})},r.prototype.searchMembers=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){var m=this;return R(this.configuration).searchMembers(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w).then(function(e){return e(m.axios,m.basePath)})},r.prototype.updateMember=function(e,t,n,r){var i=this;return R(this.configuration).updateMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var Ye,Ze=r;function r(){return null!==Ye&&Ye.apply(this,arguments)||this}function et(g){var e=this;return{createOutboundResourceGroup:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createOutboundResourceGroup.");return(t=J.parse("/call_center/resource_group",!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},createOutboundResourceInGroup:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("groupId","Required parameter groupId was null or undefined when calling createOutboundResourceInGroup.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling createOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteOutboundResourceGroup:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteOutboundResourceGroup.");return(t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},deleteOutboundResourceInGroup:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("groupId","Required parameter groupId was null or undefined when calling deleteOutboundResourceInGroup.");if(null==c)throw new T("id","Required parameter id was null or undefined when calling deleteOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},readOutboundResourceGroup:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readOutboundResourceGroup.");return(t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readOutboundResourceInGroup:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("groupId","Required parameter groupId was null or undefined when calling readOutboundResourceInGroup.");if(null==c)throw new T("id","Required parameter id was null or undefined when calling readOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},searchOutboundResourceGroup:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/resource_group",!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},searchOutboundResourceInGroup:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("groupId","Required parameter groupId was null or undefined when calling searchOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),f.headers),[2,{url:J.format(t),options:r}]}})})},updateOutboundResourceGroup:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateOutboundResourceGroup.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateOutboundResourceGroup.");return(t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},updateOutboundResourceInGroup:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("groupId","Required parameter groupId was null or undefined when calling updateOutboundResourceInGroup.");if(null==l)throw new T("id","Required parameter id was null or undefined when calling updateOutboundResourceInGroup.");if(null==d)throw new T("body","Required parameter body was null or undefined when calling updateOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function y(l){return{createOutboundResourceGroup:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).createOutboundResourceGroup(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createOutboundResourceInGroup:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).createOutboundResourceInGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResourceGroup:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).deleteOutboundResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResourceInGroup:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).deleteOutboundResourceInGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResourceGroup:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).readOutboundResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResourceInGroup:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).readOutboundResourceInGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResourceGroup:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).searchOutboundResourceGroup(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResourceInGroup:function(t,r,i,a,s,o,u,c){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).searchOutboundResourceInGroup(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResourceGroup:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).updateOutboundResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResourceInGroup:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).updateOutboundResourceInGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}tt=e,N.__extends(rt,tt),rt.prototype.createOutboundResourceGroup=function(e,t){var n=this;return y(this.configuration).createOutboundResourceGroup(e,t).then(function(e){return e(n.axios,n.basePath)})},rt.prototype.createOutboundResourceInGroup=function(e,t,n){var r=this;return y(this.configuration).createOutboundResourceInGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},rt.prototype.deleteOutboundResourceGroup=function(e,t,n){var r=this;return y(this.configuration).deleteOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},rt.prototype.deleteOutboundResourceInGroup=function(e,t,n,r){var i=this;return y(this.configuration).deleteOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},rt.prototype.readOutboundResourceGroup=function(e,t,n){var r=this;return y(this.configuration).readOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},rt.prototype.readOutboundResourceInGroup=function(e,t,n,r){var i=this;return y(this.configuration).readOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},rt.prototype.searchOutboundResourceGroup=function(e,t,n,r,i,a,s){var o=this;return y(this.configuration).searchOutboundResourceGroup(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},rt.prototype.searchOutboundResourceInGroup=function(e,t,n,r,i,a,s,o){var u=this;return y(this.configuration).searchOutboundResourceInGroup(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},rt.prototype.updateOutboundResourceGroup=function(e,t,n){var r=this;return y(this.configuration).updateOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},rt.prototype.updateOutboundResourceInGroup=function(e,t,n,r){var i=this;return y(this.configuration).updateOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var tt,nt=rt;function rt(){return null!==tt&&tt.apply(this,arguments)||this}function it(g){var e=this;return{createOutboundResource:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createOutboundResource.");return(t=J.parse("/call_center/resources",!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},createOutboundResourceDisplay:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("resourceId","Required parameter resourceId was null or undefined when calling createOutboundResourceDisplay.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling createOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteOutboundResource:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},deleteOutboundResourceDisplay:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("resourceId","Required parameter resourceId was null or undefined when calling deleteOutboundResourceDisplay.");if(null==c)throw new T("id","Required parameter id was null or undefined when calling deleteOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},patchOutboundResource:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling patchOutboundResource.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling patchOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readOutboundResource:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readOutboundResourceDisplay:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("resourceId","Required parameter resourceId was null or undefined when calling readOutboundResourceDisplay.");if(null==c)throw new T("id","Required parameter id was null or undefined when calling readOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},searchOutboundResource:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/resources",!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},searchOutboundResourceDisplay:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("resourceId","Required parameter resourceId was null or undefined when calling searchOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),f.headers),[2,{url:J.format(t),options:r}]}})})},updateOutboundResource:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateOutboundResource.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},updateOutboundResourceDisplay:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("resourceId","Required parameter resourceId was null or undefined when calling updateOutboundResourceDisplay.");if(null==l)throw new T("id","Required parameter id was null or undefined when calling updateOutboundResourceDisplay.");if(null==d)throw new T("body","Required parameter body was null or undefined when calling updateOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function b(l){return{createOutboundResource:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).createOutboundResource(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createOutboundResourceDisplay:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).createOutboundResourceDisplay(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResource:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).deleteOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResourceDisplay:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).deleteOutboundResourceDisplay(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchOutboundResource:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).patchOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResource:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).readOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResourceDisplay:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).readOutboundResourceDisplay(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResource:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).searchOutboundResource(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResourceDisplay:function(t,r,i,a,s,o,u,c){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).searchOutboundResourceDisplay(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResource:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).updateOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResourceDisplay:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).updateOutboundResourceDisplay(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}at=e,N.__extends(i,at),i.prototype.createOutboundResource=function(e,t){var n=this;return b(this.configuration).createOutboundResource(e,t).then(function(e){return e(n.axios,n.basePath)})},i.prototype.createOutboundResourceDisplay=function(e,t,n){var r=this;return b(this.configuration).createOutboundResourceDisplay(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.deleteOutboundResource=function(e,t,n){var r=this;return b(this.configuration).deleteOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.deleteOutboundResourceDisplay=function(e,t,n,r){var i=this;return b(this.configuration).deleteOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},i.prototype.patchOutboundResource=function(e,t,n){var r=this;return b(this.configuration).patchOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.readOutboundResource=function(e,t,n){var r=this;return b(this.configuration).readOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.readOutboundResourceDisplay=function(e,t,n,r){var i=this;return b(this.configuration).readOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},i.prototype.searchOutboundResource=function(e,t,n,r,i,a,s){var o=this;return b(this.configuration).searchOutboundResource(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},i.prototype.searchOutboundResourceDisplay=function(e,t,n,r,i,a,s,o){var u=this;return b(this.configuration).searchOutboundResourceDisplay(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},i.prototype.updateOutboundResource=function(e,t,n){var r=this;return b(this.configuration).updateOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.updateOutboundResourceDisplay=function(e,t,n,r){var i=this;return b(this.configuration).updateOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var at,st=i;function i(){return null!==at&&at.apply(this,arguments)||this}function ot(g){var e=this;return{createQueueBucket:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("queueId","Required parameter queueId was null or undefined when calling createQueueBucket.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling createQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteQueueBucket:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("queueId","Required parameter queueId was null or undefined when calling deleteQueueBucket.");if(null==c)throw new T("id","Required parameter id was null or undefined when calling deleteQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},patchQueueBucket:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("queueId","Required parameter queueId was null or undefined when calling patchQueueBucket.");if(null==l)throw new T("id","Required parameter id was null or undefined when calling patchQueueBucket.");if(null==d)throw new T("body","Required parameter body was null or undefined when calling patchQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})},readQueueBucket:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("queueId","Required parameter queueId was null or undefined when calling readQueueBucket.");if(null==c)throw new T("id","Required parameter id was null or undefined when calling readQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchQueueBucket:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("queueId","Required parameter queueId was null or undefined when calling searchQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),f.headers),[2,{url:J.format(t),options:r}]}})})},updateQueueBucket:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("queueId","Required parameter queueId was null or undefined when calling updateQueueBucket.");if(null==l)throw new T("id","Required parameter id was null or undefined when calling updateQueueBucket.");if(null==d)throw new T("body","Required parameter body was null or undefined when calling updateQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function ut(l){return{createQueueBucket:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ot(l).createQueueBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueBucket:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ot(l).deleteQueueBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueueBucket:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ot(l).patchQueueBucket(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueBucket:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ot(l).readQueueBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueBucket:function(t,r,i,a,s,o,u,c){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ot(l).searchQueueBucket(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueBucket:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ot(l).updateQueueBucket(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ct=e,N.__extends(dt,ct),dt.prototype.createQueueBucket=function(e,t,n){var r=this;return ut(this.configuration).createQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},dt.prototype.deleteQueueBucket=function(e,t,n){var r=this;return ut(this.configuration).deleteQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},dt.prototype.patchQueueBucket=function(e,t,n,r){var i=this;return ut(this.configuration).patchQueueBucket(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},dt.prototype.readQueueBucket=function(e,t,n){var r=this;return ut(this.configuration).readQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},dt.prototype.searchQueueBucket=function(e,t,n,r,i,a,s,o){var u=this;return ut(this.configuration).searchQueueBucket(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},dt.prototype.updateQueueBucket=function(e,t,n,r){var i=this;return ut(this.configuration).updateQueueBucket(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var ct,lt=dt;function dt(){return null!==ct&&ct.apply(this,arguments)||this}function _t(y){var e=this;return{createQueueHook:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("queueId","Required parameter queueId was null or undefined when calling createQueueHook.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling createQueueHook.");return(t="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteQueueHook:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("queueId","Required parameter queueId was null or undefined when calling deleteQueueHook.");if(null==c)throw new T("id","Required parameter id was null or undefined when calling deleteQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},patchQueueHook:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("queueId","Required parameter queueId was null or undefined when calling patchQueueHook.");if(null==l)throw new T("id","Required parameter id was null or undefined when calling patchQueueHook.");if(null==d)throw new T("body","Required parameter body was null or undefined when calling patchQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),_),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})},readQueueHook:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("queueId","Required parameter queueId was null or undefined when calling readQueueHook.");if(null==c)throw new T("id","Required parameter id was null or undefined when calling readQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchQueueHook:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("queueId","Required parameter queueId was null or undefined when calling searchQueueHook.");return(t="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),v),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),f&&(a.schema_id=f),g&&(a.event=g),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),v.headers),[2,{url:J.format(t),options:r}]}})})},updateQueueHook:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("queueId","Required parameter queueId was null or undefined when calling updateQueueHook.");if(null==l)throw new T("id","Required parameter id was null or undefined when calling updateQueueHook.");if(null==d)throw new T("body","Required parameter body was null or undefined when calling updateQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function ht(_){return{createQueueHook:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,_t(_).createQueueHook(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueHook:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,_t(_).deleteQueueHook(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueueHook:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,_t(_).patchQueueHook(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueHook:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,_t(_).readQueueHook(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueHook:function(t,r,i,a,s,o,u,c,l,d){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,_t(_).searchQueueHook(t,r,i,a,s,o,u,c,l,d)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueHook:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,_t(_).updateQueueHook(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}pt=e,N.__extends(gt,pt),gt.prototype.createQueueHook=function(e,t,n){var r=this;return ht(this.configuration).createQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},gt.prototype.deleteQueueHook=function(e,t,n){var r=this;return ht(this.configuration).deleteQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},gt.prototype.patchQueueHook=function(e,t,n,r){var i=this;return ht(this.configuration).patchQueueHook(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},gt.prototype.readQueueHook=function(e,t,n){var r=this;return ht(this.configuration).readQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},gt.prototype.searchQueueHook=function(e,t,n,r,i,a,s,o,u,c){var l=this;return ht(this.configuration).searchQueueHook(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},gt.prototype.updateQueueHook=function(e,t,n,r){var i=this;return ht(this.configuration).updateQueueHook(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var pt,ft=gt;function gt(){return null!==pt&&pt.apply(this,arguments)||this}function vt(g){var e=this;return{createQueueResourceGroup:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("queueId","Required parameter queueId was null or undefined when calling createQueueResourceGroup.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling createQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteQueueResourceGroup:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("queueId","Required parameter queueId was null or undefined when calling deleteQueueResourceGroup.");if(null==c)throw new T("id","Required parameter id was null or undefined when calling deleteQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},readQueueResourceGroup:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("queueId","Required parameter queueId was null or undefined when calling readQueueResourceGroup.");if(null==c)throw new T("id","Required parameter id was null or undefined when calling readQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},searchQueueResourceGroup:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("queueId","Required parameter queueId was null or undefined when calling searchQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),f.headers),[2,{url:J.format(t),options:r}]}})})},updateQueueResourceGroup:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("queueId","Required parameter queueId was null or undefined when calling updateQueueResourceGroup.");if(null==l)throw new T("id","Required parameter id was null or undefined when calling updateQueueResourceGroup.");if(null==d)throw new T("body","Required parameter body was null or undefined when calling updateQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function yt(l){return{createQueueResourceGroup:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,vt(l).createQueueResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueResourceGroup:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,vt(l).deleteQueueResourceGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueResourceGroup:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,vt(l).readQueueResourceGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueResourceGroup:function(t,r,i,a,s,o,u,c){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,vt(l).searchQueueResourceGroup(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueResourceGroup:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,vt(l).updateQueueResourceGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}bt=e,N.__extends(mt,bt),mt.prototype.createQueueResourceGroup=function(e,t,n){var r=this;return yt(this.configuration).createQueueResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},mt.prototype.deleteQueueResourceGroup=function(e,t,n,r){var i=this;return yt(this.configuration).deleteQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},mt.prototype.readQueueResourceGroup=function(e,t,n,r){var i=this;return yt(this.configuration).readQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},mt.prototype.searchQueueResourceGroup=function(e,t,n,r,i,a,s,o){var u=this;return yt(this.configuration).searchQueueResourceGroup(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},mt.prototype.updateQueueResourceGroup=function(e,t,n,r){var i=this;return yt(this.configuration).updateQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var bt,wt=mt;function mt(){return null!==bt&&bt.apply(this,arguments)||this}function qt(w){var e=this;return{createQueue:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createQueue.");return(t=J.parse("/call_center/queues",!0),w&&(n=w.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteQueue:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),w&&(n=w.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},patchQueue:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling patchQueue.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling patchQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),w&&(n=w.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readQueue:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),w&&(n=w.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchQueue:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/queues",!0),w&&(n=w.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),f),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.type=p),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),f.headers),[2,{url:J.format(t),options:r}]}})})},searchQueueReportGeneral:function(u,c,l,d,_,h,p,f,g,v,y,b){return void 0===b&&(b={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/queues/reports/general",!0),w&&(n=w.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),b),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a["joined_at.from"]=l),void 0!==d&&(a["joined_at.to"]=d),void 0!==_&&(a.domain_id=_),h&&(a.fields=h),void 0!==p&&(a.sort=p),void 0!==f&&(a.q=f),g&&(a.queue_id=g),v&&(a.team_id=v),y&&(a.type=y),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),b.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),b.headers),[2,{url:J.format(t),options:r}]}})})},updateQueue:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateQueue.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),w&&(n=w.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function w(p){return{createQueue:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,qt(p).createQueue(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueue:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,qt(p).deleteQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueue:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,qt(p).patchQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueue:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,qt(p).readQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueue:function(t,r,i,a,s,o,u,c){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,qt(p).searchQueue(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueReportGeneral:function(t,r,i,a,s,o,u,c,l,d,_,h){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,qt(p).searchQueueReportGeneral(t,r,i,a,s,o,u,c,l,d,_,h)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueue:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,qt(p).updateQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}At=e,N.__extends(Rt,At),Rt.prototype.createQueue=function(e,t){var n=this;return w(this.configuration).createQueue(e,t).then(function(e){return e(n.axios,n.basePath)})},Rt.prototype.deleteQueue=function(e,t,n){var r=this;return w(this.configuration).deleteQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Rt.prototype.patchQueue=function(e,t,n){var r=this;return w(this.configuration).patchQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Rt.prototype.readQueue=function(e,t,n){var r=this;return w(this.configuration).readQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Rt.prototype.searchQueue=function(e,t,n,r,i,a,s,o){var u=this;return w(this.configuration).searchQueue(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},Rt.prototype.searchQueueReportGeneral=function(e,t,n,r,i,a,s,o,u,c,l,d){var _=this;return w(this.configuration).searchQueueReportGeneral(e,t,n,r,i,a,s,o,u,c,l,d).then(function(e){return e(_.axios,_.basePath)})},Rt.prototype.updateQueue=function(e,t,n){var r=this;return w(this.configuration).updateQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var At,Ct=Rt;function Rt(){return null!==At&&At.apply(this,arguments)||this}function St(q){var e=this;return{createQueueSkill:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("queueId","Required parameter queueId was null or undefined when calling createQueueSkill.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling createQueueSkill.");return(t="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),q&&(n=q.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteQueueSkill:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("queueId","Required parameter queueId was null or undefined when calling deleteQueueSkill.");if(null==c)throw new T("id","Required parameter id was null or undefined when calling deleteQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),q&&(n=q.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},patchQueueSkill:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("queueId","Required parameter queueId was null or undefined when calling patchQueueSkill.");if(null==l)throw new T("id","Required parameter id was null or undefined when calling patchQueueSkill.");if(null==d)throw new T("body","Required parameter body was null or undefined when calling patchQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),q&&(n=q.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),_),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})},readQueueSkill:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("queueId","Required parameter queueId was null or undefined when calling readQueueSkill.");if(null==c)throw new T("id","Required parameter id was null or undefined when calling readQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),q&&(n=q.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchQueueSkill:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m){return void 0===m&&(m={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("queueId","Required parameter queueId was null or undefined when calling searchQueueSkill.");return(t="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),q&&(n=q.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),m),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),f&&(a.skill_id=f),g&&(a.bucket_id=g),v&&(a.lvl=v),y&&(a.min_capacity=y),b&&(a.max_capacity=b),void 0!==w&&(a.enabled=w),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),m.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),m.headers),[2,{url:J.format(t),options:r}]}})})},updateQueueSkill:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("queueId","Required parameter queueId was null or undefined when calling updateQueueSkill.");if(null==l)throw new T("id","Required parameter id was null or undefined when calling updateQueueSkill.");if(null==d)throw new T("body","Required parameter body was null or undefined when calling updateQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),q&&(n=q.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function Kt(g){return{createQueueSkill:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,St(g).createQueueSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueSkill:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,St(g).deleteQueueSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueueSkill:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,St(g).patchQueueSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueSkill:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,St(g).readQueueSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueSkill:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,St(g).searchQueueSkill(t,r,i,a,s,o,u,c,l,d,_,h,p,f)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueSkill:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,St(g).updateQueueSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Pt=e,N.__extends(Tt,Pt),Tt.prototype.createQueueSkill=function(e,t,n){var r=this;return Kt(this.configuration).createQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Tt.prototype.deleteQueueSkill=function(e,t,n){var r=this;return Kt(this.configuration).deleteQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Tt.prototype.patchQueueSkill=function(e,t,n,r){var i=this;return Kt(this.configuration).patchQueueSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Tt.prototype.readQueueSkill=function(e,t,n){var r=this;return Kt(this.configuration).readQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Tt.prototype.searchQueueSkill=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){var p=this;return Kt(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)})},Tt.prototype.updateQueueSkill=function(e,t,n,r){var i=this;return Kt(this.configuration).updateQueueSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var Pt,Ot=Tt;function Tt(){return null!==Pt&&Pt.apply(this,arguments)||this}function kt(y){var e=this;return{createRegion:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createRegion.");return(t=J.parse("/regions",!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteRegion:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),c),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},patchRegion:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling patchRegion.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling patchRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readRegion:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),c),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},searchRegion:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/regions",!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),v),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),void 0!==f&&(a.description=f),g&&(a.timezone_id=g),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),v.headers),[2,{url:J.format(t),options:r}]}})})},updateRegion:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateRegion.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function It(_){return{createRegion:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,kt(_).createRegion(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRegion:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,kt(_).deleteRegion(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchRegion:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,kt(_).patchRegion(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRegion:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,kt(_).readRegion(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRegion:function(t,r,i,a,s,o,u,c,l,d){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,kt(_).searchRegion(t,r,i,a,s,o,u,c,l,d)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRegion:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,kt(_).updateRegion(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Wt=e,N.__extends(xt,Wt),xt.prototype.createRegion=function(e,t){var n=this;return It(this.configuration).createRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},xt.prototype.deleteRegion=function(e,t){var n=this;return It(this.configuration).deleteRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},xt.prototype.patchRegion=function(e,t,n){var r=this;return It(this.configuration).patchRegion(e,t,n).then(function(e){return e(r.axios,r.basePath)})},xt.prototype.readRegion=function(e,t){var n=this;return It(this.configuration).readRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},xt.prototype.searchRegion=function(e,t,n,r,i,a,s,o,u,c){var l=this;return It(this.configuration).searchRegion(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},xt.prototype.updateRegion=function(e,t,n){var r=this;return It(this.configuration).updateRegion(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Wt,Xt=xt;function xt(){return null!==Wt&&Wt.apply(this,arguments)||this}function Et(v){var e=this;return{createChatPlan:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createChatPlan.");return(t=J.parse("/routing/outbound/chat",!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteChatPlan:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),c),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},patchChatPlan:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling patchChatPlan.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling patchChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readChatPlan:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),c),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},searchChatPlan:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/routing/outbound/chat",!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),void 0!==f&&(a.enabled=f),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),g.headers),[2,{url:J.format(t),options:r}]}})})},updateChatPlan:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateChatPlan.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function Qt(d){return{createChatPlan:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Et(d).createChatPlan(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteChatPlan:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Et(d).deleteChatPlan(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchChatPlan:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Et(d).patchChatPlan(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readChatPlan:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Et(d).readChatPlan(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchChatPlan:function(t,r,i,a,s,o,u,c,l){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Et(d).searchChatPlan(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateChatPlan:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Et(d).updateChatPlan(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}jt=e,N.__extends(Gt,jt),Gt.prototype.createChatPlan=function(e,t){var n=this;return Qt(this.configuration).createChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},Gt.prototype.deleteChatPlan=function(e,t){var n=this;return Qt(this.configuration).deleteChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},Gt.prototype.patchChatPlan=function(e,t,n){var r=this;return Qt(this.configuration).patchChatPlan(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Gt.prototype.readChatPlan=function(e,t){var n=this;return Qt(this.configuration).readChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},Gt.prototype.searchChatPlan=function(e,t,n,r,i,a,s,o,u){var c=this;return Qt(this.configuration).searchChatPlan(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},Gt.prototype.updateChatPlan=function(e,t,n){var r=this;return Qt(this.configuration).updateChatPlan(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var jt,Ut=Gt;function Gt(){return null!==jt&&jt.apply(this,arguments)||this}function Bt(b){var e=this;return{createRoutingOutboundCall:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createRoutingOutboundCall.");return(t=J.parse("/routing/outbound/calls",!0),b&&(n=b.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteRoutingOutboundCall:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),b&&(n=b.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},movePositionRoutingOutboundCall:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("fromId","Required parameter fromId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==l)throw new T("toId","Required parameter toId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==d)throw new T("body","Required parameter body was null or undefined when calling movePositionRoutingOutboundCall.");return(t="/routing/outbound/calls/{from_id}/to/{to_id}".replace("{from_id}",encodeURIComponent(String(c))).replace("{to_id}",encodeURIComponent(String(l))),t=J.parse(t,!0),b&&(n=b.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),_),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})},patchRoutingOutboundCall:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling patchRoutingOutboundCall.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling patchRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),b&&(n=b.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readRoutingOutboundCall:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),b&&(n=b.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchRoutingOutboundCall:function(u,c,l,d,_,h,p,f,g,v,y){return void 0===y&&(y={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/routing/outbound/calls",!0),b&&(n=b.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),y),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),f&&(a.schema_id=f),void 0!==g&&(a.pattern=g),void 0!==v&&(a.description=v),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),y.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),y.headers),[2,{url:J.format(t),options:r}]}})})},updateRoutingOutboundCall:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateRoutingOutboundCall.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),b&&(n=b.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function m(h){return{createRoutingOutboundCall:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).createRoutingOutboundCall(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRoutingOutboundCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).deleteRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},movePositionRoutingOutboundCall:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).movePositionRoutingOutboundCall(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchRoutingOutboundCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).patchRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRoutingOutboundCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).readRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRoutingOutboundCall:function(t,r,i,a,s,o,u,c,l,d,_){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).searchRoutingOutboundCall(t,r,i,a,s,o,u,c,l,d,_)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRoutingOutboundCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).updateRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Mt=e,N.__extends(Lt,Mt),Lt.prototype.createRoutingOutboundCall=function(e,t){var n=this;return m(this.configuration).createRoutingOutboundCall(e,t).then(function(e){return e(n.axios,n.basePath)})},Lt.prototype.deleteRoutingOutboundCall=function(e,t,n){var r=this;return m(this.configuration).deleteRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Lt.prototype.movePositionRoutingOutboundCall=function(e,t,n,r){var i=this;return m(this.configuration).movePositionRoutingOutboundCall(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Lt.prototype.patchRoutingOutboundCall=function(e,t,n){var r=this;return m(this.configuration).patchRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Lt.prototype.readRoutingOutboundCall=function(e,t,n){var r=this;return m(this.configuration).readRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Lt.prototype.searchRoutingOutboundCall=function(e,t,n,r,i,a,s,o,u,c,l){var d=this;return m(this.configuration).searchRoutingOutboundCall(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(d.axios,d.basePath)})},Lt.prototype.updateRoutingOutboundCall=function(e,t,n){var r=this;return m(this.configuration).updateRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Mt,Ht=Lt;function Lt(){return null!==Mt&&Mt.apply(this,arguments)||this}function Dt(y){var e=this;return{createRoutingSchema:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createRoutingSchema.");return(t=J.parse("/routing/schema",!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteRoutingSchema:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},patchRoutingSchema:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling patchRoutingSchema.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling patchRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readRoutingSchema:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchRoutingSchema:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/routing/schema",!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),v),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),f&&(a.type=f),void 0!==g&&(a.editor=g),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),v.headers),[2,{url:J.format(t),options:r}]}})})},updateRoutingSchema:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateRoutingSchema.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function Ft(_){return{createRoutingSchema:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(_).createRoutingSchema(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRoutingSchema:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(_).deleteRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchRoutingSchema:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(_).patchRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRoutingSchema:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(_).readRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRoutingSchema:function(t,r,i,a,s,o,u,c,l,d){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(_).searchRoutingSchema(t,r,i,a,s,o,u,c,l,d)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRoutingSchema:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(_).updateRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Nt=e,N.__extends(zt,Nt),zt.prototype.createRoutingSchema=function(e,t){var n=this;return Ft(this.configuration).createRoutingSchema(e,t).then(function(e){return e(n.axios,n.basePath)})},zt.prototype.deleteRoutingSchema=function(e,t,n){var r=this;return Ft(this.configuration).deleteRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},zt.prototype.patchRoutingSchema=function(e,t,n){var r=this;return Ft(this.configuration).patchRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},zt.prototype.readRoutingSchema=function(e,t,n){var r=this;return Ft(this.configuration).readRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},zt.prototype.searchRoutingSchema=function(e,t,n,r,i,a,s,o,u,c){var l=this;return Ft(this.configuration).searchRoutingSchema(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},zt.prototype.updateRoutingSchema=function(e,t,n){var r=this;return Ft(this.configuration).updateRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Nt,Jt=zt;function zt(){return null!==Nt&&Nt.apply(this,arguments)||this}function Vt(_){var e=this;return{createRoutingVariable:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createRoutingVariable.");return(t=J.parse("/routing/variables",!0),_&&(n=_.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteRoutingVariable:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteRoutingVariable.");return(t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),_&&(n=_.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readRoutingVariable:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readRoutingVariable.");return(t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),_&&(n=_.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchRoutingVariable:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/routing/variables",!0),_&&(n=_.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},updateRoutingVariable:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateRoutingVariable.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateRoutingVariable.");return(t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),_&&(n=_.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function $t(s){return{createRoutingVariable:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Vt(s).createRoutingVariable(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRoutingVariable:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Vt(s).deleteRoutingVariable(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRoutingVariable:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Vt(s).readRoutingVariable(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRoutingVariable:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Vt(s).searchRoutingVariable(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRoutingVariable:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Vt(s).updateRoutingVariable(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Yt=e,N.__extends(en,Yt),en.prototype.createRoutingVariable=function(e,t){var n=this;return $t(this.configuration).createRoutingVariable(e,t).then(function(e){return e(n.axios,n.basePath)})},en.prototype.deleteRoutingVariable=function(e,t,n){var r=this;return $t(this.configuration).deleteRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},en.prototype.readRoutingVariable=function(e,t,n){var r=this;return $t(this.configuration).readRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},en.prototype.searchRoutingVariable=function(e,t,n,r){var i=this;return $t(this.configuration).searchRoutingVariable(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},en.prototype.updateRoutingVariable=function(e,t,n){var r=this;return $t(this.configuration).updateRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Yt,Zt=en;function en(){return null!==Yt&&Yt.apply(this,arguments)||this}function tn(f){var e=this;return{createSkill:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("body","Required parameter body was null or undefined when calling createSkill.");return(t=J.parse("/call_center/skills",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteSkill:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling deleteSkill.");return(t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readSkill:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("id","Required parameter id was null or undefined when calling readSkill.");return(t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchSkill:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/skills",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},updateSkill:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new T("id","Required parameter id was null or undefined when calling updateSkill.");if(null==l)throw new T("body","Required parameter body was null or undefined when calling updateSkill.");return(t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function nn(c){return{createSkill:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,tn(c).createSkill(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteSkill:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,tn(c).deleteSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readSkill:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,tn(c).readSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchSkill:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,tn(c).searchSkill(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateSkill:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,tn(c).updateSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}rn=e,N.__extends(sn,rn),sn.prototype.createSkill=function(e,t){var n=this;return nn(this.configuration).createSkill(e,t).then(function(e){return e(n.axios,n.basePath)})},sn.prototype.deleteSkill=function(e,t,n){var r=this;return nn(this.configuration).deleteSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},sn.prototype.readSkill=function(e,t,n){var r=this;return nn(this.configuration).readSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},sn.prototype.searchSkill=function(e,t,n,r,i,a,s){var o=this;return nn(this.configuration).searchSkill(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},sn.prototype.updateSkill=function(e,t,n){var r=this;return nn(this.configuration).updateSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var rn,an=sn;function sn(){return null!==rn&&rn.apply(this,arguments)||this}function on(l){var e=this;return{defaultDeviceConfig:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new T("type","Required parameter type was null or undefined when calling defaultDeviceConfig.");return(t="/user/device/config/{type}".replace("{type}",encodeURIComponent(String(u))),t=J.parse(t,!0),l&&(n=l.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),c),i={},a={},l&&l.apiKey)?"function"!=typeof l.apiKey?[3,2]:[4,l.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,l.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})}}}function un(i){return{defaultDeviceConfig:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,on(i).defaultDeviceConfig(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}cn=e,N.__extends(dn,cn),dn.prototype.defaultDeviceConfig=function(e,t){var n=this;return un(this.configuration).defaultDeviceConfig(e,t).then(function(e){return e(n.axios,n.basePath)})};var cn,ln=dn;function dn(){return null!==cn&&cn.apply(this,arguments)||this}function _n(e){this.apiKey=(e=void 0===e?{}:e).apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions}(K=h.EngineBoolFilter||(h.EngineBoolFilter={})).Undefined="undefined",K.True="true",K.False="false",(K=h.HistoryFileJobHistoryFileJobAction||(h.HistoryFileJobHistoryFileJobAction={})).Undefined="undefined",K.STT="STT",K.Delete="delete",(K=h.HistoryFileJobHistoryFileJobState||(h.HistoryFileJobHistoryFileJobState={})).Idle="idle",K.Active="active",K.Finished="finished",K.Error="error",(h.ProtobufNullValue||(h.ProtobufNullValue={})).NULLVALUE="NULL_VALUE",(K=h.StorageImportSourceType||(h.StorageImportSourceType={})).DefaultSourceType="DefaultSourceType",K.Dialer="Dialer",(K=h.StorageProviderType||(h.StorageProviderType={})).DefaultProvider="DefaultProvider",K.Microsoft="Microsoft",(K=h.StorageServiceType||(h.StorageServiceType={})).DefaultService="DefaultService",K.STT="STT",K.TTS="TTS",(K=h.StorageUploadStatusCode||(h.StorageUploadStatusCode={})).Unknown="Unknown",K.Ok="Ok",K.Failed="Failed",pn.prototype.debug=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("debug",e,t)},pn.prototype.info=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("info",e,t)},pn.prototype.warn=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("warn",e,t)},pn.prototype.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("error",e,t)},pn.prototype.emitLogMessage=function(e,t,n){0<n.length?console[e].apply(console,N.__spreadArrays([t],n)):console[e](t)};var hn=pn;function pn(){}Object.defineProperty(gn.prototype,"id",{get:function(){return this.session.id},enumerable:!0,configurable:!0}),gn.prototype.getLocalMedia=function(){if(this.session.connection){var e=this.session.connection.getLocalStreams();if(e.length)return e}return[]},gn.prototype.getPeerMedia=function(){if(this.session.connection){var e=this.session.connection.getRemoteStreams();if(e.length)return e}return[]},gn.prototype.answer=function(e){var t=this;return new Promise(function(){t.session.answer(e)})};var fn=gn;function gn(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")}vn=O.EventEmitter,N.__extends(a,vn),a.prototype.callOption=function(n){return void 0===n&&(n={}),N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){switch(e.label){case 0:return[4,this.getUserCallStream(n)];case 1:return t=e.sent(),[2,{sessionTimersExpires:120,pcConfig:n.disableStun?void 0:{iceServers:[{urls:["stun:stun.l.google.com:19302"]}]},mediaStream:t}]}})})},a.prototype.answer=function(r,i){return N.__awaiter(this,void 0,void 0,function(){var t,n;return N.__generator(this,function(e){switch(e.label){case 0:return this.sessionCache.has(r)?(t=this.sessionCache.get(r),[4,this.callOption(i)]):[3,2];case 1:return n=e.sent(),[2,t.answer(n)];case 2:return[2,!1]}})})},a.prototype.call=function(r){return N.__awaiter(this,void 0,void 0,function(){var t,n;return N.__generator(this,function(e){switch(e.label){case 0:if(n={},t=null,r.params&&(n.audio=r.params.audio,n.video=r.params.video||!1,n.screen=r.params.screen||!1,n.disableStun=r.params.disableStun||!1),"string"!=typeof r.destination)throw new Error("bad destination type");return[4,this.callOption(n)];case 1:return n=e.sent(),r.params&&r.params.display&&(t={extraHeaders:["X-Webitel-Display: "+r.params.display]}),[4,this.ua.call(r.destination,N.__assign(N.__assign({},n),t))];case 2:return e.sent(),[2]}})})},a.prototype.register=function(n){return N.__awaiter(this,void 0,void 0,function(){var t,i=this;return N.__generator(this,function(e){return t=new k.WebSocketInterface(n.server),t={realm:n.realm,uri:n.uri,authorization_user:n.authorization_user,ha1:n.ha1,user_agent:a.userAgent,sockets:[t],session_timers:!0,display_name:n.display_name,register_expires:n.register_expires||90,connection_recovery_min_interval:5,connection_recovery_max_interval:60},(t=this.ua=new k.UA(t)).on("newRTCSession",function(e){var t=e.session,n=t.id,r=new fn(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 N.__awaiter(i,void 0,void 0,function(){return N.__generator(this,function(e){return this.emit("peerStreams",r,new Array(t.stream)),[2]})})})}),t.on("ended",function(){i.removeSession(n,t.connection)}),t.on("failed",function(){i.removeSession(n,t.connection)}),t.on("accepted",function(){r.incoming||i.emit("peerStreams",r,t.connection.getRemoteStreams())}),t.on("confirmed",function(){}),i.emit("newSession",r)}),t.on("disconnected",function(e){i.emit("unregistered")}),t.on("unregistered",function(e){i.emit("unregistered")}),t.on("registrationFailed",function(e){i.log.error("registrationFailed",e)}),t.on("registered",function(e){i.emit("registered")}),t.start(),[2]})})},a.prototype.unregister=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){switch(e.label){case 0:return this.ua?(this.ua.terminateSessions(),this.ua.removeAllListeners(),[4,this.ua.stop()]):[3,2];case 1:e.sent(),delete this.ua,e.label=2;case 2:return[2]}})})},a.prototype.sipSessionByCallId=function(e){for(var t=0,n=this.allSession;t<n.length;t++){var r=n[t];if(r.callId===e)return r}return null},a.prototype.sipSessionBySipId=function(e){for(var t=0,n=this.allSession;t<n.length;t++){var r=n[t];if(r.id.startsWith(e))return r}return null},a.prototype.removeSession=function(e,t){var n;return t&&(n=t.getLocalStreams(),t=t.getRemoteStreams(),n&&n.forEach(function(e){e.getTracks().forEach(function(e){e.stop()})}),t&&t.forEach(function(e){e.getTracks().forEach(function(e){e.stop()})})),!!this.sessionCache.has(e)&&(this.sessionCache.delete(e),!0)},a.prototype.storeSession=function(e,t){if(this.sessionCache.has(e))throw new Error("Session already store");this.sessionCache.set(e,t)},Object.defineProperty(a.prototype,"allSession",{get:function(){return Array.from(this.sessionCache.values())},enumerable:!0,configurable:!0}),a.prototype.getMediaConstraints=function(e){return e.screen?{video:!1,audio:!1,screen:!0}:{video:e.video||!1,audio:!0}},a.prototype.getSession=function(e){return this.sessionCache.has(e)?this.sessionCache.get(e):null},a.prototype.hasSession=function(e){return this.sessionCache.has(e)},a.prototype.getUserScreen=function(){return N.__awaiter(this,void 0,void 0,function(){var t=this;return N.__generator(this,function(e){return[2,new Promise(function(n,r){return N.__awaiter(t,void 0,void 0,function(){var t;return N.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,navigator.mediaDevices.getDisplayMedia()];case 1:return t=e.sent(),n(t),[3,3];case 2:return t=e.sent(),r(t),[3,3];case 3:return[2]}})})})]})})},a.prototype.getUserCallStream=function(r){return N.__awaiter(this,void 0,void 0,function(){var t,n;return N.__generator(this,function(e){switch(e.label){case 0:return!0!==r.screen?[3,2]:[4,this.getUserScreen()];case 1:t=e.sent(),e.label=2;case 2:return!1!==r.audio||r.video?[4,this.getUserMedia(r.audio,r.video)]:[3,4];case 3:n=e.sent(),t?n.getTracks().forEach(function(e){t.addTrack(e)}):t=n,e.label=4;case 4:if(t)return[2,t];throw new Error("bad stream request")}})})},a.prototype.getUserMedia=function(i,a){return N.__awaiter(this,void 0,void 0,function(){var t=this;return N.__generator(this,function(e){return[2,new Promise(function(n,r){return N.__awaiter(t,void 0,void 0,function(){var t;return N.__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 N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,new Promise(function(t,n){navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia(r).then(function(e){return t(e)}).catch(function(e){return n(e)}):(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)(r,function(e){return t(e)},function(e){return n(e)})})]})})}(t).then(n).catch(r)]})})})]})})},a.userAgent="Webitel-Phone/0.0.1";var vn,yn=a;function a(e,t){var n=vn.call(this)||this;return n.instanceId=e,n.type="webrtc",n.sessionCache=new Map,t?k.debug.enable("*"):k.debug.disable(),n.log=new hn,n.on("unregistered",function(){n.sessionCache.clear()}),n}(K=h.JobState||(h.JobState={})).Distribute="distribute",K.Offering="offering",K.Bridged="bridged",K.Missed="missed",K.Processing="processing",K.Closed="closed",K.Destroy="destroy",(K=bn=bn||{}).Call="call",K.Chat="chat",K.Task="task",Object.defineProperty(s.prototype,"queue",{get:function(){return{id:this.distribute.queue_id,name:this.distribute.queue_name}},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"duration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"hasForm",{get:function(){return this.distribute.has_form||!1},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"channel",{get:function(){return this.distribute.channel},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"allowAccept",{get:function(){return this.channel===bn.Task&&0===this.bridgedAt&&0===this.closedAt},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"allowDecline",{get:function(){return this.allowAccept},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"allowClose",{get:function(){return this.channel===bn.Task&&0===this.closedAt&&0<this.bridgedAt},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"memberId",{get:function(){return this.distribute.member_id},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"queueId",{get:function(){return this.distribute.queue_id},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"hasReporting",{get:function(){return this.distribute.has_reporting},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"allowReporting",{get:function(){return this.hasReporting&&0<this.bridgedAt},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"agentChannelId",{get:function(){return this.distribute.agent_channel_id},enumerable:!0,configurable:!0}),s.prototype.setState=function(e){this.state=e},s.prototype.setAnswered=function(e){this.answeredAt=e,this.lastStatusChange=Date.now()},s.prototype.setOffering=function(e){this.offeringAt=e.timestamp},s.prototype.setBridged=function(e){this.bridgedAt=e.timestamp,this.lastStatusChange=Date.now(),e.form&&(this.form=e.form)},s.prototype.setProcessing=function(e,t){this.state=h.JobState.Processing,this.closedAt=e,this.startProcessingAt||(this.startProcessingAt=Date.now()),t.sec&&!t.timeout&&(t.timeout=Date.now()+1e3*t.sec),this._processing=t},s.prototype.setClosed=function(e){this.stopAt=e,this.state=h.JobState.Closed},s.prototype.setTransferred=function(e){this.distribute=e,this.history.push(e)},s.prototype.setMissed=function(){this.state=h.JobState.Missed},Object.defineProperty(s.prototype,"processingTimeoutAt",{get:function(){return this._processing&&this._processing.timeout?this._processing.timeout:null},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"processingSec",{get:function(){return this._processing&&this._processing.sec?this._processing.sec:null},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"attempt",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"variables",{get:function(){var e,t={};for(e in this.distribute.variables)e.startsWith("cc_")||(t[e]=this.distribute.variables[e]);return t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"isMember",{get:function(){return!!this.memberId},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"displayNumber",{get:function(){return this.communication.destination},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"displayName",{get:function(){return this.distribute.member_name||null},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"display",{get:function(){return this.displayName+" ("+this.displayNumber+")"},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"renewalSec",{get:function(){return this._processing&&this._processing.renewal_sec?this._processing.renewal_sec:null},enumerable:!0,configurable:!0}),s.prototype.accept=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("cc_agent_task_accept",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})]})})},s.prototype.close=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("cc_agent_task_close",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})]})})},s.prototype.decline=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("cc_agent_task_close",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})]})})},s.prototype.reporting=function(n){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.request("cc_reporting",N.__assign({attempt_id:this.id},n))];case 1:return t=e.sent(),this.reportedAt=Date.now(),[2,t]}})})},s.prototype.renew=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("cc_renewal",{attempt_id:this.id,renewal_sec:t||this.processingSec})]})})},s.prototype.formAction=function(t,n){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.form)return[2,this.client.request("cc_form_action",{attempt_id:this.id,app_id:this.distribute.app_id,action:t,fields:n})];throw new Error("not found active form")})})};var bn,wn=s;function s(e,t,n){this.client=e,this.distribute=n,this.id=t.attempt_id,this.state=h.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]}(K=h.AgentStatus||(h.AgentStatus={})).Online="online",K.Offline="offline",K.Pause="pause",K.BreakOut="break_out",(K=h.ChannelState||(h.ChannelState={})).Waiting="waiting",K.Distribute="distribute",K.Offering="offering",K.Answered="answered",K.Active="active",K.Bridged="bridged",K.Hold="hold",K.Missed="missed",K.WrapTime="wrap_time",K.Processing="processing",K.Transfer="transfer",K.Form="form",(K=h.ChannelType||(h.ChannelType={})).Call="call",K.Email="email",K.Chat="chat",K.Job="task";Object.defineProperty(o.prototype,"agentId",{get:function(){return this.info.agent_id},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"onDemand",{get:function(){return this.info.on_demand},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"status",{get:function(){return this.info.status},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"statusPayload",{get:function(){return this.info.status_payload},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isAdmin",{get:function(){return this.info.is_admin},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isSupervisor",{get:function(){return this.info.is_supervisor},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"team",{get:function(){return this.info.team},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"supervisor",{get:function(){return this.info.supervisor},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"auditor",{get:function(){return this.info.auditor},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"channels",{get:function(){return[this._channel]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"channel",{get:function(){return this._channel},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"stateDuration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!0,configurable:!0}),o.prototype.onChannelEvent=function(e){var t=this;switch(e.status){case h.ChannelState.Distribute:var n=e;if(!n)throw new Error("bad event");if(i=new wn(this.client,e,n.distribute),this.task.set(i.id,i),i.agentChannelId)switch(i.channel){case h.ChannelType.Call:var r=this.client.callById(i.agentChannelId);r&&!r.task&&(r.task=i);break;case h.ChannelType.Chat:r=this.client.conversationById(i.agentChannelId);r&&!r.task&&(r.task=i)}break;case h.ChannelState.Offering:var i,n=e;(i=this.task.get(e.attempt_id))&&(i.setOffering(n),n.offering.auto_answer&&i.channel===h.ChannelType.Job&&i.accept().catch(function(e){t.client.emit("error",e)}));break;case h.ChannelState.Bridged:n=e;(i=this.task.get(n.attempt_id))&&i.setBridged(n);break;case h.ChannelState.Transfer:n=e;(i=this.task.get(n.to_attempt_id))&&(this.task.delete(i.id),i.id=n.attempt_id,i.setTransferred(n.distribute),this.task.set(i.id,i));break;case h.ChannelState.Answered:(i=this.task.get(e.attempt_id))&&(i.answeredAt=e.timestamp);break;case h.ChannelState.Form:n=e;return void((i=this.task.get(e.attempt_id))&&(i.form=n.form||null));case h.ChannelState.Missed:if(e.attempt_id&&(i=this.task.get(e.attempt_id))){i.stopAt=e.timestamp;n=e;if(n)return i.setMissed(),this.setChannelStateTimeout(e.channel,e,n.missed.timeout),this.task.delete(e.attempt_id),this.client.reportingChannelTask(i),i;throw new Error("bad event")}break;case h.ChannelState.WrapTime:if(e.attempt_id){if(!e)throw new Error("bad event");i=this.task.get(e.attempt_id),this.task.delete(e.attempt_id),this.client.reportingChannelTask(i)}break;case h.ChannelState.Processing:if(e.attempt_id){n=e;if(!n)throw new Error("bad event");if(i=this.task.get(e.attempt_id))return i.setProcessing(e.timestamp,n.processing),this.setChannelStateTimeout(e.channel,e,n.processing.timeout||0),i}break;case h.ChannelState.Waiting:e.attempt_id&&(i=this.task.get(e.attempt_id))&&(i.setClosed(e.timestamp),this.task.delete(e.attempt_id),this.client.reportingChannelTask(i))}if(this.setChannelState(e.channel,e),i)return i.setState(e.status),i},o.prototype.online=function(t,n){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.agentSetOnline(this.agentId,t,n)]})})},o.prototype.waiting=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.agentSetWaiting(this.agentId,t)]})})},o.prototype.pause=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.agentSetPause(this.agentId,t)]})})},o.prototype.offline=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.agentSetOffline(this.agentId)]})})},o.prototype.setStatus=function(e){e.status===h.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||null,this.lastStatusChange=Date.now()},o.prototype.directMember=function(t,n){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("cc_member_direct",{agent_id:this.agentId,member_id:t,communication_id:n})]})})},o.prototype.offlineMembers=function(t,n,r){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("cc_fetch_offline_members",{agent_id:this.agentId,page:n,q:t,per_page:r})]})})},o.prototype.hasTask=function(e){return this.task.has(e.id)},o.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},o.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};var mn=o;function o(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}(K=h.CallReportingStatus||(h.CallReportingStatus={})).Abandoned="abandoned",K.Cancel="cancel",K.Success="success",(K=h.CallActions||(h.CallActions={})).Ringing="ringing",K.Active="active",K.Bridge="bridge",K.Hold="hold",K.DTMF="dtmf",K.Voice="voice",K.Silence="silence",K.Execute="execute",K.Update="update",K.Hangup="hangup",K.Reporting="reporting",K.PeerStream="peerStream",K.LocalStream="localStream",K.Destroy="destroy",(K=h.CallDirection||(h.CallDirection={})).Inbound="inbound",K.Outbound="outbound";u.prototype.setState=function(e){this.state=e.event},u.prototype.setSip=function(e){e&&!this.sip&&(this.sip=e,this.localStreams=e.getLocalMedia(),this.peerStreams=e.getPeerMedia())},Object.defineProperty(u.prototype,"duration",{get:function(){return 0===this.hangupAt?Math.round((Date.now()-this.createdAt)/1e3):Math.round((this.hangupAt-this.createdAt)/1e3)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"allowDtmf",{get:function(){return 0<this.answeredAt&&this.allowHangup},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"allowHangup",{get:function(){return 0===this.hangupAt},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"allowHold",{get:function(){return 0===this.hangupAt&&("active"===this.state||"bridge"===this.state)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"allowAnswer",{get:function(){return this.client.phone&&0===this.hangupAt&&0===this.answeredAt&&(this.queue||this.direction===h.CallDirection.Inbound||this.params&&!this.params.autoAnswer)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"allowUnHold",{get:function(){return 0===this.hangupAt&&"hold"===this.state},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"memberCommunication",{get:function(){return this.task?this.task.communication:null},enumerable:!0,configurable:!0}),u.prototype.getMember=function(e){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.isMember)return[2,this.client.request("cc_member_page",{queue_id:this.task.queueId,member_id:this.task.memberId})];throw new Error("call is not from outbound queue")})})},Object.defineProperty(u.prototype,"isMember",{get:function(){return!(!this.task||!this.task.isMember)},enumerable:!0,configurable:!0}),u.prototype.setActive=function(e){this.answeredAt||(this.direction===h.CallDirection.Inbound&&(this.bridgedAt=+e.timestamp,this.parentId&&(this.bridgedId=this.parentId)),this.answeredAt=+e.timestamp),this.setState(e)},u.prototype.setBridged=function(e){var t=e.data;this.bridgedAt||(this.bridgedAt=+e.timestamp),this.bridgedId=t.bridged_id,t.to&&(this.direction===h.CallDirection.Inbound?this.from=t.to:this.to=t.to),this.bridgedId=t.bridged_id,t.payload&&(this.variables=t.payload),t.queue&&(this.queue=t.queue)},u.prototype.setHold=function(e){this.setState(e)},u.prototype.setInfo=function(e){this.parentId=e.parent_id,this.destination=e.destination,this.direction=e.direction,this.from=e.from,this.to=e.to,this.variables=e.payload,this.queue=e.queue||null,this.sipId=e.sip_id||null,this.params=e.params},u.prototype.setPeerStreams=function(e){this.peerStreams=e||[]},u.prototype.setLocalStreams=function(e){this.localStreams=e||[]},u.prototype.setVoice=function(){this.voice=!0},u.prototype.setSilence=function(){this.voice=!1},u.prototype.setExecute=function(e){this.applications.push(e.application)},u.prototype.addDigit=function(e){this.digits.push(e.digit)},u.prototype.setHangup=function(e){var t=e.data;this.hangupAt=+e.timestamp,this.hangupCause=t.cause,this.hangupSipCode=t.sip,this.voice=!1,this.peerStreams=[],+t.reporting_at&&(this.reportingAt=+t.reporting_at),this.setState(e)},Object.defineProperty(u.prototype,"allowReporting",{get:function(){return 0<this.answeredAt&&this.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"hasReporting",{get:function(){return!!this.task&&this.task.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"display",{get:function(){return this.displayNumber+" ("+this.displayName+")"},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"muted",{get:function(){return this._muted},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"isHold",{get:function(){return this.state===h.CallActions.Hold},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"allowInboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"allowOutboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"active",{get:function(){return 0===this.hangupAt},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"displayNumber",{get:function(){return"inbound"===this.direction?this.from.number:this.to?this.to.number:this.destination},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"displayName",{get:function(){return"inbound"===this.direction?this.from.name:this.to?this.to.name:this.destination},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"autoAnswer",{get:function(){return this.queue&&"offline"===this.queue.queue_type||this.params&&!0===this.params.autoAnswer},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"attempt",{get:function(){return this.task},enumerable:!0,configurable:!0}),u.prototype.answer=function(n){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){switch(e.label){case 0:if(!this.sip||!this.client.phone)return[3,6];e.label=1;case 1:return e.trys.push([1,4,,5]),[4,this.client.phone.callOption(n)];case 2:return t=e.sent(),[4,this.sip.answer(t)];case 3:return e.sent(),[3,5];case 4:return t=e.sent(),this.client.handleError(t),[3,5];case 5:return[2,!0];case 6:return[2,!1]}})})},u.prototype.answerDelay=function(t,e){var n=this;this.autoAnswered||(this.autoAnswered=!0,setTimeout(function(){return N.__awaiter(n,void 0,void 0,function(){return N.__generator(this,function(e){switch(e.label){case 0:return[4,this.answer(t)];case 1:return e.sent(),[2]}})})},e))},u.prototype.hangup=function(n){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){return t=n,0!==this.answeredAt||n||(t=this.direction===h.CallDirection.Inbound?"USER_BUSY":"ORIGINATOR_CANCEL"),[2,this.client.request("call_hangup",{id:this.id,app_id:this.appId,cause:t})]})})},u.prototype.eavesdrop=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return t.id=this.id,[2,this.client.request("call_eavesdrop",t)]})})},u.prototype.toggleHold=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return this.state===h.CallActions.Hold?[2,this.unHold()]:[2,this.hold()]})})},u.prototype.hold=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.state===h.CallActions.Hold)throw new Error("Call is hold");return[2,this.client.request("call_hold",{id:this.id,app_id:this.appId})]})})},u.prototype.unHold=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.state!==h.CallActions.Hold)throw new Error("Call is active");return[2,this.client.request("call_unhold",{id:this.id,app_id:this.appId})]})})},u.prototype.sendDTMF=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("call_dtmf",{id:this.id,app_id:this.appId,dtmf:t})]})})},u.prototype.blindTransfer=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("call_blind_transfer",{id:this.id,app_id:this.appId,destination:t})]})})},u.prototype.mute=function(n){return void 0===n&&(n=!1),N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.request("call_mute",{id:this.id,app_id:this.appId,mute:n})];case 1:return t=e.sent(),this._muted=n,[2,t]}})})},u.prototype.bridgeTo=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("call_bridge",{from_id:this.id,from_app_id:this.appId,to_id:t.id,to_app_id:t.appId})]})})},u.prototype.reporting=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.task)return[2,this.task.reporting(t)];throw new Error("this call not in queue")})})},u.prototype.renew=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.task)return[2,this.task.renew(t)];throw new Error("this conversation not in queue")})})},u.prototype.callToUser=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return t.nodeId=this.appId,t.parentCallId=this.id||null,t.sendToCallId=this.parentId||null,[2,this.client.inviteToUser(t)]})})};var qn=u;function u(e,t){this.client=e;var n=t.data;this._muted=!1,this.voice=!0,this.createdAt=+t.timestamp,this.task=null,this.data=null,this.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)}(K=h.DeclineCause||(h.DeclineCause={})).Timeout="TIMEOUT",K.Busy="BUSY",K.Cancel="CANCEL",(K=h.ChatActions||(h.ChatActions={})).Message="message",K.UserInvite="user_invite",K.Invite="invite_conversation",K.Joined="join_conversation",K.Close="close_conversation",K.Leave="leave_conversation",K.Decline="decline_invite",K.Update="update_channel",K.Destroy="destroy",(K=h.ConversationState||(h.ConversationState={})).Init="init",K.Invite="invite",K.Active="active",K.Pending="pending",K.Closed="closed",S.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)})},S.prototype.setAnswered=function(e,t,n){this.state=h.ConversationState.Active,this.answeredAt=t,this.channelId=e,this.member=Cn(n),this.inviteId=null},S.prototype.setClosed=function(e){this.state=h.ConversationState.Closed,this.closedAt=e},S.prototype.setDecline=function(e){this.state=h.ConversationState.Closed,this.closedAt=e.timestamp,this._cause=e.cause||null},Object.defineProperty(S.prototype,"id",{get:function(){return this.channelId||this.inviteId||this.conversationId},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"cause",{get:function(){return this._cause},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"messages",{get:function(){return this.getMessages()},enumerable:!0,configurable:!0}),S.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})},S.prototype.next=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){throw new Error("TODO")})})},S.prototype.pagination=function(e,t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){throw new Error("TODO")})})},S.prototype.newMessage=function(e){this._messages.push(e)},Object.defineProperty(S.prototype,"allowDecline",{get:function(){return!!this.inviteId},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"allowJoin",{get:function(){return!!this.inviteId},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"allowLeave",{get:function(){return!(!this.channelId||0!==this.closedAt&&this.hasReporting)},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"allowReporting",{get:function(){return 0<this.answeredAt&&this.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"hasReporting",{get:function(){return this._hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(S.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(S.prototype,"attempt",{get:function(){return this.task},enumerable:!0,configurable:!0}),S.prototype.decline=function(n){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){if(this.inviteId)return(t=n)||0!==this.answeredAt||(t=h.DeclineCause.Busy),[2,this.client.request("decline_chat",{invite_id:this.inviteId,cause:t})];throw new Error("This conversation is joined")})})},S.prototype.join=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.inviteId)return[2,this.client.request("join_chat",{invite_id:this.inviteId})];throw new Error("This conversation is joined")})})},S.prototype.close=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.channelId)return[2,this.client.request("close_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:t})];throw new Error("This conversation not active")})})},S.prototype.leave=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.channelId)return 0===this.closedAt||this.hasReporting||this.cause===h.DeclineCause.Busy?[2,this.client.request("leave_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:t})]:[2,this.client.destroyConversation(this)];throw new Error("This conversation not active")})})},S.prototype.sendText=function(r){return N.__awaiter(this,void 0,void 0,function(){var t,n;return N.__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]}})})},S.prototype.sendFile=function(n,r){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.storeFile(this.conversationId,[n],r)];case 1:return t=e.sent(),t=t[0],[2,this.client.request("send_file_chat",{channel_id:this.channelId,conversation_id:this.conversationId,id:t.id,name:n.name,mime:t.mime,url:t.shared,size:t.size})]}})})},S.prototype.send=function(t,n){return N.__awaiter(this,void 0,void 0,function(){return N.__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")})})},S.prototype.addToChat=function(t,n){return N.__awaiter(this,void 0,void 0,function(){return N.__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})]})})},S.prototype.startChat=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("start_chat",{user_id:t})]})})},S.prototype.updateChannel=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("update_channel_chat",{channel_id:this.channelId})]})})},S.prototype.reporting=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.task)return[2,this.task.reporting(t)];throw new Error("this conversation not in queue")})})},S.prototype.renew=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.task)return[2,this.task.renew(t)];throw new Error("this conversation not in queue")})})},S.prototype.transferToPlan=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("blind_transfer_chat",{conversation_id:this.conversationId,channel_id:this.channelId,plan_id:t})]})})},S.prototype.transferToUser=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("transfer_user_chat",{conversation_id:this.conversationId,channel_id:this.channelId,user_id:t})]})})},S.prototype.sendMessageTextChunk=function(e){return this.client.request("send_text_chat",{channel_id:this.channelId,conversation_id:this.conversationId,text:e})},S.prototype.messageMember=function(e){if(this.member&&e.channel_id===this.channelId)return{self:!0};for(var t=0,n=this.members;t<n.length;t++){var r=n[t];if(r.id===e.channel_id)return r}return null};var An=S;function S(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(Cn),this._messages=i||[],this.state=h.ConversationState.Invite,this.variables={},this._hasReporting=!(!a||"true"!==a.cc_reporting),this._autoAnswer=!1,this._cause=null,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 Cn(e){return e.messenger=e.type,e}Rn=Error,N.__extends(Kn,Rn),Kn.id="device_not_found";var Rn,Sn=Kn;function Kn(e){e=Rn.call(this,e)||this;return e.id=Kn.id,e}Pn=Error,N.__extends(Tn,Pn),Tn.id="device_not_allow";var Pn,On=Tn;function Tn(e){e=Pn.call(this,e)||this;return e.id=Tn.id,e}kn=O.EventEmitter,N.__extends(Wn,kn),Wn.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()}},Wn.prototype.send=function(e){return this.socket.send(JSON.stringify(e)),null},Wn.prototype.close=function(e){this.socket.close(e||1e3),delete this.socket},Wn.prototype.onOpen=function(){this.emit("open")},Wn.prototype.onClose=function(e){this.emit("close",e),this.off("*")},Wn.prototype.onMessage=function(e){"\0\0\0\0"!==e&&(e=JSON.parse(e),this.emit("message",e))};var kn,In=Wn;function Wn(e){var t=kn.call(this)||this;return t.host=e,t}var Xn,xn,En="call",Qn="chat",jn="user_state",Un="agent_status",K=((K=Xn=Xn||{}).NotFoundError="NotFoundError",K.NotAllowedError="NotAllowedError",(K=h.Response||(h.Response={})).STATUS_FAIL="FAIL",K.STATUS_OK="OK",xn=O.EventEmitter,N.__extends(P,xn),P.prototype.connect=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){switch(e.label){case 0:return[4,this.connectToSocket()];case 1:return e.sent(),[2]}})})},P.prototype.disconnect=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return this.socket.close(),[2]})})},P.prototype.subscribeCall=function(s,o){return N.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a;return N.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("subscribe_call",o)];case 1:if(t=e.sent(),this.eventHandler.on(En,s),t.items&&t.items.length)for(n=0,r=t.items;n<r.length;n++)(i=r[n]).hangup_at&&0<i.hangup_at&&!i.task||(a={cc_app_id:"",app_id:i.app_id,event:i.state,id:i.id,timestamp:Date.now(),data:{app_id:i.app_id,event:i.state,id:i.id,timestamp:Date.now(),cc_app_id:"",sip_id:"",parent_id:i.parent_id,direction:i.direction,destination:i.destination,queue:i.queue,from:i.from,to:i.to,payload:i.variables}},(a=new qn(this,a)).createdAt=i.created_at,a.answeredAt=i.answered_at||0,a.bridgedAt=i.bridged_at||0,a.hangupAt=i.hangup_at||0,i.task&&(a.task=new wn(this,{attempt_id:i.task.attempt_id,channel:i.task.channel,status:i.task.status,timestamp:Date.now()},i.task),a.queue.reporting="true",a.task.form=i.task.form||null,i.leaving_at&&i.task.processing_sec&&(a.task.startProcessingAt=i.leaving_at,a.task.setProcessing(i.leaving_at,{sec:i.task.processing_sec||0,timeout:i.task.processing_timeout_at||null,renewal_sec:i.task.processing_renewal_sec||0}))),this.callStore.set(a.id,a));return[2,t]}})})},P.prototype.subscribeChat=function(s,o){return N.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a;return N.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("subscribe_chat",o)];case 1:if(t=e.sent(),this.eventHandler.on(Qn,s),t&&t.items)for(n=0,r=t.items;n<r.length;n++){if(i=r[n],a=i.messages.reverse(),(a=new An(this,i.id,i.title,i.members,a,i.variables)).createdAt=i.created_at,a.closedAt=i.closed_at,i.task&&(a.task=new wn(this,{attempt_id:i.task.attempt_id,channel:i.task.channel,status:i.task.status,timestamp:Date.now()},i.task),i.leaving_at&&i.task.processing_sec&&(a.task.startProcessingAt=i.leaving_at,a.task.setProcessing(i.leaving_at,{sec:i.task.processing_sec||0,timeout:i.task.processing_timeout_at||null,renewal_sec:i.task.processing_renewal_sec||0})),a.task.form=i.task.form||null),i.invite_id)a.setInvite(i.invite_id,i.created_at);else{if(!i.channel_id){this.log.error("conversation "+i.id+" not valid");continue}a.setAnswered(i.channel_id,i.joined_at,{id:i.channel_id,name:"TODO",type:"webitel"})}this.conversationStore.set(a.id,a)}return[2,t]}})})},P.prototype.subscribeUsersStatus=function(n,r){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__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(jn,n),[2,t]}})})},P.prototype.subscribeAgentsStatus=function(n,r){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__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(Un,n),[2,t]}})})},P.prototype.subscribeTask=function(e){this.eventHandler.on("task",e)},P.prototype.subscribeJob=function(e){this.eventHandler.on("job",e)},P.prototype.unSubscribe=function(t,e,n){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("un_subscribe_"+t,n)]})})},P.prototype.destroy=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){switch(e.label){case 0:return[4,this.disconnect()];case 1:return(e.sent(),this.phone)?[4,this.phone.unregister()]:[3,3];case 2:e.sent(),this.phone.off("*"),delete this.phone,e.label=3;case 3:return this.eventHandler.off("*"),[2]}})})},P.prototype.allCall=function(){return Array.from(this.callStore.values())},P.prototype.allConversations=function(){return Array.from(this.conversationStore.values())},P.prototype.allTask=function(){return this.agent?Array.from(this.agent.task.values()):[]},P.prototype.allJob=function(){return this.allTask().filter(Gn)},P.prototype.callById=function(e){if(this.callStore.has(e))return this.callStore.get(e)},P.prototype.conversationById=function(e){if(this.conversationStore.has(e))return this.conversationStore.get(e)},P.prototype.callBySipId=function(e){for(var t=0,n=this.allCall();t<n.length;t++){var r=n[t];if(r.sipId&&e.startsWith(r.sipId))return r}},P.prototype.reportingTask=function(t,n){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("cc_reporting",N.__assign({attempt_id:t},n))]})})},P.prototype.agentActiveTasks=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("cc_agent_tasks",{agent_id:t})]})})},P.prototype.auth=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("authentication_challenge",{token:this._config.token})]})})},P.prototype.ping=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("ping",{ping:1})]})})},P.prototype.sessionInfo=function(){return this.connectionInfo.session},Object.defineProperty(P.prototype,"version",{get:function(){return this.connectionInfo.server_version},enumerable:!0,configurable:!0}),Object.defineProperty(P.prototype,"buildVersion",{get:function(){return'"0.1.147"'},enumerable:!0,configurable:!0}),Object.defineProperty(P.prototype,"instanceId",{get:function(){return this.connectionInfo.sock_id},enumerable:!0,configurable:!0}),P.prototype.agentSession=function(){return N.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l,d;return N.__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 mn(this,t),[4,this.agentActiveTasks(this.agent.agentId)];case 2:for(t=e.sent(),n=0,r=t.items;n<r.length;n++)i=r[n],(a=new wn(this,{status:i.status,timestamp:Date.now(),channel:i.channel,attempt_id:i.attempt_id},i)).postProcessData={},a.setState(i.state),i.bridged_at&&(a.bridgedAt=i.bridged_at,a.answeredAt=i.bridged_at),i.leaving_at&&(a.closedAt=i.leaving_at),i.leaving_at&&i.processing_sec&&(a.startProcessingAt=i.leaving_at,a.setProcessing(i.leaving_at,{sec:i.processing_sec||0,timeout:i.processing_timeout_at||null,renewal_sec:i.processing_renewal_sec||0})),a.form=i.form||null,this.agent.task.set(a.id,a);for(s=0,o=this.allCall();s<o.length;s++)(u=o[s]).task&&this.agent.task.set(u.task.id,u.task);for(c=0,l=this.allConversations();c<l.length;c++)(d=l[c]).task&&this.agent.task.set(d.task.id,d.task);return[2,this.agent]}})})},P.prototype.invite=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("call_invite",t)]})})},P.prototype.call=function(n){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){switch(e.label){case 0:if(!this.phone)return[3,5];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.phone.call(n)];case 2:return e.sent(),[3,4];case 3:return t=e.sent(),this.handleError(t),[3,4];case 4:return[3,7];case 5:return[4,this.invite(n)];case 6:e.sent(),e.label=7;case 7:return[2]}})})},P.prototype.callRecordId=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("call_recordings",{id:t})]})})},P.prototype.eavesdrop=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("call_eavesdrop",t)]})})},P.prototype.agentSetOnline=function(t,n,r){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("cc_agent_online",{agent_id:t,channels:n,on_demand:r})]})})},P.prototype.agentSetWaiting=function(t,n){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("cc_agent_waiting",{agent_id:t,channel:n})]})})},P.prototype.agentSetPause=function(t,n){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("cc_agent_pause",{agent_id:t,payload:n})]})})},P.prototype.agentSetOffline=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("cc_agent_offline",{agent_id:t})]})})},P.prototype.inviteToUser=function(e){return this.request("call_user",e)},P.prototype.answer=function(n,r){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){return(t=this.callById(n))?[2,t.answer(r)]:[2]})})},P.prototype.request=function(n,r){var i=this;return new Promise(function(e,t){i.queueRequest.set(++i.reqSeq,{resolve:e,reject:t}),i.socket.send({seq:i.reqSeq,action:n,data:r})})},P.prototype.useWebPhone=function(){return this._config.registerWebDevice||!1},P.prototype.callDestroyed=function(e){return 0<e.hangupAt&&!this.hasAgentTask(e.task)},P.prototype.conversationDestroyed=function(e){return 0<e.closedAt&&!this.hasAgentTask(e.task)&&(e.hasReporting||-1<[h.DeclineCause.Busy,h.DeclineCause.Timeout].indexOf(e.cause))},P.prototype.reportingChannelTask=function(e){switch(e.channel){case bn.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 bn.Chat:if(e.agentChannelId){var i=this.conversationById(e.agentChannelId);if(i&&this.conversationDestroyed(i))return void this.destroyConversation(i)}}},P.prototype.registerCallClient=function(n){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){switch(e.label){case 0:this.phone=n,this.subscribePhone(n),e.label=1;case 1:return e.trys.push([1,4,,5]),[4,this.deviceConfig(this.phone.type)];case 2:return t=e.sent(),[4,this.phone.register(t)];case 3:return e.sent(),[3,5];case 4:return t=e.sent(),this.log.error(t),[3,5];case 5:return[2]}})})},P.prototype.subscribePhone=function(e){var n=this;e.on("peerStreams",function(e,t){e=n.callBySession(e);e&&!e.peerStreams.length&&(e.setPeerStreams(t),n.eventHandler.emit(En,h.CallActions.PeerStream,e))}),e.on("localStreams",function(e,t){e=n.callBySession(e);e&&!e.localStreams.length&&(e.setLocalStreams(t),n.eventHandler.emit(En,h.CallActions.LocalStream,e))}),e.on("newSession",this.onNewCallSession.bind(this)),e.on("registered",function(){return n.emit("phone_registered",!0)}),e.on("unregistered",function(){return n.emit("phone_registered",!1)})},P.prototype.deviceConfig=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("user_default_device",{name:t})]})})},P.prototype.storeFile=function(l,d,_){return N.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return N.__generator(this,function(e){switch(e.label){case 0:if(!d||d.length<1)throw new Error("no files");for(t=new FormData,n=0,r=d;n<r.length;n++)i=r[n],t.append(i.name,i);return[4,B.post(this.basePath+"/api/storage/file/"+l+"/upload",t,{headers:((c={})["X-Webitel-Access"]=this._config.token,c),onUploadProgress:_})];case 1:for(c=e.sent(),a=c.data,s=0,o=a;s<o.length;s++)(u=o[s]).shared=this.basePath+u.shared;return[2,a]}})})},P.prototype.fileUrlDownload=function(e){return this.basePath+"/api/storage/file/"+e+"/download?access_token="+this._config.token},P.prototype.fileUrlStream=function(e){return this.basePath+"/api/storage/file/"+e+"/stream?access_token="+this._config.token},P.prototype.handleError=function(e){if(e)switch(e.name){case Xn.NotFoundError:this.emit("error",new Sn(e.message));break;case Xn.NotAllowedError:this.emit("error",new On(e.message));break;default:this.emit("error",e)}},P.prototype.destroyConversation=function(e){this.conversationStore.delete(e.id),this.eventHandler.emit(Qn,h.ChatActions.Destroy,e)},P.prototype.onMessage=function(n){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__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===h.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 En:return[3,4];case Qn:return[3,6];case jn:return[3,8];case"sip":return[3,9];case Un: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]}})})},P.prototype.handleAgentStatus=function(e){this.agent&&e.agent_id===this.agent.agentId&&this.agent.setStatus(e),this.eventHandler.emit(Un,e,this.agent)},P.prototype.handleChannelEvents=function(e){var t;this.agent&&(e.timestamp=Date.now(),t=this.agent.onChannelEvent(e)||void 0,this.eventHandler.emit("task",e.status,t),t&&Gn(t)&&(this.eventHandler.emit("job",t.state,t),e=t.state,-1<[h.ChannelState.Missed.toString(),h.ChannelState.Waiting,h.ChannelState.WrapTime,h.JobState.Closed].indexOf(e)&&this.eventHandler.emit("job",h.JobState.Destroy,t)))},P.prototype.pingServer=function(){return N.__awaiter(this,void 0,void 0,function(){var t,n=this;return N.__generator(this,function(e){switch(e.label){case 0:return this.pingTimer&&this.connectionInfo.ping_interval?(t=setTimeout(function(){return N.__awaiter(n,void 0,void 0,function(){return N.__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]}})})},P.prototype.connected=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__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 yn(this.instanceId,this._config.debug))]:[2]}})})},P.prototype.callBySession=function(e){for(var t=0,n=this.allCall();t<n.length;t++){var r=n[t];if(r.sip===e)return r}},P.prototype.onNewCallSession=function(n){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){return(t=n.callId?this.callById(n.callId):this.callBySipId(n.id))&&(t.setSip(n),this.checkAutoAnswer(t)),[2]})})},P.prototype.checkAutoAnswer=function(e){e.autoAnswer&&e.answerDelay({video:e.params.video,screen:e.params.screen,disableStun:e.params.disableStun},300)},P.prototype.connectToSocket=function(){var n=this;return new Promise(function(e,t){try{n.socket=new In(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")})})},P.prototype.handleUserStateEvent=function(e){this.eventHandler.emit(jn,e)},P.prototype.handleCallEvents=function(n){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){switch(n.timestamp=Date.now(),n.event){case h.CallActions.Ringing:t=new qn(this,n),this.callStore.set(t.id,t),this.checkAutoAnswer(t);break;case h.CallActions.Active:(t=this.callById(n.id))&&t.setActive(n);break;case h.CallActions.Bridge:(t=this.callById(n.id))&&t.setBridged(n);break;case h.CallActions.Execute:(t=this.callById(n.id))&&t.setExecute(n.data);break;case h.CallActions.DTMF:(t=this.callById(n.id))&&t.addDigit(n.data);break;case h.CallActions.Voice:(t=this.callById(n.id))&&t.setVoice();break;case h.CallActions.Silence:(t=this.callById(n.id))&&t.setSilence();break;case h.CallActions.Hold:(t=this.callById(n.id))&&t.setHold(n);break;case h.CallActions.Hangup:(t=this.callById(n.id))&&t.setHangup(n);break;default:throw new Error("Unhandled action")}return t&&(this.eventHandler.emit(En,n.event,t),this.callDestroyed(t)&&this.destroyCall(t)),[2]})})},P.prototype.handleChatEvents=function(_){return N.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l,d;return N.__generator(this,function(e){switch(n=Date.now(),_.action){case h.ChatActions.UserInvite:r=_.data,(t=new An(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 h.ChatActions.Joined:r=_.data,(t=this.conversationById(r.member.id))&&t.setAnswered(r.member.id,n,r.member);break;case h.ChatActions.Message:for((i=_.data).timestamp=n,a=0,s=this.allConversations();a<s.length;a++)!(l=s[a]).closedAt&&-1<l.membersId.indexOf(i.channel_id)&&(t=l);t&&t.newMessage(i);break;case h.ChatActions.Close:for(o=_.data,u=0,c=this.allConversations();u<c.length;u++)!(l=c[u]).closedAt&&-1<l.membersId.indexOf(o.from_channel_id)&&(t=l);t&&t.setClosed(n);break;case h.ChatActions.Leave:d=_.data,(t=this.conversationById(d.leaved_channel_id))&&t.setClosed(n);break;case h.ChatActions.Decline:d=_.data,(t=this.conversationById(d.invite_id))&&t.setDecline(d)}return t&&(this.eventHandler.emit(Qn,_.action,t),this.conversationDestroyed(t)&&this.destroyConversation(t)),[2]})})},P.prototype.hasAgentTask=function(e){return!(!this.agent||!e)&&this.agent.hasTask(e)},P.prototype.destroyCall=function(e){this.callStore.delete(e.id),this.eventHandler.emit(En,h.CallActions.Destroy,e)},P);function P(e){var t=xn.call(this)||this;return t._config=e,t.reqSeq=0,t.queueRequest=new Map,t.log=new hn,t.eventHandler=new O.EventEmitter,t.callStore=new Map,t.conversationStore=new Map,t.pingTimer=null,t.basePath=""+(e=(e=(e=(e=e.storageEndpoint||e.endpoint).replace(/^ws/,"http")).endsWith("/")?e.slice(0,-1):e).endsWith("/ws")?e.slice(0,-3):e),t}function Gn(e){return e.channel===bn.Task}Bn=O.EventEmitter,N.__extends(Hn,Bn);var Bn,Mn=Hn;function Hn(){return null!==Bn&&Bn.apply(this,arguments)||this}var Ln="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(function(c){var e=Ln&&Ln.__generator||function(r,i){var a,s,o,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(n){return function(e){var t=[n,e];if(a)throw new TypeError("Generator is already executing.");for(;u;)try{if(a=1,s&&(o=2&t[0]?s.return:t[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,t[1])).done)return o;switch(s=0,(t=o?[2&t[0],o.value]:t)[0]){case 0:case 1:o=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,s=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(o=0<(o=u.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3])){u.label=t[1];break}if(6===t[0]&&u.label<o[1]){u.label=o[1],o=t;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(t);break}o[2]&&u.ops.pop(),u.trys.pop();continue}t=i.call(r,u)}catch(e){t=[6,e],s=0}finally{a=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},t=(Object.defineProperty(c,"__esModule",{value:!0}),c.$listeners=Symbol("EventEmitter.listeners"),c.$addListener=Symbol("EventEmitter.addListener"),n.count=function(e,t){var n=0,e=e[c.$listeners][t];if(e)for(var r=e.first;++n&&r.next;)r=r.next;return n},n.has=function(e,t){if("*"!=t)return void 0!==e[c.$listeners][t];for(t in e[c.$listeners])return!0;return!1},n.keys=function(e){return Object.keys(e[c.$listeners])},n.unhandle=function(n,r,i,e){return n.on(r,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!n[c.$listeners][r].first.next)return i.apply(void 0,e)},e)},n.prototype.on=function(e,t,n){return"function"==typeof t?this[c.$addListener](e,t,n):this[c.$addListener](e,void 0,t)},n.prototype.one=function(e,t,n){return"function"==typeof t?this[c.$addListener](e,t,n,!0):this[c.$addListener](e,void 0,t,!0)},n.prototype.off=function(e,t){if("*"==e){var n=this[c.$listeners];if(this[c.$listeners]={},this._onEventUnhandled)for(var r in n)this._onEventUnhandled(r)}else{if("function"==typeof t){n=this[c.$listeners][e];if(n&&function(e,t){var n=null,r=e.first;for(;;)if(t(r))if(n){if(n.next=r.next,!r.next)break;r=r.next}else{if(!r.next)return;e.first=r=r.next}else{if(!(n=r).next)break;r=r.next}return e.last=n,e}(n,function(e){return e.fn==t}))return this}delete this[c.$listeners][e],this._onEventUnhandled&&this._onEventUnhandled(e)}return this},n.prototype.emit=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];for(var i=this.listeners(e);;){var a=i.next(),s=a.value;if(a.done)return t;a=s.apply(void 0,n);void 0!==a&&(t=a)}},n.prototype.listeners=function(t){var n,r,i;return e(this,function(e){switch(e.label){case 0:if(!(n=this[c.$listeners][t]))return[2];r=null,i=n.first,e.label=1;case 1:return[4,i.fn];case 2:if(e.sent(),i.once){if(!r)return i.next?(n.first=i=i.next,[3,1]):(delete this[c.$listeners][t],this._onEventUnhandled&&this._onEventUnhandled(t),[2]);r.next=i.next}else r=i;return i.next?(i=i.next,[3,1]):(n.last=i,[2]);case 3:return[2]}})},n.prototype[c.$addListener]=function(n,e,r,i){var t,a,s=this;if(void 0===i&&(i=!1),"object"!=typeof n)return"function"==typeof e&&(a=l(this[c.$listeners],t=n,{fn:e,once:i,next:null}),r&&r.push({dispose:function(){return s.off(t,e)}}),e==a.first.fn&&this._onEventHandled&&this._onEventHandled(n)),e;var o,u=this;for(o in n)!function(){var e,t;"function"==typeof n[o]&&(e=n[o],t=l(u[c.$listeners],o,{fn:e,once:i,next:null}),r&&r.push({dispose:function(){return s.off(o,e)}}),e==t.first.fn&&u._onEventHandled&&u._onEventHandled(o))}();return this},n.ev=c.$listeners,n);function n(){this[c.$listeners]={}}function l(e,t,n){var r=e[t];return r?(r.last.next=n,r.last=n):e[t]=r={first:n,last:n},r}c.EventEmitter=t})((Dn={exports:{}},Dn.exports));var Dn=Dn.exports,Fn=((Fn=Dn)&&Fn.__esModule&&Object.prototype.hasOwnProperty.call(Fn,"default")&&Fn.default,Dn.$listeners,Dn.$addListener,Dn.EventEmitter),Nn=(Object.defineProperty(Jn.prototype,"id",{get:function(){return this.callId},enumerable:!0,configurable:!0}),Jn.prototype.getLocalMedia=function(){return[]},Jn.prototype.getPeerMedia=function(){return[]},Jn.prototype.answer=function(e){var t=this;return new Promise(function(e){t.client.answer(t.id),e()})},Jn);function Jn(e,t){this.client=e,this.callId=t,this.incoming=!1,this.instanceId="fixme"}zn=Fn,N.__extends(Vn,zn),Vn.prototype.callOption=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,t]})})},Vn.prototype.register=function(e){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2]})})},Vn.prototype.unregister=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2]})})},Vn.prototype.call=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return t.destination&&this.exec(t.destination),[2]})})},Vn.prototype.answer=function(e){this.exec(e,"answer")},Vn.prototype.sipSessionByCallId=function(e){return new Nn(this,e)},Vn.prototype.sipSessionBySipId=function(e){return null},Vn.prototype.open=function(e){this.exec(encodeURIComponent(JSON.stringify(N.__assign({token:e},this.config))),"open")},Vn.prototype.exec=function(e,t){e=""+this.schema+e,t&&(e+=" "+t),t=document.createElement("a");t.download="File name",t.href=e,t.click()};var zn,Dn=Vn;function Vn(e){var t=zn.call(this)||this;return t.config=e,t.type="external",t.schema="wtel://",t}h.AgentPauseCauseServiceApiAxiosParamCreator=X,h.AgentPauseCauseServiceApiFp=l,h.AgentPauseCauseServiceApiFactory=function(o,u,c){return{createAgentPauseCause:function(e,t){return l(o).createAgentPauseCause(e,t).then(function(e){return e(c,u)})},deleteAgentPauseCause:function(e,t){return l(o).deleteAgentPauseCause(e,t).then(function(e){return e(c,u)})},patchAgentPauseCause:function(e,t,n){return l(o).patchAgentPauseCause(e,t,n).then(function(e){return e(c,u)})},readAgentPauseCause:function(e,t){return l(o).readAgentPauseCause(e,t).then(function(e){return e(c,u)})},searchAgentPauseCause:function(e,t,n,r,i,a,s){return l(o).searchAgentPauseCause(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateAgentPauseCause:function(e,t,n){return l(o).updateAgentPauseCause(e,t,n).then(function(e){return e(c,u)})}}},h.AgentPauseCauseServiceApi=E,h.AgentServiceApiAxiosParamCreator=q,h.AgentServiceApiFp=A,h.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)})}}},h.AgentServiceApi=U,h.AgentSkillServiceApiAxiosParamCreator=G,h.AgentSkillServiceApiFp=d,h.AgentSkillServiceApiFactory=function(u,c,l){return{createAgentSkill:function(e,t,n){return d(u).createAgentSkill(e,t,n).then(function(e){return e(l,c)})},deleteAgentSkill:function(e,t,n,r){return d(u).deleteAgentSkill(e,t,n,r).then(function(e){return e(l,c)})},patchAgentSkill:function(e,t,n,r){return d(u).patchAgentSkill(e,t,n,r).then(function(e){return e(l,c)})},readAgentSkill:function(e,t,n,r){return d(u).readAgentSkill(e,t,n,r).then(function(e){return e(l,c)})},searchAgentSkill:function(e,t,n,r,i,a,s,o){return d(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 d(u).searchLookupAgentNotExistsSkill(e,t,n,r,i,a).then(function(e){return e(l,c)})},updateAgentSkill:function(e,t,n,r){return d(u).updateAgentSkill(e,t,n,r).then(function(e){return e(l,c)})}}},h.AgentSkillServiceApi=F,h.AgentTeamServiceApiAxiosParamCreator=V,h.AgentTeamServiceApiFp=$,h.AgentTeamServiceApiFactory=function(c,l,d){return{createAgentTeam:function(e,t){return $(c).createAgentTeam(e,t).then(function(e){return e(d,l)})},deleteAgentTeam:function(e,t,n){return $(c).deleteAgentTeam(e,t,n).then(function(e){return e(d,l)})},readAgentTeam:function(e,t,n){return $(c).readAgentTeam(e,t,n).then(function(e){return e(d,l)})},searchAgentTeam:function(e,t,n,r,i,a,s,o,u){return $(c).searchAgentTeam(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateAgentTeam:function(e,t,n){return $(c).updateAgentTeam(e,t,n).then(function(e){return e(d,l)})}}},h.AgentTeamServiceApi=Z,h.BackendProfileServiceApiAxiosParamCreator=te,h.BackendProfileServiceApiFp=_,h.BackendProfileServiceApiFactory=function(o,u,c){return{createBackendProfile:function(e,t){return _(o).createBackendProfile(e,t).then(function(e){return e(c,u)})},deleteBackendProfile:function(e,t,n){return _(o).deleteBackendProfile(e,t,n).then(function(e){return e(c,u)})},patchBackendProfile:function(e,t,n){return _(o).patchBackendProfile(e,t,n).then(function(e){return e(c,u)})},readBackendProfile:function(e,t,n){return _(o).readBackendProfile(e,t,n).then(function(e){return e(c,u)})},searchBackendProfile:function(e,t,n,r,i,a,s){return _(o).searchBackendProfile(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateBackendProfile:function(e,t,n){return _(o).updateBackendProfile(e,t,n).then(function(e){return e(c,u)})}}},h.BackendProfileServiceApi=re,h.BucketServiceApiAxiosParamCreator=ae,h.BucketServiceApiFp=se,h.BucketServiceApiFactory=function(o,u,c){return{createBucket:function(e,t){return se(o).createBucket(e,t).then(function(e){return e(c,u)})},deleteBucket:function(e,t,n){return se(o).deleteBucket(e,t,n).then(function(e){return e(c,u)})},readBucket:function(e,t,n){return se(o).readBucket(e,t,n).then(function(e){return e(c,u)})},searchBucket:function(e,t,n,r,i,a,s){return se(o).searchBucket(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateBucket:function(e,t,n){return se(o).updateBucket(e,t,n).then(function(e){return e(c,u)})}}},h.BucketServiceApi=ue,h.CalendarServiceApiAxiosParamCreator=le,h.CalendarServiceApiFp=p,h.CalendarServiceApiFactory=function(o,u,c){return{createCalendar:function(e,t){return p(o).createCalendar(e,t).then(function(e){return e(c,u)})},deleteCalendar:function(e,t,n){return p(o).deleteCalendar(e,t,n).then(function(e){return e(c,u)})},readCalendar:function(e,t,n){return p(o).readCalendar(e,t,n).then(function(e){return e(c,u)})},searchCalendar:function(e,t,n,r,i,a,s){return p(o).searchCalendar(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},searchTimezones:function(e,t,n,r){return p(o).searchTimezones(e,t,n,r).then(function(e){return e(c,u)})},updateCalendar:function(e,t,n){return p(o).updateCalendar(e,t,n).then(function(e){return e(c,u)})}}},h.CalendarServiceApi=_e,h.CallServiceApiAxiosParamCreator=H,h.CallServiceApiFp=L,h.CallServiceApiFactory=function(j,U,G){return{aggregateHistoryCall:function(e,t){return L(j).aggregateHistoryCall(e,t).then(function(e){return e(G,U)})},blindTransferCall:function(e,t,n){return L(j).blindTransferCall(e,t,n).then(function(e){return e(G,U)})},confirmPush:function(e,t){return L(j).confirmPush(e,t).then(function(e){return e(G,U)})},createCall:function(e,t){return L(j).createCall(e,t).then(function(e){return e(G,U)})},createCallAnnotation:function(e,t,n){return L(j).createCallAnnotation(e,t,n).then(function(e){return e(G,U)})},deleteCallAnnotation:function(e,t,n){return L(j).deleteCallAnnotation(e,t,n).then(function(e){return e(G,U)})},dtmfCall:function(e,t,n){return L(j).dtmfCall(e,t,n).then(function(e){return e(G,U)})},eavesdropCall:function(e,t,n){return L(j).eavesdropCall(e,t,n).then(function(e){return e(G,U)})},hangupCall:function(e,t,n){return L(j).hangupCall(e,t,n).then(function(e){return e(G,U)})},holdCall:function(e,t,n){return L(j).holdCall(e,t,n).then(function(e){return e(G,U)})},readCall:function(e,t,n){return L(j).readCall(e,t,n).then(function(e){return e(G,U)})},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 L(j).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(G,U)})},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,E,Q){return L(j).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,E,Q).then(function(e){return e(G,U)})},unHoldCall:function(e,t,n){return L(j).unHoldCall(e,t,n).then(function(e){return e(G,U)})},updateCallAnnotation:function(e,t,n,r){return L(j).updateCallAnnotation(e,t,n,r).then(function(e){return e(G,U)})}}},h.CallServiceApi=fe,h.CognitiveProfileServiceApiAxiosParamCreator=ge,h.CognitiveProfileServiceApiFp=f,h.CognitiveProfileServiceApiFactory=function(c,l,d){return{createCognitiveProfile:function(e,t){return f(c).createCognitiveProfile(e,t).then(function(e){return e(d,l)})},deleteCognitiveProfile:function(e,t){return f(c).deleteCognitiveProfile(e,t).then(function(e){return e(d,l)})},patchCognitiveProfile:function(e,t,n){return f(c).patchCognitiveProfile(e,t,n).then(function(e){return e(d,l)})},readCognitiveProfile:function(e,t){return f(c).readCognitiveProfile(e,t).then(function(e){return e(d,l)})},searchCognitiveProfile:function(e,t,n,r,i,a,s,o,u){return f(c).searchCognitiveProfile(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateCognitiveProfile:function(e,t,n){return f(c).updateCognitiveProfile(e,t,n).then(function(e){return e(d,l)})}}},h.CognitiveProfileServiceApi=ye,h.CommunicationTypeServiceApiAxiosParamCreator=we,h.CommunicationTypeServiceApiFp=me,h.CommunicationTypeServiceApiFactory=function(o,u,c){return{createCommunicationType:function(e,t){return me(o).createCommunicationType(e,t).then(function(e){return e(c,u)})},deleteCommunicationType:function(e,t,n){return me(o).deleteCommunicationType(e,t,n).then(function(e){return e(c,u)})},readCommunicationType:function(e,t,n){return me(o).readCommunicationType(e,t,n).then(function(e){return e(c,u)})},searchCommunicationType:function(e,t,n,r,i,a,s){return me(o).searchCommunicationType(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateCommunicationType:function(e,t,n){return me(o).updateCommunicationType(e,t,n).then(function(e){return e(c,u)})}}},h.CommunicationTypeServiceApi=Ae,h.EmailProfileServiceApiAxiosParamCreator=Re,h.EmailProfileServiceApiFp=c,h.EmailProfileServiceApiFactory=function(s,o,u){return{createEmailProfile:function(e,t){return c(s).createEmailProfile(e,t).then(function(e){return e(u,o)})},deleteEmailProfile:function(e,t){return c(s).deleteEmailProfile(e,t).then(function(e){return e(u,o)})},patchEmailProfile:function(e,t,n){return c(s).patchEmailProfile(e,t,n).then(function(e){return e(u,o)})},readEmailProfile:function(e,t){return c(s).readEmailProfile(e,t).then(function(e){return e(u,o)})},searchEmailProfile:function(e,t,n,r,i,a){return c(s).searchEmailProfile(e,t,n,r,i,a).then(function(e){return e(u,o)})},updateEmailProfile:function(e,t,n){return c(s).updateEmailProfile(e,t,n).then(function(e){return e(u,o)})}}},h.EmailProfileServiceApi=Ke,h.FileServiceApiAxiosParamCreator=Oe,h.FileServiceApiFp=Te,h.FileServiceApiFactory=function(n,r,i){return{deleteFiles:function(e,t){return Te(n).deleteFiles(e,t).then(function(e){return e(i,r)})}}},h.FileServiceApi=Ie,h.FileTranscriptServiceApiAxiosParamCreator=Xe,h.FileTranscriptServiceApiFp=xe,h.FileTranscriptServiceApiFactory=function(i,a,s){return{createFileTranscript:function(e,t){return xe(i).createFileTranscript(e,t).then(function(e){return e(s,a)})},deleteFileTranscript:function(e,t){return xe(i).deleteFileTranscript(e,t).then(function(e){return e(s,a)})},getFileTranscriptPhrases:function(e,t,n,r){return xe(i).getFileTranscriptPhrases(e,t,n,r).then(function(e){return e(s,a)})}}},h.FileTranscriptServiceApi=Qe,h.ImportTemplateServiceApiAxiosParamCreator=Ue,h.ImportTemplateServiceApiFp=g,h.ImportTemplateServiceApiFactory=function(o,u,c){return{createImportTemplate:function(e,t){return g(o).createImportTemplate(e,t).then(function(e){return e(c,u)})},deleteImportTemplate:function(e,t){return g(o).deleteImportTemplate(e,t).then(function(e){return e(c,u)})},patchImportTemplate:function(e,t,n){return g(o).patchImportTemplate(e,t,n).then(function(e){return e(c,u)})},readImportTemplate:function(e,t){return g(o).readImportTemplate(e,t).then(function(e){return e(c,u)})},searchImportTemplate:function(e,t,n,r,i,a,s){return g(o).searchImportTemplate(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateImportTemplate:function(e,t,n){return g(o).updateImportTemplate(e,t,n).then(function(e){return e(c,u)})}}},h.ImportTemplateServiceApi=Be,h.ListServiceApiAxiosParamCreator=He,h.ListServiceApiFp=v,h.ListServiceApiFactory=function(u,c,l){return{createList:function(e,t){return v(u).createList(e,t).then(function(e){return e(l,c)})},createListCommunication:function(e,t,n){return v(u).createListCommunication(e,t,n).then(function(e){return e(l,c)})},deleteList:function(e,t,n){return v(u).deleteList(e,t,n).then(function(e){return e(l,c)})},deleteListCommunication:function(e,t,n,r){return v(u).deleteListCommunication(e,t,n,r).then(function(e){return e(l,c)})},readList:function(e,t,n){return v(u).readList(e,t,n).then(function(e){return e(l,c)})},readListCommunication:function(e,t,n,r){return v(u).readListCommunication(e,t,n,r).then(function(e){return e(l,c)})},searchList:function(e,t,n,r,i,a,s){return v(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 v(u).searchListCommunication(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateList:function(e,t,n){return v(u).updateList(e,t,n).then(function(e){return e(l,c)})},updateListCommunication:function(e,t,n,r){return v(u).updateListCommunication(e,t,n,r).then(function(e){return e(l,c)})}}},h.ListServiceApi=De,h.MediaFileServiceApiAxiosParamCreator=Ne,h.MediaFileServiceApiFp=Je,h.MediaFileServiceApiFactory=function(o,u,c){return{deleteMediaFile:function(e,t,n){return Je(o).deleteMediaFile(e,t,n).then(function(e){return e(c,u)})},readMediaFile:function(e,t,n){return Je(o).readMediaFile(e,t,n).then(function(e){return e(c,u)})},searchMediaFile:function(e,t,n,r,i,a,s){return Je(o).searchMediaFile(e,t,n,r,i,a,s).then(function(e){return e(c,u)})}}},h.MediaFileServiceApi=Ve,h.MemberServiceApiAxiosParamCreator=C,h.MemberServiceApiFp=R,h.MemberServiceApiFactory=function(m,q,A){return{attemptCallback:function(e,t,n){return R(m).attemptCallback(e,t,n).then(function(e){return e(A,q)})},attemptResult:function(e,t,n,r,i){return R(m).attemptResult(e,t,n,r,i).then(function(e){return e(A,q)})},attemptsRenewalResult:function(e,t,n){return R(m).attemptsRenewalResult(e,t,n).then(function(e){return e(A,q)})},createAttempt:function(e,t,n,r){return R(m).createAttempt(e,t,n,r).then(function(e){return e(A,q)})},createMember:function(e,t,n){return R(m).createMember(e,t,n).then(function(e){return e(A,q)})},createMemberBulk:function(e,t,n){return R(m).createMemberBulk(e,t,n).then(function(e){return e(A,q)})},deleteMember:function(e,t,n,r){return R(m).deleteMember(e,t,n,r).then(function(e){return e(A,q)})},deleteMembers:function(e,t,n){return R(m).deleteMembers(e,t,n).then(function(e){return e(A,q)})},patchMember:function(e,t,n,r){return R(m).patchMember(e,t,n,r).then(function(e){return e(A,q)})},readMember:function(e,t,n,r){return R(m).readMember(e,t,n,r).then(function(e){return e(A,q)})},resetMembers:function(e,t,n){return R(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 R(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 R(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 R(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 R(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 R(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 R(m).updateMember(e,t,n,r).then(function(e){return e(A,q)})}}},h.MemberServiceApi=Ze,h.OutboundResourceGroupServiceApiAxiosParamCreator=et,h.OutboundResourceGroupServiceApiFp=y,h.OutboundResourceGroupServiceApiFactory=function(u,c,l){return{createOutboundResourceGroup:function(e,t){return y(u).createOutboundResourceGroup(e,t).then(function(e){return e(l,c)})},createOutboundResourceInGroup:function(e,t,n){return y(u).createOutboundResourceInGroup(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceGroup:function(e,t,n){return y(u).deleteOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceInGroup:function(e,t,n,r){return y(u).deleteOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})},readOutboundResourceGroup:function(e,t,n){return y(u).readOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},readOutboundResourceInGroup:function(e,t,n,r){return y(u).readOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})},searchOutboundResourceGroup:function(e,t,n,r,i,a,s){return y(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 y(u).searchOutboundResourceInGroup(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateOutboundResourceGroup:function(e,t,n){return y(u).updateOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},updateOutboundResourceInGroup:function(e,t,n,r){return y(u).updateOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})}}},h.OutboundResourceGroupServiceApi=nt,h.OutboundResourceServiceApiAxiosParamCreator=it,h.OutboundResourceServiceApiFp=b,h.OutboundResourceServiceApiFactory=function(u,c,l){return{createOutboundResource:function(e,t){return b(u).createOutboundResource(e,t).then(function(e){return e(l,c)})},createOutboundResourceDisplay:function(e,t,n){return b(u).createOutboundResourceDisplay(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResource:function(e,t,n){return b(u).deleteOutboundResource(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceDisplay:function(e,t,n,r){return b(u).deleteOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})},patchOutboundResource:function(e,t,n){return b(u).patchOutboundResource(e,t,n).then(function(e){return e(l,c)})},readOutboundResource:function(e,t,n){return b(u).readOutboundResource(e,t,n).then(function(e){return e(l,c)})},readOutboundResourceDisplay:function(e,t,n,r){return b(u).readOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})},searchOutboundResource:function(e,t,n,r,i,a,s){return b(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 b(u).searchOutboundResourceDisplay(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateOutboundResource:function(e,t,n){return b(u).updateOutboundResource(e,t,n).then(function(e){return e(l,c)})},updateOutboundResourceDisplay:function(e,t,n,r){return b(u).updateOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})}}},h.OutboundResourceServiceApi=st,h.QueueBucketServiceApiAxiosParamCreator=ot,h.QueueBucketServiceApiFp=ut,h.QueueBucketServiceApiFactory=function(u,c,l){return{createQueueBucket:function(e,t,n){return ut(u).createQueueBucket(e,t,n).then(function(e){return e(l,c)})},deleteQueueBucket:function(e,t,n){return ut(u).deleteQueueBucket(e,t,n).then(function(e){return e(l,c)})},patchQueueBucket:function(e,t,n,r){return ut(u).patchQueueBucket(e,t,n,r).then(function(e){return e(l,c)})},readQueueBucket:function(e,t,n){return ut(u).readQueueBucket(e,t,n).then(function(e){return e(l,c)})},searchQueueBucket:function(e,t,n,r,i,a,s,o){return ut(u).searchQueueBucket(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateQueueBucket:function(e,t,n,r){return ut(u).updateQueueBucket(e,t,n,r).then(function(e){return e(l,c)})}}},h.QueueBucketServiceApi=lt,h.QueueHookServiceApiAxiosParamCreator=_t,h.QueueHookServiceApiFp=ht,h.QueueHookServiceApiFactory=function(l,d,_){return{createQueueHook:function(e,t,n){return ht(l).createQueueHook(e,t,n).then(function(e){return e(_,d)})},deleteQueueHook:function(e,t,n){return ht(l).deleteQueueHook(e,t,n).then(function(e){return e(_,d)})},patchQueueHook:function(e,t,n,r){return ht(l).patchQueueHook(e,t,n,r).then(function(e){return e(_,d)})},readQueueHook:function(e,t,n){return ht(l).readQueueHook(e,t,n).then(function(e){return e(_,d)})},searchQueueHook:function(e,t,n,r,i,a,s,o,u,c){return ht(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 ht(l).updateQueueHook(e,t,n,r).then(function(e){return e(_,d)})}}},h.QueueHookServiceApi=ft,h.QueueResourcesServiceApiAxiosParamCreator=vt,h.QueueResourcesServiceApiFp=yt,h.QueueResourcesServiceApiFactory=function(u,c,l){return{createQueueResourceGroup:function(e,t,n){return yt(u).createQueueResourceGroup(e,t,n).then(function(e){return e(l,c)})},deleteQueueResourceGroup:function(e,t,n,r){return yt(u).deleteQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})},readQueueResourceGroup:function(e,t,n,r){return yt(u).readQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})},searchQueueResourceGroup:function(e,t,n,r,i,a,s,o){return yt(u).searchQueueResourceGroup(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateQueueResourceGroup:function(e,t,n,r){return yt(u).updateQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})}}},h.QueueResourcesServiceApi=wt,h.QueueServiceApiAxiosParamCreator=qt,h.QueueServiceApiFp=w,h.QueueServiceApiFactory=function(_,h,p){return{createQueue:function(e,t){return w(_).createQueue(e,t).then(function(e){return e(p,h)})},deleteQueue:function(e,t,n){return w(_).deleteQueue(e,t,n).then(function(e){return e(p,h)})},patchQueue:function(e,t,n){return w(_).patchQueue(e,t,n).then(function(e){return e(p,h)})},readQueue:function(e,t,n){return w(_).readQueue(e,t,n).then(function(e){return e(p,h)})},searchQueue:function(e,t,n,r,i,a,s,o){return w(_).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 w(_).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 w(_).updateQueue(e,t,n).then(function(e){return e(p,h)})}}},h.QueueServiceApi=Ct,h.QueueSkillServiceApiAxiosParamCreator=St,h.QueueSkillServiceApiFp=Kt,h.QueueSkillServiceApiFactory=function(p,f,g){return{createQueueSkill:function(e,t,n){return Kt(p).createQueueSkill(e,t,n).then(function(e){return e(g,f)})},deleteQueueSkill:function(e,t,n){return Kt(p).deleteQueueSkill(e,t,n).then(function(e){return e(g,f)})},patchQueueSkill:function(e,t,n,r){return Kt(p).patchQueueSkill(e,t,n,r).then(function(e){return e(g,f)})},readQueueSkill:function(e,t,n){return Kt(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 Kt(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 Kt(p).updateQueueSkill(e,t,n,r).then(function(e){return e(g,f)})}}},h.QueueSkillServiceApi=Ot,h.RegionServiceApiAxiosParamCreator=kt,h.RegionServiceApiFp=It,h.RegionServiceApiFactory=function(l,d,_){return{createRegion:function(e,t){return It(l).createRegion(e,t).then(function(e){return e(_,d)})},deleteRegion:function(e,t){return It(l).deleteRegion(e,t).then(function(e){return e(_,d)})},patchRegion:function(e,t,n){return It(l).patchRegion(e,t,n).then(function(e){return e(_,d)})},readRegion:function(e,t){return It(l).readRegion(e,t).then(function(e){return e(_,d)})},searchRegion:function(e,t,n,r,i,a,s,o,u,c){return It(l).searchRegion(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},updateRegion:function(e,t,n){return It(l).updateRegion(e,t,n).then(function(e){return e(_,d)})}}},h.RegionServiceApi=Xt,h.RoutingChatPlanServiceApiAxiosParamCreator=Et,h.RoutingChatPlanServiceApiFp=Qt,h.RoutingChatPlanServiceApiFactory=function(c,l,d){return{createChatPlan:function(e,t){return Qt(c).createChatPlan(e,t).then(function(e){return e(d,l)})},deleteChatPlan:function(e,t){return Qt(c).deleteChatPlan(e,t).then(function(e){return e(d,l)})},patchChatPlan:function(e,t,n){return Qt(c).patchChatPlan(e,t,n).then(function(e){return e(d,l)})},readChatPlan:function(e,t){return Qt(c).readChatPlan(e,t).then(function(e){return e(d,l)})},searchChatPlan:function(e,t,n,r,i,a,s,o,u){return Qt(c).searchChatPlan(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateChatPlan:function(e,t,n){return Qt(c).updateChatPlan(e,t,n).then(function(e){return e(d,l)})}}},h.RoutingChatPlanServiceApi=Ut,h.RoutingOutboundCallServiceApiAxiosParamCreator=Bt,h.RoutingOutboundCallServiceApiFp=m,h.RoutingOutboundCallServiceApiFactory=function(d,_,h){return{createRoutingOutboundCall:function(e,t){return m(d).createRoutingOutboundCall(e,t).then(function(e){return e(h,_)})},deleteRoutingOutboundCall:function(e,t,n){return m(d).deleteRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},movePositionRoutingOutboundCall:function(e,t,n,r){return m(d).movePositionRoutingOutboundCall(e,t,n,r).then(function(e){return e(h,_)})},patchRoutingOutboundCall:function(e,t,n){return m(d).patchRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},readRoutingOutboundCall:function(e,t,n){return m(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 m(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 m(d).updateRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})}}},h.RoutingOutboundCallServiceApi=Ht,h.RoutingSchemaServiceApiAxiosParamCreator=Dt,h.RoutingSchemaServiceApiFp=Ft,h.RoutingSchemaServiceApiFactory=function(l,d,_){return{createRoutingSchema:function(e,t){return Ft(l).createRoutingSchema(e,t).then(function(e){return e(_,d)})},deleteRoutingSchema:function(e,t,n){return Ft(l).deleteRoutingSchema(e,t,n).then(function(e){return e(_,d)})},patchRoutingSchema:function(e,t,n){return Ft(l).patchRoutingSchema(e,t,n).then(function(e){return e(_,d)})},readRoutingSchema:function(e,t,n){return Ft(l).readRoutingSchema(e,t,n).then(function(e){return e(_,d)})},searchRoutingSchema:function(e,t,n,r,i,a,s,o,u,c){return Ft(l).searchRoutingSchema(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},updateRoutingSchema:function(e,t,n){return Ft(l).updateRoutingSchema(e,t,n).then(function(e){return e(_,d)})}}},h.RoutingSchemaServiceApi=Jt,h.RoutingVariableServiceApiAxiosParamCreator=Vt,h.RoutingVariableServiceApiFp=$t,h.RoutingVariableServiceApiFactory=function(i,a,s){return{createRoutingVariable:function(e,t){return $t(i).createRoutingVariable(e,t).then(function(e){return e(s,a)})},deleteRoutingVariable:function(e,t,n){return $t(i).deleteRoutingVariable(e,t,n).then(function(e){return e(s,a)})},readRoutingVariable:function(e,t,n){return $t(i).readRoutingVariable(e,t,n).then(function(e){return e(s,a)})},searchRoutingVariable:function(e,t,n,r){return $t(i).searchRoutingVariable(e,t,n,r).then(function(e){return e(s,a)})},updateRoutingVariable:function(e,t,n){return $t(i).updateRoutingVariable(e,t,n).then(function(e){return e(s,a)})}}},h.RoutingVariableServiceApi=Zt,h.SkillServiceApiAxiosParamCreator=tn,h.SkillServiceApiFp=nn,h.SkillServiceApiFactory=function(o,u,c){return{createSkill:function(e,t){return nn(o).createSkill(e,t).then(function(e){return e(c,u)})},deleteSkill:function(e,t,n){return nn(o).deleteSkill(e,t,n).then(function(e){return e(c,u)})},readSkill:function(e,t,n){return nn(o).readSkill(e,t,n).then(function(e){return e(c,u)})},searchSkill:function(e,t,n,r,i,a,s){return nn(o).searchSkill(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateSkill:function(e,t,n){return nn(o).updateSkill(e,t,n).then(function(e){return e(c,u)})}}},h.SkillServiceApi=an,h.UserHelperServiceApiAxiosParamCreator=on,h.UserHelperServiceApiFp=un,h.UserHelperServiceApiFactory=function(n,r,i){return{defaultDeviceConfig:function(e,t){return un(n).defaultDeviceConfig(e,t).then(function(e){return e(i,r)})}}},h.UserHelperServiceApi=ln,h.Configuration=_n,h.Client=K,h.Call=qn,h.Agent=mn,h.Conversation=An,h.DeviceNotFoundError=Sn,h.DeviceNotAllowPermissionError=On,h.SipClient=Mn,h.ExternalClient=Dn,h.SipPhone=yn,h.Log=hn,Object.defineProperty(h,"__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(h,N,J,B,T,k){"use strict";B=B&&B.hasOwnProperty("default")?B.default:B;function e(e,t,n){void 0===n&&(n=B),this.basePath=t=void 0===t?M:t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}var I,M="https://dev.webitel.com/api".replace(/\/+$/,""),O=(I=Error,N.__extends(W,I),W);function W(e,t){t=I.call(this,t)||this;return t.field=e,t.name="RequiredError",t}function X(f){var e=this;return{createAgentPauseCause:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createAgentPauseCause.");return(t=J.parse("/call_center/pause_causes",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteAgentPauseCause:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),c),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},patchAgentPauseCause:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchAgentPauseCause.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readAgentPauseCause:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),c),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},searchAgentPauseCause:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/pause_causes",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},updateAgentPauseCause:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateAgentPauseCause.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function l(c){return{createAgentPauseCause:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,X(c).createAgentPauseCause(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgentPauseCause:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,X(c).deleteAgentPauseCause(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchAgentPauseCause:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,X(c).patchAgentPauseCause(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgentPauseCause:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,X(c).readAgentPauseCause(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentPauseCause:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,X(c).searchAgentPauseCause(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentPauseCause:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,X(c).updateAgentPauseCause(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}x=e,N.__extends(Q,x),Q.prototype.createAgentPauseCause=function(e,t){var n=this;return l(this.configuration).createAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},Q.prototype.deleteAgentPauseCause=function(e,t){var n=this;return l(this.configuration).deleteAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},Q.prototype.patchAgentPauseCause=function(e,t,n){var r=this;return l(this.configuration).patchAgentPauseCause(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Q.prototype.readAgentPauseCause=function(e,t){var n=this;return l(this.configuration).readAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},Q.prototype.searchAgentPauseCause=function(e,t,n,r,i,a,s){var o=this;return l(this.configuration).searchAgentPauseCause(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Q.prototype.updateAgentPauseCause=function(e,t,n){var r=this;return l(this.configuration).updateAgentPauseCause(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var x,E=Q;function Q(){return null!==x&&x.apply(this,arguments)||this}function q(K){var e=this;return{agentSetState:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("agentId","Required parameter agentId was null or undefined when calling agentSetState.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling agentSetState.");return(t="/call_center/agents/{agent_id}/states/waiting".replace("{agent_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},agentStateHistory:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling agentStateHistory.");return(t="/call_center/agents/{agent_id}/states/history".replace("{agent_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),f),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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.time_from=d),void 0!==_&&(a.time_to=_),void 0!==h&&(a.q=h),void 0!==p&&(a.domain_id=p),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),f.headers),[2,{url:J.format(t),options:r}]}})})},agentTodayStatistics:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling agentTodayStatistics.");return(t="/call_center/agents/{agent_id}/statistics/today".replace("{agent_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"GET"},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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return c&&(a.fields=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},createAgent:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createAgent.");return(t=J.parse("/call_center/agents",!0),K&&(n=K.baseOptions),r=N.__assign(N.__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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteAgent:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},patchAgent:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchAgent.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readAgent:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"GET"},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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},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={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/agents",!0),K&&(n=K.baseOptions),r=N.__assign(N.__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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.allow_channels=p),f&&(a.supervisor_id=f),g&&(a.team_id=g),v&&(a.region_id=v),y&&(a.auditor_id=y),void 0!==b&&(a.is_supervisor=b),w&&(a.skill_id=w),m&&(a.queue_id=m),void 0!==q&&(a.not_supervisor=q),A&&(a.user_id=A),C&&(a.extension=C),R&&(a.not_team_id=R),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),S.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),S.headers),[2,{url:J.format(t),options:r}]}})})},searchAgentCallStatistics:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/agents/reports/call",!0),K&&(n=K.baseOptions),r=N.__assign(N.__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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a["time.from"]=l),void 0!==d&&(a["time.to"]=d),_&&(a.agent_id=_),void 0!==h&&(a.domain_id=h),void 0!==p&&(a.q=p),f&&(a.fields=f),void 0!==g&&(a.sort=g),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),v.headers),[2,{url:J.format(t),options:r}]}})})},searchAgentInQueue:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling searchAgentInQueue.");return(t="/call_center/agents/{id}/queues".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},searchAgentInQueueStatistics:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling searchAgentInQueueStatistics.");return(t="/call_center/agents/{agent_id}/statistics/queues".replace("{agent_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"GET"},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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchAgentInTeam:function(u,c,l,d,_,h){return void 0===h&&(h={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling searchAgentInTeam.");return(t="/call_center/agents/{id}/teams".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),h),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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.domain_id=_),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),h.headers),[2,{url:J.format(t),options:r}]}})})},searchAgentStateHistory:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/agents/states/history",!0),K&&(n=K.baseOptions),r=N.__assign(N.__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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a["joined_at.from"]=l),void 0!==d&&(a["joined_at.to"]=d),_&&(a.agent_id=_),void 0!==h&&(a.sort=h),void 0!==p&&(a.domain_id=p),void 0!==f&&(a.from_id=f),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),g.headers),[2,{url:J.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={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/agents/reports/status",!0),K&&(n=K.baseOptions),r=N.__assign(N.__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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.agent_id=h),void 0!==p&&(a["time.from"]=p),void 0!==f&&(a["time.to"]=f),g&&(a.status=g),v&&(a.queue_id=v),y&&(a.team_id=y),void 0!==b&&(a["utilization.from"]=b),void 0!==w&&(a["utilization.to"]=w),void 0!==m&&(a.has_call=m),q&&(a.skill_id=q),A&&(a.region_id=A),C&&(a.supervisor_id=C),R&&(a.auditor_id=R),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),S.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),S.headers),[2,{url:J.format(t),options:r}]}})})},searchAgentStatusStatisticItem:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling searchAgentStatusStatisticItem.");return(t="/call_center/agents/reports/status/{agent_id}".replace("{agent_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a["time.from"]=c),void 0!==l&&(a["time.to"]=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},searchLookupUsersAgentNotExists:function(u,c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/lookups/agents/users",!0),K&&(n=K.baseOptions),r=N.__assign(N.__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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.domain_id=d),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),[2,{url:J.format(t),options:r}]}})})},searchPauseCauseForAgent:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling searchPauseCauseForAgent.");return(t="/call_center/agents/{agent_id}/pause_causes".replace("{agent_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"GET"},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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.allow_change=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},updateAgent:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateAgent.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},updateAgentStatus:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateAgentStatus.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateAgentStatus.");return(t="/call_center/agents/{id}/status".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),K&&(n=K.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function A(m){return{agentSetState:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).agentSetState(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentStateHistory:function(t,r,i,a,s,o,u,c){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).agentStateHistory(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentTodayStatistics:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).agentTodayStatistics(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createAgent:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).createAgent(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgent:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).deleteAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchAgent:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).patchAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgent:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).readAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgent:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgent(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentCallStatistics:function(t,r,i,a,s,o,u,c,l,d){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentCallStatistics(t,r,i,a,s,o,u,c,l,d)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentInQueue:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentInQueue(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentInQueueStatistics:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentInQueueStatistics(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentInTeam:function(t,r,i,a,s,o){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentInTeam(t,r,i,a,s,o)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentStateHistory:function(t,r,i,a,s,o,u,c,l){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentStateHistory(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentStatusStatistic:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentStatusStatistic(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentStatusStatisticItem:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchAgentStatusStatisticItem(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchLookupUsersAgentNotExists:function(t,r,i,a,s){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchLookupUsersAgentNotExists(t,r,i,a,s)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchPauseCauseForAgent:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).searchPauseCauseForAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgent:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).updateAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentStatus:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,q(m).updateAgentStatus(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}j=e,N.__extends(t,j),t.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)})},t.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)})},t.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)})},t.prototype.createAgent=function(e,t){var n=this;return A(this.configuration).createAgent(e,t).then(function(e){return e(n.axios,n.basePath)})},t.prototype.deleteAgent=function(e,t,n){var r=this;return A(this.configuration).deleteAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.patchAgent=function(e,t,n){var r=this;return A(this.configuration).patchAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.readAgent=function(e,t,n){var r=this;return A(this.configuration).readAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.searchAgent=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y){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)})},t.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)})},t.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)})},t.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)})},t.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)})},t.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)})},t.prototype.searchAgentStatusStatistic=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y){var b=this;return 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)})},t.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)})},t.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)})},t.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)})},t.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)})},t.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)})};var j,U=t;function t(){return null!==j&&j.apply(this,arguments)||this}function G(g){var e=this;return{createAgentSkill:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("agentId","Required parameter agentId was null or undefined when calling createAgentSkill.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createAgentSkill.");return(t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteAgentSkill:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling deleteAgentSkill.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},patchAgentSkill:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("agentId","Required parameter agentId was null or undefined when calling patchAgentSkill.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling patchAgentSkill.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling patchAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})},readAgentSkill:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling readAgentSkill.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},searchAgentSkill:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling searchAgentSkill.");return(t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),f.headers),[2,{url:J.format(t),options:r}]}})})},searchLookupAgentNotExistsSkill:function(u,c,l,d,_,h){return void 0===h&&(h={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("agentId","Required parameter agentId was null or undefined when calling searchLookupAgentNotExistsSkill.");return(t="/call_center/lookups/agents/skills/{agent_id}".replace("{agent_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),h),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.domain_id=_),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),h.headers),[2,{url:J.format(t),options:r}]}})})},updateAgentSkill:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("agentId","Required parameter agentId was null or undefined when calling updateAgentSkill.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateAgentSkill.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function d(l){return{createAgentSkill:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,G(l).createAgentSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgentSkill:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,G(l).deleteAgentSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchAgentSkill:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,G(l).patchAgentSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgentSkill:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,G(l).readAgentSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentSkill:function(t,r,i,a,s,o,u,c){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,G(l).searchAgentSkill(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchLookupAgentNotExistsSkill:function(t,r,i,a,s,o){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,G(l).searchLookupAgentNotExistsSkill(t,r,i,a,s,o)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentSkill:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,G(l).updateAgentSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}D=e,N.__extends(z,D),z.prototype.createAgentSkill=function(e,t,n){var r=this;return d(this.configuration).createAgentSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},z.prototype.deleteAgentSkill=function(e,t,n,r){var i=this;return d(this.configuration).deleteAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},z.prototype.patchAgentSkill=function(e,t,n,r){var i=this;return d(this.configuration).patchAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},z.prototype.readAgentSkill=function(e,t,n,r){var i=this;return d(this.configuration).readAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},z.prototype.searchAgentSkill=function(e,t,n,r,i,a,s,o){var u=this;return d(this.configuration).searchAgentSkill(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},z.prototype.searchLookupAgentNotExistsSkill=function(e,t,n,r,i,a){var s=this;return d(this.configuration).searchLookupAgentNotExistsSkill(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},z.prototype.updateAgentSkill=function(e,t,n,r){var i=this;return d(this.configuration).updateAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var D,F=z;function z(){return null!==D&&D.apply(this,arguments)||this}function V(v){var e=this;return{createAgentTeam:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createAgentTeam.");return(t=J.parse("/call_center/teams",!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteAgentTeam:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteAgentTeam.");return(t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readAgentTeam:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readAgentTeam.");return(t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchAgentTeam:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/teams",!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.strategy=p),f&&(a.admin_id=f),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),g.headers),[2,{url:J.format(t),options:r}]}})})},updateAgentTeam:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateAgentTeam.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateAgentTeam.");return(t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function $(d){return{createAgentTeam:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,V(d).createAgentTeam(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgentTeam:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,V(d).deleteAgentTeam(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgentTeam:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,V(d).readAgentTeam(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentTeam:function(t,r,i,a,s,o,u,c,l){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,V(d).searchAgentTeam(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentTeam:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,V(d).updateAgentTeam(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Y=e,N.__extends(ee,Y),ee.prototype.createAgentTeam=function(e,t){var n=this;return $(this.configuration).createAgentTeam(e,t).then(function(e){return e(n.axios,n.basePath)})},ee.prototype.deleteAgentTeam=function(e,t,n){var r=this;return $(this.configuration).deleteAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ee.prototype.readAgentTeam=function(e,t,n){var r=this;return $(this.configuration).readAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ee.prototype.searchAgentTeam=function(e,t,n,r,i,a,s,o,u){var c=this;return $(this.configuration).searchAgentTeam(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},ee.prototype.updateAgentTeam=function(e,t,n){var r=this;return $(this.configuration).updateAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Y,Z=ee;function ee(){return null!==Y&&Y.apply(this,arguments)||this}function te(f){var e=this;return{createBackendProfile:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createBackendProfile.");return(t=J.parse("/storage/backend_profiles",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteBackendProfile:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},patchBackendProfile:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchBackendProfile.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readBackendProfile:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchBackendProfile:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/storage/backend_profiles",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},updateBackendProfile:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateBackendProfile.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function _(c){return{createBackendProfile:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,te(c).createBackendProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteBackendProfile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,te(c).deleteBackendProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchBackendProfile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,te(c).patchBackendProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readBackendProfile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,te(c).readBackendProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchBackendProfile:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,te(c).searchBackendProfile(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateBackendProfile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,te(c).updateBackendProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ne=e,N.__extends(ie,ne),ie.prototype.createBackendProfile=function(e,t){var n=this;return _(this.configuration).createBackendProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ie.prototype.deleteBackendProfile=function(e,t,n){var r=this;return _(this.configuration).deleteBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ie.prototype.patchBackendProfile=function(e,t,n){var r=this;return _(this.configuration).patchBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ie.prototype.readBackendProfile=function(e,t,n){var r=this;return _(this.configuration).readBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ie.prototype.searchBackendProfile=function(e,t,n,r,i,a,s){var o=this;return _(this.configuration).searchBackendProfile(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},ie.prototype.updateBackendProfile=function(e,t,n){var r=this;return _(this.configuration).updateBackendProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var ne,re=ie;function ie(){return null!==ne&&ne.apply(this,arguments)||this}function ae(f){var e=this;return{createBucket:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createBucket.");return(t=J.parse("/call_center/buckets",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteBucket:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteBucket.");return(t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readBucket:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readBucket.");return(t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchBucket:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/buckets",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},updateBucket:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateBucket.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateBucket.");return(t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function se(c){return{createBucket:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ae(c).createBucket(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteBucket:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ae(c).deleteBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readBucket:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ae(c).readBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchBucket:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ae(c).searchBucket(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateBucket:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ae(c).updateBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}oe=e,N.__extends(ce,oe),ce.prototype.createBucket=function(e,t){var n=this;return se(this.configuration).createBucket(e,t).then(function(e){return e(n.axios,n.basePath)})},ce.prototype.deleteBucket=function(e,t,n){var r=this;return se(this.configuration).deleteBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ce.prototype.readBucket=function(e,t,n){var r=this;return se(this.configuration).readBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ce.prototype.searchBucket=function(e,t,n,r,i,a,s){var o=this;return se(this.configuration).searchBucket(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},ce.prototype.updateBucket=function(e,t,n){var r=this;return se(this.configuration).updateBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var oe,ue=ce;function ce(){return null!==oe&&oe.apply(this,arguments)||this}function le(f){var e=this;return{createCalendar:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createCalendar.");return(t=J.parse("/calendars",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteCalendar:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteCalendar.");return(t="/calendars/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readCalendar:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readCalendar.");return(t="/calendars/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchCalendar:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/calendars",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},searchTimezones:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/calendars/timezones",!0),f&&(n=f.baseOptions),r=N.__assign(N.__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:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},updateCalendar:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateCalendar.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateCalendar.");return(t="/calendars/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function p(c){return{createCalendar:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,le(c).createCalendar(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCalendar:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,le(c).deleteCalendar(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCalendar:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,le(c).readCalendar(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchCalendar:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,le(c).searchCalendar(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchTimezones:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,le(c).searchTimezones(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCalendar:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,le(c).updateCalendar(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}de=e,N.__extends(he,de),he.prototype.createCalendar=function(e,t){var n=this;return p(this.configuration).createCalendar(e,t).then(function(e){return e(n.axios,n.basePath)})},he.prototype.deleteCalendar=function(e,t,n){var r=this;return p(this.configuration).deleteCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})},he.prototype.readCalendar=function(e,t,n){var r=this;return p(this.configuration).readCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})},he.prototype.searchCalendar=function(e,t,n,r,i,a,s){var o=this;return p(this.configuration).searchCalendar(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},he.prototype.searchTimezones=function(e,t,n,r){var i=this;return p(this.configuration).searchTimezones(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},he.prototype.updateCalendar=function(e,t,n){var r=this;return p(this.configuration).updateCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var de,_e=he;function he(){return null!==de&&de.apply(this,arguments)||this}function H(F){var e=this;return{aggregateHistoryCall:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling aggregateHistoryCall.");return(t=J.parse("/calls/history/aggregate",!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},blindTransferCall:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling blindTransferCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling blindTransferCall.");return(t="/calls/active/{id}/transfer".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},confirmPush:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling confirmPush.");return(t="/calls/active/{id}/confirm_push".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),c),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},createCall:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createCall.");return(t=J.parse("/calls",!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},createCallAnnotation:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("callId","Required parameter callId was null or undefined when calling createCallAnnotation.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createCallAnnotation.");return(t="/calls/history/{call_id}/annotation".replace("{call_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteCallAnnotation:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("callId","Required parameter callId was null or undefined when calling deleteCallAnnotation.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteCallAnnotation.");return(t="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},dtmfCall:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling dtmfCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling dtmfCall.");return(t="/calls/active/{id}/dtmf".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},eavesdropCall:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling eavesdropCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling eavesdropCall.");return(t="/calls/active/{id}/eavesdrop".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},hangupCall:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling hangupCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling hangupCall.");return(t="/calls/active/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),d),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},holdCall:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling holdCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling holdCall.");return(t="/calls/active/{id}/hold".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readCall:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readCall.");return(t="/calls/active/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchActiveCall:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,k,I,W,X,x,E,Q){return void 0===Q&&(Q={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/calls/active",!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),Q),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),void 0!==h&&(a["created_at.from"]=h),void 0!==p&&(a["created_at.to"]=p),f&&(a.user_id=f),g&&(a.agent_id=g),v&&(a.queue_id=v),y&&(a.team_id=y),b&&(a.member_id=b),w&&(a.gateway_id=w),void 0!==m&&(a["duration.from"]=m),void 0!==q&&(a["duration.to"]=q),void 0!==A&&(a.skip_parent=A),void 0!==C&&(a.parent_id=C),R&&(a.cause=R),void 0!==S&&(a.exists_file=S),void 0!==K&&(a.domain_id=K),void 0!==P&&(a.number=P),T&&(a.direction=T),void 0!==O&&(a["answered_at.from"]=O),void 0!==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=N.__assign(N.__assign(N.__assign({},t.query),a),Q.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),Q.headers),[2,{url:J.format(t),options:r}]}})})},searchHistoryCall:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,k,I,W,X,x,E,Q,j,U,G,B,M,L,D,H){return void 0===H&&(H={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/calls/history",!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),H),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),void 0!==h&&(a["created_at.from"]=h),void 0!==p&&(a["created_at.to"]=p),f&&(a.user_id=f),g&&(a.agent_id=g),v&&(a.queue_id=v),y&&(a.team_id=y),b&&(a.member_id=b),w&&(a.gateway_id=w),void 0!==m&&(a["duration.from"]=m),void 0!==q&&(a["duration.to"]=q),void 0!==A&&(a.skip_parent=A),void 0!==C&&(a.parent_id=C),R&&(a.cause=R),void 0!==S&&(a.has_file=S),void 0!==K&&(a.domain_id=K),void 0!==P&&(a.number=P),void 0!==T&&(a.direction=T),void 0!==O&&(a["answered_at.from"]=O),void 0!==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),void 0!==L&&(a.has_transcript=L),void 0!==D&&(a.agent_description=D),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),H.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),H.headers),[2,{url:J.format(t),options:r}]}})})},unHoldCall:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling unHoldCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling unHoldCall.");return(t="/calls/active/{id}/unhold".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},updateCallAnnotation:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("callId","Required parameter callId was null or undefined when calling updateCallAnnotation.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateCallAnnotation.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateCallAnnotation.");return(t="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),F&&(n=F.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},F&&F.apiKey)?"function"!=typeof F.apiKey?[3,2]:[4,F.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,F.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function L(G){return{aggregateHistoryCall:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).aggregateHistoryCall(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},blindTransferCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).blindTransferCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},confirmPush:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).confirmPush(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createCall:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).createCall(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createCallAnnotation:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).createCallAnnotation(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCallAnnotation:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).deleteCallAnnotation(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},dtmfCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).dtmfCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},eavesdropCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).eavesdropCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},hangupCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).hangupCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},holdCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).holdCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).readCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchActiveCall:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,k){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).searchActiveCall(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,k)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchHistoryCall:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,k,I,W,X,x,E,Q,j,U){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).searchHistoryCall(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,k,I,W,X,x,E,Q,j,U)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},unHoldCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).unHoldCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCallAnnotation:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,H(G).updateCallAnnotation(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}pe=e,N.__extends(n,pe),n.prototype.aggregateHistoryCall=function(e,t){var n=this;return L(this.configuration).aggregateHistoryCall(e,t).then(function(e){return e(n.axios,n.basePath)})},n.prototype.blindTransferCall=function(e,t,n){var r=this;return L(this.configuration).blindTransferCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.confirmPush=function(e,t){var n=this;return L(this.configuration).confirmPush(e,t).then(function(e){return e(n.axios,n.basePath)})},n.prototype.createCall=function(e,t){var n=this;return L(this.configuration).createCall(e,t).then(function(e){return e(n.axios,n.basePath)})},n.prototype.createCallAnnotation=function(e,t,n){var r=this;return L(this.configuration).createCallAnnotation(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.deleteCallAnnotation=function(e,t,n){var r=this;return L(this.configuration).deleteCallAnnotation(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.dtmfCall=function(e,t,n){var r=this;return L(this.configuration).dtmfCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.eavesdropCall=function(e,t,n){var r=this;return L(this.configuration).eavesdropCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.hangupCall=function(e,t,n){var r=this;return L(this.configuration).hangupCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.holdCall=function(e,t,n){var r=this;return L(this.configuration).holdCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.readCall=function(e,t,n){var r=this;return L(this.configuration).readCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.searchActiveCall=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T){var O=this;return L(this.configuration).searchActiveCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T).then(function(e){return e(O.axios,O.basePath)})},n.prototype.searchHistoryCall=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,k,I,W,X,E,Q,j){var x=this;return L(this.configuration).searchHistoryCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,k,I,W,X,E,Q,j).then(function(e){return e(x.axios,x.basePath)})},n.prototype.unHoldCall=function(e,t,n){var r=this;return L(this.configuration).unHoldCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.updateCallAnnotation=function(e,t,n,r){var i=this;return L(this.configuration).updateCallAnnotation(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var pe,fe=n;function n(){return null!==pe&&pe.apply(this,arguments)||this}function ge(v){var e=this;return{createCognitiveProfile:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createCognitiveProfile.");return(t=J.parse("/storage/cognitive_profiles",!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteCognitiveProfile:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),c),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},patchCognitiveProfile:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchCognitiveProfile.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readCognitiveProfile:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),c),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},searchCognitiveProfile:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/storage/cognitive_profiles",!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.service=p),void 0!==f&&(a.enabled=f),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),g.headers),[2,{url:J.format(t),options:r}]}})})},updateCognitiveProfile:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateCognitiveProfile.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function f(d){return{createCognitiveProfile:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ge(d).createCognitiveProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCognitiveProfile:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ge(d).deleteCognitiveProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchCognitiveProfile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ge(d).patchCognitiveProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCognitiveProfile:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ge(d).readCognitiveProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchCognitiveProfile:function(t,r,i,a,s,o,u,c,l){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ge(d).searchCognitiveProfile(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCognitiveProfile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ge(d).updateCognitiveProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ve=e,N.__extends(be,ve),be.prototype.createCognitiveProfile=function(e,t){var n=this;return f(this.configuration).createCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},be.prototype.deleteCognitiveProfile=function(e,t){var n=this;return f(this.configuration).deleteCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},be.prototype.patchCognitiveProfile=function(e,t,n){var r=this;return f(this.configuration).patchCognitiveProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},be.prototype.readCognitiveProfile=function(e,t){var n=this;return f(this.configuration).readCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},be.prototype.searchCognitiveProfile=function(e,t,n,r,i,a,s,o,u){var c=this;return f(this.configuration).searchCognitiveProfile(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},be.prototype.updateCognitiveProfile=function(e,t,n){var r=this;return f(this.configuration).updateCognitiveProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var ve,ye=be;function be(){return null!==ve&&ve.apply(this,arguments)||this}function we(f){var e=this;return{createCommunicationType:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createCommunicationType.");return(t=J.parse("/call_center/communication_type",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteCommunicationType:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteCommunicationType.");return(t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readCommunicationType:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readCommunicationType.");return(t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchCommunicationType:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/communication_type",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},updateCommunicationType:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateCommunicationType.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateCommunicationType.");return(t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function me(c){return{createCommunicationType:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,we(c).createCommunicationType(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCommunicationType:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,we(c).deleteCommunicationType(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCommunicationType:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,we(c).readCommunicationType(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchCommunicationType:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,we(c).searchCommunicationType(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCommunicationType:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,we(c).updateCommunicationType(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}qe=e,N.__extends(Ce,qe),Ce.prototype.createCommunicationType=function(e,t){var n=this;return me(this.configuration).createCommunicationType(e,t).then(function(e){return e(n.axios,n.basePath)})},Ce.prototype.deleteCommunicationType=function(e,t,n){var r=this;return me(this.configuration).deleteCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ce.prototype.readCommunicationType=function(e,t,n){var r=this;return me(this.configuration).readCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ce.prototype.searchCommunicationType=function(e,t,n,r,i,a,s){var o=this;return me(this.configuration).searchCommunicationType(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Ce.prototype.updateCommunicationType=function(e,t,n){var r=this;return me(this.configuration).updateCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var qe,Ae=Ce;function Ce(){return null!==qe&&qe.apply(this,arguments)||this}function Re(p){var e=this;return{createEmailProfile:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createEmailProfile.");return(t=J.parse("/email/profile",!0),p&&(n=p.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteEmailProfile:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),p&&(n=p.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),c),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},patchEmailProfile:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchEmailProfile.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),p&&(n=p.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readEmailProfile:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),p&&(n=p.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),c),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},searchEmailProfile:function(u,c,l,d,_,h){return void 0===h&&(h={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/email/profile",!0),p&&(n=p.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),h),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),h.headers),[2,{url:J.format(t),options:r}]}})})},updateEmailProfile:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateEmailProfile.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),p&&(n=p.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},p&&p.apiKey)?"function"!=typeof p.apiKey?[3,2]:[4,p.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,p.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function c(u){return{createEmailProfile:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).createEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteEmailProfile:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).deleteEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchEmailProfile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).patchEmailProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readEmailProfile:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).readEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchEmailProfile:function(t,r,i,a,s,o){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).searchEmailProfile(t,r,i,a,s,o)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateEmailProfile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).updateEmailProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Se=e,N.__extends(Pe,Se),Pe.prototype.createEmailProfile=function(e,t){var n=this;return c(this.configuration).createEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},Pe.prototype.deleteEmailProfile=function(e,t){var n=this;return c(this.configuration).deleteEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},Pe.prototype.patchEmailProfile=function(e,t,n){var r=this;return c(this.configuration).patchEmailProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Pe.prototype.readEmailProfile=function(e,t){var n=this;return c(this.configuration).readEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},Pe.prototype.searchEmailProfile=function(e,t,n,r,i,a){var s=this;return c(this.configuration).searchEmailProfile(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},Pe.prototype.updateEmailProfile=function(e,t,n){var r=this;return c(this.configuration).updateEmailProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Se,Ke=Pe;function Pe(){return null!==Se&&Se.apply(this,arguments)||this}function Te(d){var e=this;return{deleteFiles:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling deleteFiles.");return(t=J.parse("/storage/file",!0),d&&(n=d.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},d&&d.apiKey)?"function"!=typeof d.apiKey?[3,2]:[4,d.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,d.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})}}}function Oe(i){return{deleteFiles:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Te(i).deleteFiles(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ke=e,N.__extends(We,ke),We.prototype.deleteFiles=function(e,t){var n=this;return Oe(this.configuration).deleteFiles(e,t).then(function(e){return e(n.axios,n.basePath)})};var ke,Ie=We;function We(){return null!==ke&&ke.apply(this,arguments)||this}function Xe(_){var e=this;return{createFileTranscript:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createFileTranscript.");return(t=J.parse("/storage/transcript_file",!0),_&&(n=_.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteFileTranscript:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling deleteFileTranscript.");return(t=J.parse("/storage/transcript_file",!0),_&&(n=_.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},getFileTranscriptPhrases:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling getFileTranscriptPhrases.");return(t="/storage/transcript_file/{id}/phrases".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),_&&(n=_.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})}}}function xe(s){return{createFileTranscript:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Xe(s).createFileTranscript(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteFileTranscript:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Xe(s).deleteFileTranscript(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},getFileTranscriptPhrases:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Xe(s).getFileTranscriptPhrases(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Ee=e,N.__extends(je,Ee),je.prototype.createFileTranscript=function(e,t){var n=this;return xe(this.configuration).createFileTranscript(e,t).then(function(e){return e(n.axios,n.basePath)})},je.prototype.deleteFileTranscript=function(e,t){var n=this;return xe(this.configuration).deleteFileTranscript(e,t).then(function(e){return e(n.axios,n.basePath)})},je.prototype.getFileTranscriptPhrases=function(e,t,n,r){var i=this;return xe(this.configuration).getFileTranscriptPhrases(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var Ee,Qe=je;function je(){return null!==Ee&&Ee.apply(this,arguments)||this}function Ue(f){var e=this;return{createImportTemplate:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createImportTemplate.");return(t=J.parse("/storage/import_templates",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteImportTemplate:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),c),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},patchImportTemplate:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchImportTemplate.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readImportTemplate:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),c),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},searchImportTemplate:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/storage/import_templates",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},updateImportTemplate:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateImportTemplate.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function g(c){return{createImportTemplate:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(c).createImportTemplate(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteImportTemplate:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(c).deleteImportTemplate(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchImportTemplate:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(c).patchImportTemplate(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readImportTemplate:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(c).readImportTemplate(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchImportTemplate:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(c).searchImportTemplate(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateImportTemplate:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Ue(c).updateImportTemplate(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Ge=e,N.__extends(Me,Ge),Me.prototype.createImportTemplate=function(e,t){var n=this;return g(this.configuration).createImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},Me.prototype.deleteImportTemplate=function(e,t){var n=this;return g(this.configuration).deleteImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},Me.prototype.patchImportTemplate=function(e,t,n){var r=this;return g(this.configuration).patchImportTemplate(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Me.prototype.readImportTemplate=function(e,t){var n=this;return g(this.configuration).readImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},Me.prototype.searchImportTemplate=function(e,t,n,r,i,a,s){var o=this;return g(this.configuration).searchImportTemplate(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Me.prototype.updateImportTemplate=function(e,t,n){var r=this;return g(this.configuration).updateImportTemplate(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Ge,Be=Me;function Me(){return null!==Ge&&Ge.apply(this,arguments)||this}function He(g){var e=this;return{createList:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createList.");return(t=J.parse("/call_center/list",!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},createListCommunication:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("listId","Required parameter listId was null or undefined when calling createListCommunication.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createListCommunication.");return(t="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteList:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteList.");return(t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},deleteListCommunication:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("listId","Required parameter listId was null or undefined when calling deleteListCommunication.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteListCommunication.");return(t="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},readList:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readList.");return(t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readListCommunication:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("listId","Required parameter listId was null or undefined when calling readListCommunication.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readListCommunication.");return(t="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},searchList:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/list",!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},searchListCommunication:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("listId","Required parameter listId was null or undefined when calling searchListCommunication.");return(t="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),f.headers),[2,{url:J.format(t),options:r}]}})})},updateList:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateList.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateList.");return(t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},updateListCommunication:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("listId","Required parameter listId was null or undefined when calling updateListCommunication.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateListCommunication.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateListCommunication.");return(t="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function v(l){return{createList:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).createList(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createListCommunication:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).createListCommunication(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteList:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).deleteList(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteListCommunication:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).deleteListCommunication(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readList:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).readList(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readListCommunication:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).readListCommunication(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchList:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).searchList(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchListCommunication:function(t,r,i,a,s,o,u,c){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).searchListCommunication(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateList:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).updateList(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateListCommunication:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,He(l).updateListCommunication(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Le=e,N.__extends(Fe,Le),Fe.prototype.createList=function(e,t){var n=this;return v(this.configuration).createList(e,t).then(function(e){return e(n.axios,n.basePath)})},Fe.prototype.createListCommunication=function(e,t,n){var r=this;return v(this.configuration).createListCommunication(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Fe.prototype.deleteList=function(e,t,n){var r=this;return v(this.configuration).deleteList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Fe.prototype.deleteListCommunication=function(e,t,n,r){var i=this;return v(this.configuration).deleteListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Fe.prototype.readList=function(e,t,n){var r=this;return v(this.configuration).readList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Fe.prototype.readListCommunication=function(e,t,n,r){var i=this;return v(this.configuration).readListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Fe.prototype.searchList=function(e,t,n,r,i,a,s){var o=this;return v(this.configuration).searchList(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Fe.prototype.searchListCommunication=function(e,t,n,r,i,a,s,o){var u=this;return v(this.configuration).searchListCommunication(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},Fe.prototype.updateList=function(e,t,n){var r=this;return v(this.configuration).updateList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Fe.prototype.updateListCommunication=function(e,t,n,r){var i=this;return v(this.configuration).updateListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var Le,De=Fe;function Fe(){return null!==Le&&Le.apply(this,arguments)||this}function Ne(f){var e=this;return{deleteMediaFile:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteMediaFile.");return(t="/storage/media/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readMediaFile:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readMediaFile.");return(t="/storage/media/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchMediaFile:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/storage/media",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})}}}function Je(c){return{deleteMediaFile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(c).deleteMediaFile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readMediaFile:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(c).readMediaFile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchMediaFile:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Ne(c).searchMediaFile(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ze=e,N.__extends($e,ze),$e.prototype.deleteMediaFile=function(e,t,n){var r=this;return Je(this.configuration).deleteMediaFile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},$e.prototype.readMediaFile=function(e,t,n){var r=this;return Je(this.configuration).readMediaFile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},$e.prototype.searchMediaFile=function(e,t,n,r,i,a,s){var o=this;return Je(this.configuration).searchMediaFile(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})};var ze,Ve=$e;function $e(){return null!==ze&&ze.apply(this,arguments)||this}function C(T){var e=this;return{attemptCallback:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("attemptId","Required parameter attemptId was null or undefined when calling attemptCallback.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling attemptCallback.");return(t="/call_center/attempts/{attempt_id}".replace("{attempt_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),T&&(n=T.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},attemptResult:function(c,l,d,_,h){return void 0===h&&(h={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling attemptResult.");if(null==l)throw new O("memberId","Required parameter memberId was null or undefined when calling attemptResult.");if(null==d)throw new O("attemptId","Required parameter attemptId was null or undefined when calling attemptResult.");if(null==_)throw new O("body","Required parameter body was null or undefined when calling attemptResult.");return(t="/call_center/queues/{queue_id}/members/{member_id}/attempts/{attempt_id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{member_id}",encodeURIComponent(String(l))).replace("{attempt_id}",encodeURIComponent(String(d))),t=J.parse(t,!0),T&&(n=T.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),h),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),h.headers),u="string"!=typeof _||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:J.format(t),options:r}]}})})},attemptsRenewalResult:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("attemptId","Required parameter attemptId was null or undefined when calling attemptsRenewalResult.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling attemptsRenewalResult.");return(t="/call_center/queues/attempts/{attempt_id}/renewal".replace("{attempt_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),T&&(n=T.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},createAttempt:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createAttempt.");if(null==l)throw new O("memberId","Required parameter memberId was null or undefined when calling createAttempt.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling createAttempt.");return(t="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(c))).replace("{member_id}",encodeURIComponent(String(l))),t=J.parse(t,!0),T&&(n=T.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),_),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})},createMember:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createMember.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createMember.");return(t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),T&&(n=T.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},createMemberBulk:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createMemberBulk.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createMemberBulk.");return(t="/call_center/queues/{queue_id}/members/bulk".replace("{queue_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),T&&(n=T.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteMember:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling deleteMember.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),T&&(n=T.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},deleteMembers:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling deleteMembers.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling deleteMembers.");return(t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),T&&(n=T.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},patchMember:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling patchMember.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling patchMember.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling patchMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),T&&(n=T.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),_),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})},readMember:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling readMember.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),T&&(n=T.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},resetMembers:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling resetMembers.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling resetMembers.");return(t="/call_center/queues/{queue_id}/members/reset".replace("{queue_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),T&&(n=T.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},searchAttempts:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K){return void 0===K&&(K={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/queues/attempts/active",!0),T&&(n=T.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),K),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),void 0!==h&&(a["joined_at.from"]=h),void 0!==p&&(a["joined_at.to"]=p),f&&(a.id=f),g&&(a.queue_id=g),v&&(a.bucket_id=v),y&&(a.member_id=y),b&&(a.agent_id=b),w&&(a.result=w),void 0!==m&&(a["leaving_at.from"]=m),void 0!==q&&(a["leaving_at.to"]=q),void 0!==A&&(a["offering_at.from"]=A),void 0!==C&&(a["offering_at.to"]=C),void 0!==R&&(a["duration.from"]=R),void 0!==S&&(a["duration.to"]=S),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),K.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),K.headers),[2,{url:J.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={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/queues/attempts/history",!0),T&&(n=T.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),K),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),void 0!==h&&(a["joined_at.from"]=h),void 0!==p&&(a["joined_at.to"]=p),f&&(a.id=f),g&&(a.queue_id=g),v&&(a.bucket_id=v),y&&(a.member_id=y),b&&(a.agent_id=b),w&&(a.result=w),void 0!==m&&(a["leaving_at.from"]=m),void 0!==q&&(a["leaving_at.to"]=q),void 0!==A&&(a["offering_at.from"]=A),void 0!==C&&(a["offering_at.to"]=C),void 0!==R&&(a["duration.from"]=R),void 0!==S&&(a["duration.to"]=S),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),K.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),K.headers),[2,{url:J.format(t),options:r}]}})})},searchMemberAttempts:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling searchMemberAttempts.");if(null==c)throw new O("memberId","Required parameter memberId was null or undefined when calling searchMemberAttempts.");return(t="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(u))).replace("{member_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),T&&(n=T.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},searchMemberInQueue:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P){return void 0===P&&(P={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling searchMemberInQueue.");return(t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),T&&(n=T.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),P),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),f&&(a.bucket_id=f),void 0!==g&&(a.destination=g),void 0!==v&&(a["created_at.from"]=v),void 0!==y&&(a["created_at.to"]=y),void 0!==b&&(a["offering_at.from"]=b),void 0!==w&&(a["offering_at.to"]=w),m&&(a.stop_cause=m),void 0!==q&&(a["priority.from"]=q),void 0!==A&&(a["priority.to"]=A),void 0!==C&&(a.name=C),void 0!==R&&(a["attempts.from"]=R),void 0!==S&&(a["attempts.to"]=S),K&&(a.agent_id=K),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),P.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),P.headers),[2,{url:J.format(t),options:r}]}})})},searchMembers:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P){return void 0===P&&(P={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/members",!0),T&&(n=T.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),P),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.queue_id=p),f&&(a.bucket_id=f),void 0!==g&&(a.destination=g),void 0!==v&&(a["created_at.from"]=v),void 0!==y&&(a["created_at.to"]=y),void 0!==b&&(a["offering_at.from"]=b),void 0!==w&&(a["offering_at.to"]=w),m&&(a.stop_cause=m),void 0!==q&&(a["priority.from"]=q),void 0!==A&&(a["priority.to"]=A),void 0!==C&&(a.name=C),void 0!==R&&(a["attempts.from"]=R),void 0!==S&&(a["attempts.to"]=S),K&&(a.agent_id=K),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),P.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),P.headers),[2,{url:J.format(t),options:r}]}})})},updateMember:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling updateMember.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateMember.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),T&&(n=T.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},T&&T.apiKey)?"function"!=typeof T.apiKey?[3,2]:[4,T.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,T.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function R(A){return{attemptCallback:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).attemptCallback(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},attemptResult:function(t,r,i,a,s){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).attemptResult(t,r,i,a,s)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},attemptsRenewalResult:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).attemptsRenewalResult(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createAttempt:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).createAttempt(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createMember:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).createMember(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createMemberBulk:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).createMemberBulk(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteMember:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).deleteMember(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteMembers:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).deleteMembers(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchMember:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).patchMember(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readMember:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).readMember(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},resetMembers:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).resetMembers(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAttempts:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).searchAttempts(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAttemptsHistory:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).searchAttemptsHistory(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchMemberAttempts:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).searchMemberAttempts(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchMemberInQueue:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).searchMemberInQueue(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchMembers:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).searchMembers(t,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateMember:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,C(A).updateMember(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Ye=e,N.__extends(r,Ye),r.prototype.attemptCallback=function(e,t,n){var r=this;return R(this.configuration).attemptCallback(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.attemptResult=function(e,t,n,r,i){var a=this;return R(this.configuration).attemptResult(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},r.prototype.attemptsRenewalResult=function(e,t,n){var r=this;return R(this.configuration).attemptsRenewalResult(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.createAttempt=function(e,t,n,r){var i=this;return R(this.configuration).createAttempt(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.createMember=function(e,t,n){var r=this;return R(this.configuration).createMember(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.createMemberBulk=function(e,t,n){var r=this;return R(this.configuration).createMemberBulk(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.deleteMember=function(e,t,n,r){var i=this;return R(this.configuration).deleteMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.deleteMembers=function(e,t,n){var r=this;return R(this.configuration).deleteMembers(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.patchMember=function(e,t,n,r){var i=this;return R(this.configuration).patchMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.readMember=function(e,t,n,r){var i=this;return R(this.configuration).readMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.resetMembers=function(e,t,n){var r=this;return R(this.configuration).resetMembers(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.searchAttempts=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b){var w=this;return R(this.configuration).searchAttempts(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b).then(function(e){return e(w.axios,w.basePath)})},r.prototype.searchAttemptsHistory=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b){var w=this;return R(this.configuration).searchAttemptsHistory(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b).then(function(e){return e(w.axios,w.basePath)})},r.prototype.searchMemberAttempts=function(e,t,n,r){var i=this;return R(this.configuration).searchMemberAttempts(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.searchMemberInQueue=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){var m=this;return R(this.configuration).searchMemberInQueue(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w).then(function(e){return e(m.axios,m.basePath)})},r.prototype.searchMembers=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w){var m=this;return R(this.configuration).searchMembers(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w).then(function(e){return e(m.axios,m.basePath)})},r.prototype.updateMember=function(e,t,n,r){var i=this;return R(this.configuration).updateMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var Ye,Ze=r;function r(){return null!==Ye&&Ye.apply(this,arguments)||this}function et(g){var e=this;return{createOutboundResourceGroup:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createOutboundResourceGroup.");return(t=J.parse("/call_center/resource_group",!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},createOutboundResourceInGroup:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("groupId","Required parameter groupId was null or undefined when calling createOutboundResourceInGroup.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteOutboundResourceGroup:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteOutboundResourceGroup.");return(t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},deleteOutboundResourceInGroup:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("groupId","Required parameter groupId was null or undefined when calling deleteOutboundResourceInGroup.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},readOutboundResourceGroup:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readOutboundResourceGroup.");return(t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readOutboundResourceInGroup:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("groupId","Required parameter groupId was null or undefined when calling readOutboundResourceInGroup.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},searchOutboundResourceGroup:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/resource_group",!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},searchOutboundResourceInGroup:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("groupId","Required parameter groupId was null or undefined when calling searchOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),f.headers),[2,{url:J.format(t),options:r}]}})})},updateOutboundResourceGroup:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateOutboundResourceGroup.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateOutboundResourceGroup.");return(t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},updateOutboundResourceInGroup:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("groupId","Required parameter groupId was null or undefined when calling updateOutboundResourceInGroup.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateOutboundResourceInGroup.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function y(l){return{createOutboundResourceGroup:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).createOutboundResourceGroup(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createOutboundResourceInGroup:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).createOutboundResourceInGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResourceGroup:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).deleteOutboundResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResourceInGroup:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).deleteOutboundResourceInGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResourceGroup:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).readOutboundResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResourceInGroup:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).readOutboundResourceInGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResourceGroup:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).searchOutboundResourceGroup(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResourceInGroup:function(t,r,i,a,s,o,u,c){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).searchOutboundResourceInGroup(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResourceGroup:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).updateOutboundResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResourceInGroup:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,et(l).updateOutboundResourceInGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}tt=e,N.__extends(rt,tt),rt.prototype.createOutboundResourceGroup=function(e,t){var n=this;return y(this.configuration).createOutboundResourceGroup(e,t).then(function(e){return e(n.axios,n.basePath)})},rt.prototype.createOutboundResourceInGroup=function(e,t,n){var r=this;return y(this.configuration).createOutboundResourceInGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},rt.prototype.deleteOutboundResourceGroup=function(e,t,n){var r=this;return y(this.configuration).deleteOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},rt.prototype.deleteOutboundResourceInGroup=function(e,t,n,r){var i=this;return y(this.configuration).deleteOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},rt.prototype.readOutboundResourceGroup=function(e,t,n){var r=this;return y(this.configuration).readOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},rt.prototype.readOutboundResourceInGroup=function(e,t,n,r){var i=this;return y(this.configuration).readOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},rt.prototype.searchOutboundResourceGroup=function(e,t,n,r,i,a,s){var o=this;return y(this.configuration).searchOutboundResourceGroup(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},rt.prototype.searchOutboundResourceInGroup=function(e,t,n,r,i,a,s,o){var u=this;return y(this.configuration).searchOutboundResourceInGroup(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},rt.prototype.updateOutboundResourceGroup=function(e,t,n){var r=this;return y(this.configuration).updateOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},rt.prototype.updateOutboundResourceInGroup=function(e,t,n,r){var i=this;return y(this.configuration).updateOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var tt,nt=rt;function rt(){return null!==tt&&tt.apply(this,arguments)||this}function it(g){var e=this;return{createOutboundResource:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createOutboundResource.");return(t=J.parse("/call_center/resources",!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},createOutboundResourceDisplay:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("resourceId","Required parameter resourceId was null or undefined when calling createOutboundResourceDisplay.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteOutboundResource:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},deleteOutboundResourceDisplay:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("resourceId","Required parameter resourceId was null or undefined when calling deleteOutboundResourceDisplay.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},patchOutboundResource:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchOutboundResource.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readOutboundResource:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readOutboundResourceDisplay:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("resourceId","Required parameter resourceId was null or undefined when calling readOutboundResourceDisplay.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},searchOutboundResource:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/resources",!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},searchOutboundResourceDisplay:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("resourceId","Required parameter resourceId was null or undefined when calling searchOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),f.headers),[2,{url:J.format(t),options:r}]}})})},updateOutboundResource:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateOutboundResource.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},updateOutboundResourceDisplay:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("resourceId","Required parameter resourceId was null or undefined when calling updateOutboundResourceDisplay.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateOutboundResourceDisplay.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function b(l){return{createOutboundResource:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).createOutboundResource(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createOutboundResourceDisplay:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).createOutboundResourceDisplay(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResource:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).deleteOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResourceDisplay:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).deleteOutboundResourceDisplay(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchOutboundResource:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).patchOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResource:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).readOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResourceDisplay:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).readOutboundResourceDisplay(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResource:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).searchOutboundResource(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResourceDisplay:function(t,r,i,a,s,o,u,c){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).searchOutboundResourceDisplay(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResource:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).updateOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResourceDisplay:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,it(l).updateOutboundResourceDisplay(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}at=e,N.__extends(i,at),i.prototype.createOutboundResource=function(e,t){var n=this;return b(this.configuration).createOutboundResource(e,t).then(function(e){return e(n.axios,n.basePath)})},i.prototype.createOutboundResourceDisplay=function(e,t,n){var r=this;return b(this.configuration).createOutboundResourceDisplay(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.deleteOutboundResource=function(e,t,n){var r=this;return b(this.configuration).deleteOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.deleteOutboundResourceDisplay=function(e,t,n,r){var i=this;return b(this.configuration).deleteOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},i.prototype.patchOutboundResource=function(e,t,n){var r=this;return b(this.configuration).patchOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.readOutboundResource=function(e,t,n){var r=this;return b(this.configuration).readOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.readOutboundResourceDisplay=function(e,t,n,r){var i=this;return b(this.configuration).readOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},i.prototype.searchOutboundResource=function(e,t,n,r,i,a,s){var o=this;return b(this.configuration).searchOutboundResource(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},i.prototype.searchOutboundResourceDisplay=function(e,t,n,r,i,a,s,o){var u=this;return b(this.configuration).searchOutboundResourceDisplay(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},i.prototype.updateOutboundResource=function(e,t,n){var r=this;return b(this.configuration).updateOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},i.prototype.updateOutboundResourceDisplay=function(e,t,n,r){var i=this;return b(this.configuration).updateOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var at,st=i;function i(){return null!==at&&at.apply(this,arguments)||this}function ot(g){var e=this;return{createQueueBucket:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createQueueBucket.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteQueueBucket:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling deleteQueueBucket.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},patchQueueBucket:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling patchQueueBucket.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling patchQueueBucket.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling patchQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})},readQueueBucket:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling readQueueBucket.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchQueueBucket:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling searchQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),f.headers),[2,{url:J.format(t),options:r}]}})})},updateQueueBucket:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling updateQueueBucket.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateQueueBucket.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function ut(l){return{createQueueBucket:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ot(l).createQueueBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueBucket:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ot(l).deleteQueueBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueueBucket:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ot(l).patchQueueBucket(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueBucket:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ot(l).readQueueBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueBucket:function(t,r,i,a,s,o,u,c){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ot(l).searchQueueBucket(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueBucket:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,ot(l).updateQueueBucket(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ct=e,N.__extends(dt,ct),dt.prototype.createQueueBucket=function(e,t,n){var r=this;return ut(this.configuration).createQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},dt.prototype.deleteQueueBucket=function(e,t,n){var r=this;return ut(this.configuration).deleteQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},dt.prototype.patchQueueBucket=function(e,t,n,r){var i=this;return ut(this.configuration).patchQueueBucket(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},dt.prototype.readQueueBucket=function(e,t,n){var r=this;return ut(this.configuration).readQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},dt.prototype.searchQueueBucket=function(e,t,n,r,i,a,s,o){var u=this;return ut(this.configuration).searchQueueBucket(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},dt.prototype.updateQueueBucket=function(e,t,n,r){var i=this;return ut(this.configuration).updateQueueBucket(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var ct,lt=dt;function dt(){return null!==ct&&ct.apply(this,arguments)||this}function _t(y){var e=this;return{createQueueHook:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createQueueHook.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createQueueHook.");return(t="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteQueueHook:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling deleteQueueHook.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},patchQueueHook:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling patchQueueHook.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling patchQueueHook.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling patchQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),_),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})},readQueueHook:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling readQueueHook.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchQueueHook:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling searchQueueHook.");return(t="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),v),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),f&&(a.schema_id=f),g&&(a.event=g),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),v.headers),[2,{url:J.format(t),options:r}]}})})},updateQueueHook:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling updateQueueHook.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateQueueHook.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function ht(_){return{createQueueHook:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,_t(_).createQueueHook(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueHook:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,_t(_).deleteQueueHook(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueueHook:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,_t(_).patchQueueHook(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueHook:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,_t(_).readQueueHook(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueHook:function(t,r,i,a,s,o,u,c,l,d){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,_t(_).searchQueueHook(t,r,i,a,s,o,u,c,l,d)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueHook:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,_t(_).updateQueueHook(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}pt=e,N.__extends(gt,pt),gt.prototype.createQueueHook=function(e,t,n){var r=this;return ht(this.configuration).createQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},gt.prototype.deleteQueueHook=function(e,t,n){var r=this;return ht(this.configuration).deleteQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},gt.prototype.patchQueueHook=function(e,t,n,r){var i=this;return ht(this.configuration).patchQueueHook(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},gt.prototype.readQueueHook=function(e,t,n){var r=this;return ht(this.configuration).readQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},gt.prototype.searchQueueHook=function(e,t,n,r,i,a,s,o,u,c){var l=this;return ht(this.configuration).searchQueueHook(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},gt.prototype.updateQueueHook=function(e,t,n,r){var i=this;return ht(this.configuration).updateQueueHook(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var pt,ft=gt;function gt(){return null!==pt&&pt.apply(this,arguments)||this}function vt(g){var e=this;return{createQueueResourceGroup:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createQueueResourceGroup.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteQueueResourceGroup:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling deleteQueueResourceGroup.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},readQueueResourceGroup:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling readQueueResourceGroup.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},searchQueueResourceGroup:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling searchQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),f),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),f.headers),[2,{url:J.format(t),options:r}]}})})},updateQueueResourceGroup:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling updateQueueResourceGroup.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateQueueResourceGroup.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),g&&(n=g.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function yt(l){return{createQueueResourceGroup:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,vt(l).createQueueResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueResourceGroup:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,vt(l).deleteQueueResourceGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueResourceGroup:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,vt(l).readQueueResourceGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueResourceGroup:function(t,r,i,a,s,o,u,c){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,vt(l).searchQueueResourceGroup(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueResourceGroup:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,vt(l).updateQueueResourceGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}bt=e,N.__extends(mt,bt),mt.prototype.createQueueResourceGroup=function(e,t,n){var r=this;return yt(this.configuration).createQueueResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},mt.prototype.deleteQueueResourceGroup=function(e,t,n,r){var i=this;return yt(this.configuration).deleteQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},mt.prototype.readQueueResourceGroup=function(e,t,n,r){var i=this;return yt(this.configuration).readQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},mt.prototype.searchQueueResourceGroup=function(e,t,n,r,i,a,s,o){var u=this;return yt(this.configuration).searchQueueResourceGroup(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},mt.prototype.updateQueueResourceGroup=function(e,t,n,r){var i=this;return yt(this.configuration).updateQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var bt,wt=mt;function mt(){return null!==bt&&bt.apply(this,arguments)||this}function qt(w){var e=this;return{createQueue:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createQueue.");return(t=J.parse("/call_center/queues",!0),w&&(n=w.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteQueue:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),w&&(n=w.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},patchQueue:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchQueue.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),w&&(n=w.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readQueue:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),w&&(n=w.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchQueue:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/queues",!0),w&&(n=w.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),f),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.type=p),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),f.headers),[2,{url:J.format(t),options:r}]}})})},searchQueueReportGeneral:function(u,c,l,d,_,h,p,f,g,v,y,b){return void 0===b&&(b={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/queues/reports/general",!0),w&&(n=w.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),b),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a["joined_at.from"]=l),void 0!==d&&(a["joined_at.to"]=d),void 0!==_&&(a.domain_id=_),h&&(a.fields=h),void 0!==p&&(a.sort=p),void 0!==f&&(a.q=f),g&&(a.queue_id=g),v&&(a.team_id=v),y&&(a.type=y),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),b.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),b.headers),[2,{url:J.format(t),options:r}]}})})},updateQueue:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateQueue.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),w&&(n=w.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},w&&w.apiKey)?"function"!=typeof w.apiKey?[3,2]:[4,w.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,w.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function w(p){return{createQueue:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,qt(p).createQueue(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueue:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,qt(p).deleteQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueue:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,qt(p).patchQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueue:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,qt(p).readQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueue:function(t,r,i,a,s,o,u,c){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,qt(p).searchQueue(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueReportGeneral:function(t,r,i,a,s,o,u,c,l,d,_,h){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,qt(p).searchQueueReportGeneral(t,r,i,a,s,o,u,c,l,d,_,h)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueue:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,qt(p).updateQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}At=e,N.__extends(Rt,At),Rt.prototype.createQueue=function(e,t){var n=this;return w(this.configuration).createQueue(e,t).then(function(e){return e(n.axios,n.basePath)})},Rt.prototype.deleteQueue=function(e,t,n){var r=this;return w(this.configuration).deleteQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Rt.prototype.patchQueue=function(e,t,n){var r=this;return w(this.configuration).patchQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Rt.prototype.readQueue=function(e,t,n){var r=this;return w(this.configuration).readQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Rt.prototype.searchQueue=function(e,t,n,r,i,a,s,o){var u=this;return w(this.configuration).searchQueue(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},Rt.prototype.searchQueueReportGeneral=function(e,t,n,r,i,a,s,o,u,c,l,d){var _=this;return w(this.configuration).searchQueueReportGeneral(e,t,n,r,i,a,s,o,u,c,l,d).then(function(e){return e(_.axios,_.basePath)})},Rt.prototype.updateQueue=function(e,t,n){var r=this;return w(this.configuration).updateQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var At,Ct=Rt;function Rt(){return null!==At&&At.apply(this,arguments)||this}function St(q){var e=this;return{createQueueSkill:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling createQueueSkill.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createQueueSkill.");return(t="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(c))),t=J.parse(t,!0),q&&(n=q.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),d),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},deleteQueueSkill:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling deleteQueueSkill.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling deleteQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),q&&(n=q.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},patchQueueSkill:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling patchQueueSkill.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling patchQueueSkill.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling patchQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),q&&(n=q.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),_),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})},readQueueSkill:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling readQueueSkill.");if(null==c)throw new O("id","Required parameter id was null or undefined when calling readQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),q&&(n=q.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchQueueSkill:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m){return void 0===m&&(m={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("queueId","Required parameter queueId was null or undefined when calling searchQueueSkill.");return(t="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(u))),t=J.parse(t,!0),q&&(n=q.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),m),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),f&&(a.skill_id=f),g&&(a.bucket_id=g),v&&(a.lvl=v),y&&(a.min_capacity=y),b&&(a.max_capacity=b),void 0!==w&&(a.enabled=w),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),m.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),m.headers),[2,{url:J.format(t),options:r}]}})})},updateQueueSkill:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("queueId","Required parameter queueId was null or undefined when calling updateQueueSkill.");if(null==l)throw new O("id","Required parameter id was null or undefined when calling updateQueueSkill.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling updateQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=J.parse(t,!0),q&&(n=q.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),_),i={},a={},q&&q.apiKey)?"function"!=typeof q.apiKey?[3,2]:[4,q.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,q.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})}}}function Kt(g){return{createQueueSkill:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,St(g).createQueueSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueSkill:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,St(g).deleteQueueSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueueSkill:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,St(g).patchQueueSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueSkill:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,St(g).readQueueSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueSkill:function(t,r,i,a,s,o,u,c,l,d,_,h,p,f){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,St(g).searchQueueSkill(t,r,i,a,s,o,u,c,l,d,_,h,p,f)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueSkill:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,St(g).updateQueueSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Pt=e,N.__extends(Ot,Pt),Ot.prototype.createQueueSkill=function(e,t,n){var r=this;return Kt(this.configuration).createQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ot.prototype.deleteQueueSkill=function(e,t,n){var r=this;return Kt(this.configuration).deleteQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ot.prototype.patchQueueSkill=function(e,t,n,r){var i=this;return Kt(this.configuration).patchQueueSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Ot.prototype.readQueueSkill=function(e,t,n){var r=this;return Kt(this.configuration).readQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ot.prototype.searchQueueSkill=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){var p=this;return Kt(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)})},Ot.prototype.updateQueueSkill=function(e,t,n,r){var i=this;return Kt(this.configuration).updateQueueSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var Pt,Tt=Ot;function Ot(){return null!==Pt&&Pt.apply(this,arguments)||this}function kt(y){var e=this;return{createRegion:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createRegion.");return(t=J.parse("/regions",!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteRegion:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),c),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},patchRegion:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchRegion.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readRegion:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),c),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},searchRegion:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/regions",!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),v),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),void 0!==f&&(a.description=f),g&&(a.timezone_id=g),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),v.headers),[2,{url:J.format(t),options:r}]}})})},updateRegion:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateRegion.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function It(_){return{createRegion:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,kt(_).createRegion(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRegion:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,kt(_).deleteRegion(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchRegion:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,kt(_).patchRegion(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRegion:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,kt(_).readRegion(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRegion:function(t,r,i,a,s,o,u,c,l,d){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,kt(_).searchRegion(t,r,i,a,s,o,u,c,l,d)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRegion:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,kt(_).updateRegion(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Wt=e,N.__extends(xt,Wt),xt.prototype.createRegion=function(e,t){var n=this;return It(this.configuration).createRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},xt.prototype.deleteRegion=function(e,t){var n=this;return It(this.configuration).deleteRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},xt.prototype.patchRegion=function(e,t,n){var r=this;return It(this.configuration).patchRegion(e,t,n).then(function(e){return e(r.axios,r.basePath)})},xt.prototype.readRegion=function(e,t){var n=this;return It(this.configuration).readRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},xt.prototype.searchRegion=function(e,t,n,r,i,a,s,o,u,c){var l=this;return It(this.configuration).searchRegion(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},xt.prototype.updateRegion=function(e,t,n){var r=this;return It(this.configuration).updateRegion(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Wt,Xt=xt;function xt(){return null!==Wt&&Wt.apply(this,arguments)||this}function Et(v){var e=this;return{createChatPlan:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createChatPlan.");return(t=J.parse("/routing/outbound/chat",!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteChatPlan:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),c),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},patchChatPlan:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchChatPlan.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readChatPlan:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),c),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})},searchChatPlan:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/routing/outbound/chat",!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),void 0!==f&&(a.enabled=f),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),g.headers),[2,{url:J.format(t),options:r}]}})})},updateChatPlan:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateChatPlan.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),v&&(n=v.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function Qt(d){return{createChatPlan:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Et(d).createChatPlan(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteChatPlan:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Et(d).deleteChatPlan(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchChatPlan:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Et(d).patchChatPlan(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readChatPlan:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Et(d).readChatPlan(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchChatPlan:function(t,r,i,a,s,o,u,c,l){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Et(d).searchChatPlan(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateChatPlan:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Et(d).updateChatPlan(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}jt=e,N.__extends(Gt,jt),Gt.prototype.createChatPlan=function(e,t){var n=this;return Qt(this.configuration).createChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},Gt.prototype.deleteChatPlan=function(e,t){var n=this;return Qt(this.configuration).deleteChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},Gt.prototype.patchChatPlan=function(e,t,n){var r=this;return Qt(this.configuration).patchChatPlan(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Gt.prototype.readChatPlan=function(e,t){var n=this;return Qt(this.configuration).readChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},Gt.prototype.searchChatPlan=function(e,t,n,r,i,a,s,o,u){var c=this;return Qt(this.configuration).searchChatPlan(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},Gt.prototype.updateChatPlan=function(e,t,n){var r=this;return Qt(this.configuration).updateChatPlan(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var jt,Ut=Gt;function Gt(){return null!==jt&&jt.apply(this,arguments)||this}function Bt(b){var e=this;return{createRoutingOutboundCall:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createRoutingOutboundCall.");return(t=J.parse("/routing/outbound/calls",!0),b&&(n=b.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteRoutingOutboundCall:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),b&&(n=b.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},movePositionRoutingOutboundCall:function(c,l,d,_){return void 0===_&&(_={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("fromId","Required parameter fromId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==l)throw new O("toId","Required parameter toId was null or undefined when calling movePositionRoutingOutboundCall.");if(null==d)throw new O("body","Required parameter body was null or undefined when calling movePositionRoutingOutboundCall.");return(t="/routing/outbound/calls/{from_id}/to/{to_id}".replace("{from_id}",encodeURIComponent(String(c))).replace("{to_id}",encodeURIComponent(String(l))),t=J.parse(t,!0),b&&(n=b.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),_),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),_.headers),u="string"!=typeof d||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==d?d:{}):d||"",[2,{url:J.format(t),options:r}]}})})},patchRoutingOutboundCall:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchRoutingOutboundCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),b&&(n=b.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readRoutingOutboundCall:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),b&&(n=b.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchRoutingOutboundCall:function(u,c,l,d,_,h,p,f,g,v,y){return void 0===y&&(y={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/routing/outbound/calls",!0),b&&(n=b.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),y),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),f&&(a.schema_id=f),void 0!==g&&(a.pattern=g),void 0!==v&&(a.description=v),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),y.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),y.headers),[2,{url:J.format(t),options:r}]}})})},updateRoutingOutboundCall:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateRoutingOutboundCall.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),b&&(n=b.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function m(h){return{createRoutingOutboundCall:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).createRoutingOutboundCall(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRoutingOutboundCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).deleteRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},movePositionRoutingOutboundCall:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).movePositionRoutingOutboundCall(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchRoutingOutboundCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).patchRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRoutingOutboundCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).readRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRoutingOutboundCall:function(t,r,i,a,s,o,u,c,l,d,_){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).searchRoutingOutboundCall(t,r,i,a,s,o,u,c,l,d,_)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRoutingOutboundCall:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).updateRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Mt=e,N.__extends(Lt,Mt),Lt.prototype.createRoutingOutboundCall=function(e,t){var n=this;return m(this.configuration).createRoutingOutboundCall(e,t).then(function(e){return e(n.axios,n.basePath)})},Lt.prototype.deleteRoutingOutboundCall=function(e,t,n){var r=this;return m(this.configuration).deleteRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Lt.prototype.movePositionRoutingOutboundCall=function(e,t,n,r){var i=this;return m(this.configuration).movePositionRoutingOutboundCall(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Lt.prototype.patchRoutingOutboundCall=function(e,t,n){var r=this;return m(this.configuration).patchRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Lt.prototype.readRoutingOutboundCall=function(e,t,n){var r=this;return m(this.configuration).readRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Lt.prototype.searchRoutingOutboundCall=function(e,t,n,r,i,a,s,o,u,c,l){var d=this;return m(this.configuration).searchRoutingOutboundCall(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(d.axios,d.basePath)})},Lt.prototype.updateRoutingOutboundCall=function(e,t,n){var r=this;return m(this.configuration).updateRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Mt,Ht=Lt;function Lt(){return null!==Mt&&Mt.apply(this,arguments)||this}function Dt(y){var e=this;return{createRoutingSchema:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createRoutingSchema.");return(t=J.parse("/routing/schema",!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteRoutingSchema:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},patchRoutingSchema:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchRoutingSchema.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"PATCH"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})},readRoutingSchema:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchRoutingSchema:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/routing/schema",!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),v),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),f&&(a.type=f),void 0!==g&&(a.editor=g),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),v.headers),[2,{url:J.format(t),options:r}]}})})},updateRoutingSchema:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateRoutingSchema.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),y&&(n=y.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function Ft(_){return{createRoutingSchema:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(_).createRoutingSchema(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRoutingSchema:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(_).deleteRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchRoutingSchema:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(_).patchRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRoutingSchema:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(_).readRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRoutingSchema:function(t,r,i,a,s,o,u,c,l,d){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(_).searchRoutingSchema(t,r,i,a,s,o,u,c,l,d)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRoutingSchema:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Dt(_).updateRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Nt=e,N.__extends(zt,Nt),zt.prototype.createRoutingSchema=function(e,t){var n=this;return Ft(this.configuration).createRoutingSchema(e,t).then(function(e){return e(n.axios,n.basePath)})},zt.prototype.deleteRoutingSchema=function(e,t,n){var r=this;return Ft(this.configuration).deleteRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},zt.prototype.patchRoutingSchema=function(e,t,n){var r=this;return Ft(this.configuration).patchRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},zt.prototype.readRoutingSchema=function(e,t,n){var r=this;return Ft(this.configuration).readRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},zt.prototype.searchRoutingSchema=function(e,t,n,r,i,a,s,o,u,c){var l=this;return Ft(this.configuration).searchRoutingSchema(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},zt.prototype.updateRoutingSchema=function(e,t,n){var r=this;return Ft(this.configuration).updateRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Nt,Jt=zt;function zt(){return null!==Nt&&Nt.apply(this,arguments)||this}function Vt(_){var e=this;return{createRoutingVariable:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createRoutingVariable.");return(t=J.parse("/routing/variables",!0),_&&(n=_.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteRoutingVariable:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteRoutingVariable.");return(t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),_&&(n=_.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readRoutingVariable:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readRoutingVariable.");return(t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),_&&(n=_.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchRoutingVariable:function(u,c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/routing/variables",!0),_&&(n=_.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),d),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.domain_id=l),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),[2,{url:J.format(t),options:r}]}})})},updateRoutingVariable:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateRoutingVariable.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateRoutingVariable.");return(t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),_&&(n=_.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},_&&_.apiKey)?"function"!=typeof _.apiKey?[3,2]:[4,_.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,_.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function $t(s){return{createRoutingVariable:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Vt(s).createRoutingVariable(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRoutingVariable:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Vt(s).deleteRoutingVariable(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRoutingVariable:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Vt(s).readRoutingVariable(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRoutingVariable:function(t,r,i,a){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Vt(s).searchRoutingVariable(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRoutingVariable:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,Vt(s).updateRoutingVariable(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Yt=e,N.__extends(en,Yt),en.prototype.createRoutingVariable=function(e,t){var n=this;return $t(this.configuration).createRoutingVariable(e,t).then(function(e){return e(n.axios,n.basePath)})},en.prototype.deleteRoutingVariable=function(e,t,n){var r=this;return $t(this.configuration).deleteRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},en.prototype.readRoutingVariable=function(e,t,n){var r=this;return $t(this.configuration).readRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},en.prototype.searchRoutingVariable=function(e,t,n,r){var i=this;return $t(this.configuration).searchRoutingVariable(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},en.prototype.updateRoutingVariable=function(e,t,n){var r=this;return $t(this.configuration).updateRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Yt,Zt=en;function en(){return null!==Yt&&Yt.apply(this,arguments)||this}function tn(f){var e=this;return{createSkill:function(c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createSkill.");return(t=J.parse("/call_center/skills",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"POST"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__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:J.format(t),options:r}]}})})},deleteSkill:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteSkill.");return(t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"DELETE"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},readSkill:function(u,c,l){return void 0===l&&(l={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readSkill.");return(t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(u))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),l),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),l.headers),[2,{url:J.format(t),options:r}]}})})},searchSkill:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:return(t=J.parse("/call_center/skills",!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),p),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=N.__assign(N.__assign(N.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),p.headers),[2,{url:J.format(t),options:r}]}})})},updateSkill:function(c,l,d){return void 0===d&&(d={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return N.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateSkill.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateSkill.");return(t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(c))),t=J.parse(t,!0),f&&(n=f.baseOptions),r=N.__assign(N.__assign({method:"PUT"},n),d),i={},a={},f&&f.apiKey)?"function"!=typeof f.apiKey?[3,2]:[4,f.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,f.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=N.__assign(N.__assign(N.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),d.headers),u="string"!=typeof l||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==l?l:{}):l||"",[2,{url:J.format(t),options:r}]}})})}}}function nn(c){return{createSkill:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,tn(c).createSkill(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteSkill:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,tn(c).deleteSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readSkill:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,tn(c).readSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchSkill:function(t,r,i,a,s,o,u){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,tn(c).searchSkill(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateSkill:function(t,r,i){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,tn(c).updateSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}rn=e,N.__extends(sn,rn),sn.prototype.createSkill=function(e,t){var n=this;return nn(this.configuration).createSkill(e,t).then(function(e){return e(n.axios,n.basePath)})},sn.prototype.deleteSkill=function(e,t,n){var r=this;return nn(this.configuration).deleteSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},sn.prototype.readSkill=function(e,t,n){var r=this;return nn(this.configuration).readSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},sn.prototype.searchSkill=function(e,t,n,r,i,a,s){var o=this;return nn(this.configuration).searchSkill(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},sn.prototype.updateSkill=function(e,t,n){var r=this;return nn(this.configuration).updateSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var rn,an=sn;function sn(){return null!==rn&&rn.apply(this,arguments)||this}function on(l){var e=this;return{defaultDeviceConfig:function(u,c){return void 0===c&&(c={}),N.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return N.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("type","Required parameter type was null or undefined when calling defaultDeviceConfig.");return(t="/user/device/config/{type}".replace("{type}",encodeURIComponent(String(u))),t=J.parse(t,!0),l&&(n=l.baseOptions),r=N.__assign(N.__assign({method:"GET"},n),c),i={},a={},l&&l.apiKey)?"function"!=typeof l.apiKey?[3,2]:[4,l.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,l.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=N.__assign(N.__assign(N.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=N.__assign(N.__assign(N.__assign({},i),o),c.headers),[2,{url:J.format(t),options:r}]}})})}}}function un(i){return{defaultDeviceConfig:function(t,r){return N.__awaiter(this,void 0,void 0,function(){var n;return N.__generator(this,function(e){switch(e.label){case 0:return[4,on(i).defaultDeviceConfig(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=N.__assign(N.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}cn=e,N.__extends(dn,cn),dn.prototype.defaultDeviceConfig=function(e,t){var n=this;return un(this.configuration).defaultDeviceConfig(e,t).then(function(e){return e(n.axios,n.basePath)})};var cn,ln=dn;function dn(){return null!==cn&&cn.apply(this,arguments)||this}function _n(e){this.apiKey=(e=void 0===e?{}:e).apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions}(K=h.EngineBoolFilter||(h.EngineBoolFilter={})).Undefined="undefined",K.True="true",K.False="false",(K=h.HistoryFileJobHistoryFileJobAction||(h.HistoryFileJobHistoryFileJobAction={})).Undefined="undefined",K.STT="STT",K.Delete="delete",(K=h.HistoryFileJobHistoryFileJobState||(h.HistoryFileJobHistoryFileJobState={})).Idle="idle",K.Active="active",K.Finished="finished",K.Error="error",(h.ProtobufNullValue||(h.ProtobufNullValue={})).NULLVALUE="NULL_VALUE",(K=h.StorageImportSourceType||(h.StorageImportSourceType={})).DefaultSourceType="DefaultSourceType",K.Dialer="Dialer",(K=h.StorageProviderType||(h.StorageProviderType={})).DefaultProvider="DefaultProvider",K.Microsoft="Microsoft",(K=h.StorageServiceType||(h.StorageServiceType={})).DefaultService="DefaultService",K.STT="STT",K.TTS="TTS",(K=h.StorageUploadStatusCode||(h.StorageUploadStatusCode={})).Unknown="Unknown",K.Ok="Ok",K.Failed="Failed",pn.prototype.debug=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("debug",e,t)},pn.prototype.info=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("info",e,t)},pn.prototype.warn=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("warn",e,t)},pn.prototype.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("error",e,t)},pn.prototype.emitLogMessage=function(e,t,n){0<n.length?console[e].apply(console,N.__spreadArrays([t],n)):console[e](t)};var hn=pn;function pn(){}Object.defineProperty(gn.prototype,"id",{get:function(){return this.session.id},enumerable:!0,configurable:!0}),gn.prototype.getLocalMedia=function(){if(this.session.connection){var e=this.session.connection.getLocalStreams();if(e.length)return e}return[]},gn.prototype.getPeerMedia=function(){if(this.session.connection){var e=this.session.connection.getRemoteStreams();if(e.length)return e}return[]},gn.prototype.answer=function(e){var t=this;return new Promise(function(){t.session.answer(e)})};var fn=gn;function gn(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")}vn=T.EventEmitter,N.__extends(a,vn),a.prototype.callOption=function(n){return void 0===n&&(n={}),N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){switch(e.label){case 0:return[4,this.getUserCallStream(n)];case 1:return t=e.sent(),[2,{sessionTimersExpires:120,pcConfig:n.disableStun?void 0:{iceServers:[{urls:["stun:stun.l.google.com:19302"]}]},mediaStream:t}]}})})},a.prototype.answer=function(r,i){return N.__awaiter(this,void 0,void 0,function(){var t,n;return N.__generator(this,function(e){switch(e.label){case 0:return this.sessionCache.has(r)?(t=this.sessionCache.get(r),[4,this.callOption(i)]):[3,2];case 1:return n=e.sent(),[2,t.answer(n)];case 2:return[2,!1]}})})},a.prototype.call=function(r){return N.__awaiter(this,void 0,void 0,function(){var t,n;return N.__generator(this,function(e){switch(e.label){case 0:if(n={},t=null,r.params&&(n.audio=r.params.audio,n.video=r.params.video||!1,n.screen=r.params.screen||!1,n.disableStun=r.params.disableStun||!1),"string"!=typeof r.destination)throw new Error("bad destination type");return[4,this.callOption(n)];case 1:return n=e.sent(),r.params&&r.params.display&&(t={extraHeaders:["X-Webitel-Display: "+r.params.display]}),[4,this.ua.call(r.destination,N.__assign(N.__assign({},n),t))];case 2:return e.sent(),[2]}})})},a.prototype.register=function(n){return N.__awaiter(this,void 0,void 0,function(){var t,i=this;return N.__generator(this,function(e){return t=new k.WebSocketInterface(n.server),t={realm:n.realm,uri:n.uri,authorization_user:n.authorization_user,ha1:n.ha1,user_agent:a.userAgent,sockets:[t],session_timers:!0,display_name:n.display_name,register_expires:n.register_expires||90,connection_recovery_min_interval:5,connection_recovery_max_interval:60},(t=this.ua=new k.UA(t)).on("newRTCSession",function(e){var t=e.session,n=t.id,r=new fn(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 N.__awaiter(i,void 0,void 0,function(){return N.__generator(this,function(e){return this.emit("peerStreams",r,new Array(t.stream)),[2]})})})}),t.on("ended",function(){i.removeSession(n,t.connection)}),t.on("failed",function(){i.removeSession(n,t.connection)}),t.on("accepted",function(){r.incoming||i.emit("peerStreams",r,t.connection.getRemoteStreams())}),t.on("confirmed",function(){}),i.emit("newSession",r)}),t.on("disconnected",function(e){i.emit("unregistered")}),t.on("unregistered",function(e){i.emit("unregistered")}),t.on("registrationFailed",function(e){i.log.error("registrationFailed",e)}),t.on("registered",function(e){i.emit("registered")}),t.start(),[2]})})},a.prototype.unregister=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){switch(e.label){case 0:return this.ua?(this.ua.terminateSessions(),this.ua.removeAllListeners(),[4,this.ua.stop()]):[3,2];case 1:e.sent(),delete this.ua,e.label=2;case 2:return[2]}})})},a.prototype.sipSessionByCallId=function(e){for(var t=0,n=this.allSession;t<n.length;t++){var r=n[t];if(r.callId===e)return r}return null},a.prototype.sipSessionBySipId=function(e){for(var t=0,n=this.allSession;t<n.length;t++){var r=n[t];if(r.id.startsWith(e))return r}return null},a.prototype.removeSession=function(e,t){var n;return t&&(n=t.getLocalStreams(),t=t.getRemoteStreams(),n&&n.forEach(function(e){e.getTracks().forEach(function(e){e.stop()})}),t&&t.forEach(function(e){e.getTracks().forEach(function(e){e.stop()})})),!!this.sessionCache.has(e)&&(this.sessionCache.delete(e),!0)},a.prototype.storeSession=function(e,t){if(this.sessionCache.has(e))throw new Error("Session already store");this.sessionCache.set(e,t)},Object.defineProperty(a.prototype,"allSession",{get:function(){return Array.from(this.sessionCache.values())},enumerable:!0,configurable:!0}),a.prototype.getMediaConstraints=function(e){return e.screen?{video:!1,audio:!1,screen:!0}:{video:e.video||!1,audio:!0}},a.prototype.getSession=function(e){return this.sessionCache.has(e)?this.sessionCache.get(e):null},a.prototype.hasSession=function(e){return this.sessionCache.has(e)},a.prototype.getUserScreen=function(){return N.__awaiter(this,void 0,void 0,function(){var t=this;return N.__generator(this,function(e){return[2,new Promise(function(n,r){return N.__awaiter(t,void 0,void 0,function(){var t;return N.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,navigator.mediaDevices.getDisplayMedia()];case 1:return t=e.sent(),n(t),[3,3];case 2:return t=e.sent(),r(t),[3,3];case 3:return[2]}})})})]})})},a.prototype.getUserCallStream=function(r){return N.__awaiter(this,void 0,void 0,function(){var t,n;return N.__generator(this,function(e){switch(e.label){case 0:return!0!==r.screen?[3,2]:[4,this.getUserScreen()];case 1:t=e.sent(),e.label=2;case 2:return!1!==r.audio||r.video?[4,this.getUserMedia(r.audio,r.video)]:[3,4];case 3:n=e.sent(),t?n.getTracks().forEach(function(e){t.addTrack(e)}):t=n,e.label=4;case 4:if(t)return[2,t];throw new Error("bad stream request")}})})},a.prototype.getUserMedia=function(i,a){return N.__awaiter(this,void 0,void 0,function(){var t=this;return N.__generator(this,function(e){return[2,new Promise(function(n,r){return N.__awaiter(t,void 0,void 0,function(){var t;return N.__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 N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,new Promise(function(t,n){navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia(r).then(function(e){return t(e)}).catch(function(e){return n(e)}):(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)(r,function(e){return t(e)},function(e){return n(e)})})]})})}(t).then(n).catch(r)]})})})]})})},a.userAgent="Webitel-Phone/0.0.1";var vn,yn=a;function a(e,t){var n=vn.call(this)||this;return n.instanceId=e,n.type="webrtc",n.sessionCache=new Map,t?k.debug.enable("*"):k.debug.disable(),n.log=new hn,n.on("unregistered",function(){n.sessionCache.clear()}),n}(K=h.JobState||(h.JobState={})).Distribute="distribute",K.Offering="offering",K.Bridged="bridged",K.Missed="missed",K.Processing="processing",K.Closed="closed",K.Destroy="destroy",(K=bn=bn||{}).Call="call",K.Chat="chat",K.Task="task",Object.defineProperty(s.prototype,"queue",{get:function(){return{id:this.distribute.queue_id,name:this.distribute.queue_name}},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"duration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"hasForm",{get:function(){return this.distribute.has_form||!1},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"channel",{get:function(){return this.distribute.channel},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"allowAccept",{get:function(){return this.channel===bn.Task&&0===this.bridgedAt&&0===this.closedAt},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"allowDecline",{get:function(){return this.allowAccept},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"allowClose",{get:function(){return this.channel===bn.Task&&0===this.closedAt&&0<this.bridgedAt},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"memberId",{get:function(){return this.distribute.member_id},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"queueId",{get:function(){return this.distribute.queue_id},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"hasReporting",{get:function(){return this.distribute.has_reporting},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"allowReporting",{get:function(){return this.hasReporting&&0<this.bridgedAt},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"agentChannelId",{get:function(){return this.distribute.agent_channel_id},enumerable:!0,configurable:!0}),s.prototype.setState=function(e){this.state=e},s.prototype.setAnswered=function(e){this.answeredAt=e,this.lastStatusChange=Date.now()},s.prototype.setOffering=function(e){this.offeringAt=e.timestamp},s.prototype.setBridged=function(e){this.bridgedAt=e.timestamp,this.lastStatusChange=Date.now(),e.form&&(this.form=e.form)},s.prototype.setProcessing=function(e,t){this.state=h.JobState.Processing,this.closedAt=e,this.startProcessingAt||(this.startProcessingAt=Date.now()),t.sec&&!t.timeout&&(t.timeout=Date.now()+1e3*t.sec),this._processing=t},s.prototype.setClosed=function(e){this.stopAt=e,this.state=h.JobState.Closed},s.prototype.setTransferred=function(e){this.distribute=e,this.history.push(e)},s.prototype.setMissed=function(){this.state=h.JobState.Missed},Object.defineProperty(s.prototype,"processingTimeoutAt",{get:function(){return this._processing&&this._processing.timeout?this._processing.timeout:null},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"processingSec",{get:function(){return this._processing&&this._processing.sec?this._processing.sec:null},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"attempt",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"variables",{get:function(){var e,t={};for(e in this.distribute.variables)e.startsWith("cc_")||(t[e]=this.distribute.variables[e]);return t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"isMember",{get:function(){return!!this.memberId},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"displayNumber",{get:function(){return this.communication.destination},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"displayName",{get:function(){return this.distribute.member_name||null},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"display",{get:function(){return this.displayName+" ("+this.displayNumber+")"},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"renewalSec",{get:function(){return this._processing&&this._processing.renewal_sec?this._processing.renewal_sec:null},enumerable:!0,configurable:!0}),s.prototype.accept=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("cc_agent_task_accept",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})]})})},s.prototype.close=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("cc_agent_task_close",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})]})})},s.prototype.decline=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("cc_agent_task_close",{agent_id:this.distribute.agent_id,attempt_id:this.id,app_id:this.distribute.app_id})]})})},s.prototype.reporting=function(n){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.request("cc_reporting",N.__assign({attempt_id:this.id},n))];case 1:return t=e.sent(),this.reportedAt=Date.now(),[2,t]}})})},s.prototype.renew=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("cc_renewal",{attempt_id:this.id,renewal_sec:t||this.processingSec})]})})},s.prototype.formAction=function(t,n){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.form)return[2,this.client.request("cc_form_action",{attempt_id:this.id,app_id:this.distribute.app_id,action:t,fields:n})];throw new Error("not found active form")})})};var bn,wn=s;function s(e,t,n){this.client=e,this.distribute=n,this.id=t.attempt_id,this.state=h.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]}(K=h.AgentStatus||(h.AgentStatus={})).Online="online",K.Offline="offline",K.Pause="pause",K.BreakOut="break_out",(K=h.ChannelState||(h.ChannelState={})).Waiting="waiting",K.Distribute="distribute",K.Offering="offering",K.Answered="answered",K.Active="active",K.Bridged="bridged",K.Hold="hold",K.Missed="missed",K.WrapTime="wrap_time",K.Processing="processing",K.Transfer="transfer",K.Form="form",(K=h.ChannelType||(h.ChannelType={})).Call="call",K.Email="email",K.Chat="chat",K.Job="task";Object.defineProperty(o.prototype,"agentId",{get:function(){return this.info.agent_id},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"onDemand",{get:function(){return this.info.on_demand},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"status",{get:function(){return this.info.status},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"statusPayload",{get:function(){return this.info.status_payload},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isAdmin",{get:function(){return this.info.is_admin},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isSupervisor",{get:function(){return this.info.is_supervisor},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"team",{get:function(){return this.info.team},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"supervisor",{get:function(){return this.info.supervisor},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"auditor",{get:function(){return this.info.auditor},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"channels",{get:function(){return[this._channel]},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"channel",{get:function(){return this._channel},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"stateDuration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!0,configurable:!0}),o.prototype.onChannelEvent=function(e){var t=this;switch(e.status){case h.ChannelState.Distribute:var n=e;if(!n)throw new Error("bad event");if(i=new wn(this.client,e,n.distribute),this.task.set(i.id,i),i.agentChannelId)switch(i.channel){case h.ChannelType.Call:var r=this.client.callById(i.agentChannelId);r&&!r.task&&(r.task=i);break;case h.ChannelType.Chat:r=this.client.conversationById(i.agentChannelId);r&&!r.task&&(r.task=i)}break;case h.ChannelState.Offering:var i,n=e;(i=this.task.get(e.attempt_id))&&(i.setOffering(n),n.offering.auto_answer&&i.channel===h.ChannelType.Job&&i.accept().catch(function(e){t.client.emit("error",e)}));break;case h.ChannelState.Bridged:n=e;(i=this.task.get(n.attempt_id))&&i.setBridged(n);break;case h.ChannelState.Transfer:n=e;(i=this.task.get(n.to_attempt_id))&&(this.task.delete(i.id),i.id=n.attempt_id,i.setTransferred(n.distribute),this.task.set(i.id,i));break;case h.ChannelState.Answered:(i=this.task.get(e.attempt_id))&&(i.answeredAt=e.timestamp);break;case h.ChannelState.Form:n=e;return void((i=this.task.get(e.attempt_id))&&(i.form=n.form||null));case h.ChannelState.Missed:if(e.attempt_id&&(i=this.task.get(e.attempt_id))){i.stopAt=e.timestamp;n=e;if(n)return i.setMissed(),this.setChannelStateTimeout(e.channel,e,n.missed.timeout),this.task.delete(e.attempt_id),this.client.reportingChannelTask(i),i;throw new Error("bad event")}break;case h.ChannelState.WrapTime:if(e.attempt_id){if(!e)throw new Error("bad event");i=this.task.get(e.attempt_id),this.task.delete(e.attempt_id),this.client.reportingChannelTask(i)}break;case h.ChannelState.Processing:if(e.attempt_id){n=e;if(!n)throw new Error("bad event");if(i=this.task.get(e.attempt_id))return i.setProcessing(e.timestamp,n.processing),this.setChannelStateTimeout(e.channel,e,n.processing.timeout||0),i}break;case h.ChannelState.Waiting:e.attempt_id&&(i=this.task.get(e.attempt_id))&&(i.setClosed(e.timestamp),this.task.delete(e.attempt_id),this.client.reportingChannelTask(i))}if(this.setChannelState(e.channel,e),i)return i.setState(e.status),i},o.prototype.online=function(t,n){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.agentSetOnline(this.agentId,t,n)]})})},o.prototype.waiting=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.agentSetWaiting(this.agentId,t)]})})},o.prototype.pause=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.agentSetPause(this.agentId,t)]})})},o.prototype.offline=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.agentSetOffline(this.agentId)]})})},o.prototype.setStatus=function(e){e.status===h.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||null,this.lastStatusChange=Date.now()},o.prototype.directMember=function(t,n){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("cc_member_direct",{agent_id:this.agentId,member_id:t,communication_id:n})]})})},o.prototype.offlineMembers=function(t,n,r){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("cc_fetch_offline_members",{agent_id:this.agentId,page:n,q:t,per_page:r})]})})},o.prototype.hasTask=function(e){return this.task.has(e.id)},o.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},o.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};var mn=o;function o(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}(K=h.CallReportingStatus||(h.CallReportingStatus={})).Abandoned="abandoned",K.Cancel="cancel",K.Success="success",K.Failed="failed",K.Missed="missed",K.Timeout="timeout",K.Endless="endless",K.Transferred="transferred",(K=h.CallActions||(h.CallActions={})).Ringing="ringing",K.Active="active",K.Bridge="bridge",K.Hold="hold",K.DTMF="dtmf",K.Voice="voice",K.Silence="silence",K.Execute="execute",K.Update="update",K.Hangup="hangup",K.Reporting="reporting",K.PeerStream="peerStream",K.LocalStream="localStream",K.Destroy="destroy",(K=h.CallDirection||(h.CallDirection={})).Inbound="inbound",K.Outbound="outbound";u.prototype.setState=function(e){this.state=e.event},u.prototype.setSip=function(e){e&&!this.sip&&(this.sip=e,this.localStreams=e.getLocalMedia(),this.peerStreams=e.getPeerMedia())},Object.defineProperty(u.prototype,"duration",{get:function(){return 0===this.hangupAt?Math.round((Date.now()-this.createdAt)/1e3):Math.round((this.hangupAt-this.createdAt)/1e3)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"allowDtmf",{get:function(){return 0<this.answeredAt&&this.allowHangup},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"allowHangup",{get:function(){return 0===this.hangupAt},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"allowHold",{get:function(){return 0===this.hangupAt&&("active"===this.state||"bridge"===this.state)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"allowAnswer",{get:function(){return this.client.phone&&0===this.hangupAt&&0===this.answeredAt&&(this.queue||this.direction===h.CallDirection.Inbound||this.params&&!this.params.autoAnswer)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"allowUnHold",{get:function(){return 0===this.hangupAt&&"hold"===this.state},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"memberCommunication",{get:function(){return this.task?this.task.communication:null},enumerable:!0,configurable:!0}),u.prototype.getMember=function(e){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.isMember)return[2,this.client.request("cc_member_page",{queue_id:this.task.queueId,member_id:this.task.memberId})];throw new Error("call is not from outbound queue")})})},Object.defineProperty(u.prototype,"isMember",{get:function(){return!(!this.task||!this.task.isMember)},enumerable:!0,configurable:!0}),u.prototype.setActive=function(e){this.answeredAt||(this.direction===h.CallDirection.Inbound&&(this.bridgedAt=+e.timestamp,this.parentId&&(this.bridgedId=this.parentId)),this.answeredAt=+e.timestamp),this.setState(e)},u.prototype.setBridged=function(e){var t=e.data;this.bridgedAt||(this.bridgedAt=+e.timestamp),this.bridgedId=t.bridged_id,t.to&&(this.direction===h.CallDirection.Inbound?this.from=t.to:this.to=t.to),this.bridgedId=t.bridged_id,t.payload&&(this.variables=t.payload),t.queue&&(this.queue=t.queue)},u.prototype.setHold=function(e){this.setState(e)},u.prototype.setInfo=function(e){this.parentId=e.parent_id,this.destination=e.destination,this.direction=e.direction,this.from=e.from,this.to=e.to,this.variables=e.payload,this.queue=e.queue||null,this.sipId=e.sip_id||null,this.params=e.params},u.prototype.setPeerStreams=function(e){this.peerStreams=e||[]},u.prototype.setLocalStreams=function(e){this.localStreams=e||[]},u.prototype.setVoice=function(){this.voice=!0},u.prototype.setSilence=function(){this.voice=!1},u.prototype.setExecute=function(e){this.applications.push(e.application)},u.prototype.addDigit=function(e){this.digits.push(e.digit)},u.prototype.setHangup=function(e){var t=e.data;this.hangupAt=+e.timestamp,this.hangupCause=t.cause,this.hangupSipCode=t.sip,this.voice=!1,this.peerStreams=[],+t.reporting_at&&(this.reportingAt=+t.reporting_at),this.setState(e)},Object.defineProperty(u.prototype,"allowReporting",{get:function(){return 0<this.answeredAt&&this.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"hasReporting",{get:function(){return!!this.task&&this.task.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"display",{get:function(){return this.displayNumber+" ("+this.displayName+")"},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"muted",{get:function(){return this._muted},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"isHold",{get:function(){return this.state===h.CallActions.Hold},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"allowInboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"allowOutboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"active",{get:function(){return 0===this.hangupAt},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"displayNumber",{get:function(){return"inbound"===this.direction?this.from.number:this.to?this.to.number:this.destination},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"displayName",{get:function(){return"inbound"===this.direction?this.from.name:this.to?this.to.name:this.destination},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"autoAnswer",{get:function(){return this.queue&&"offline"===this.queue.queue_type||this.params&&!0===this.params.autoAnswer},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"attempt",{get:function(){return this.task},enumerable:!0,configurable:!0}),u.prototype.answer=function(n){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){switch(e.label){case 0:if(!this.sip||!this.client.phone)return[3,6];e.label=1;case 1:return e.trys.push([1,4,,5]),[4,this.client.phone.callOption(n)];case 2:return t=e.sent(),[4,this.sip.answer(t)];case 3:return e.sent(),[3,5];case 4:return t=e.sent(),this.client.handleError(t),[3,5];case 5:return[2,!0];case 6:return[2,!1]}})})},u.prototype.answerDelay=function(t,e){var n=this;this.autoAnswered||(this.autoAnswered=!0,setTimeout(function(){return N.__awaiter(n,void 0,void 0,function(){return N.__generator(this,function(e){switch(e.label){case 0:return[4,this.answer(t)];case 1:return e.sent(),[2]}})})},e))},u.prototype.hangup=function(n){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){return t=n,0!==this.answeredAt||n||(t=this.direction===h.CallDirection.Inbound?"USER_BUSY":"ORIGINATOR_CANCEL"),[2,this.client.request("call_hangup",{id:this.id,app_id:this.appId,cause:t})]})})},u.prototype.eavesdrop=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return t.id=this.id,[2,this.client.request("call_eavesdrop",t)]})})},u.prototype.toggleHold=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return this.state===h.CallActions.Hold?[2,this.unHold()]:[2,this.hold()]})})},u.prototype.hold=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.state===h.CallActions.Hold)throw new Error("Call is hold");return[2,this.client.request("call_hold",{id:this.id,app_id:this.appId})]})})},u.prototype.unHold=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.state!==h.CallActions.Hold)throw new Error("Call is active");return[2,this.client.request("call_unhold",{id:this.id,app_id:this.appId})]})})},u.prototype.sendDTMF=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("call_dtmf",{id:this.id,app_id:this.appId,dtmf:t})]})})},u.prototype.blindTransfer=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("call_blind_transfer",{id:this.id,app_id:this.appId,destination:t})]})})},u.prototype.mute=function(n){return void 0===n&&(n=!1),N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.request("call_mute",{id:this.id,app_id:this.appId,mute:n})];case 1:return t=e.sent(),this._muted=n,[2,t]}})})},u.prototype.bridgeTo=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("call_bridge",{from_id:this.id,from_app_id:this.appId,to_id:t.id,to_app_id:t.appId})]})})},u.prototype.reporting=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.task)return[2,this.task.reporting(t)];throw new Error("this call not in queue")})})},u.prototype.renew=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.task)return[2,this.task.renew(t)];throw new Error("this conversation not in queue")})})},u.prototype.callToUser=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return t.nodeId=this.appId,t.parentCallId=this.id||null,t.sendToCallId=this.parentId||null,[2,this.client.inviteToUser(t)]})})};var qn=u;function u(e,t){this.client=e;var n=t.data;this._muted=!1,this.voice=!0,this.createdAt=+t.timestamp,this.task=null,this.data=null,this.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)}(K=h.DeclineCause||(h.DeclineCause={})).Timeout="TIMEOUT",K.Busy="BUSY",K.Cancel="CANCEL",(K=h.ChatActions||(h.ChatActions={})).Message="message",K.UserInvite="user_invite",K.Invite="invite_conversation",K.Joined="join_conversation",K.Close="close_conversation",K.Leave="leave_conversation",K.Decline="decline_invite",K.Update="update_channel",K.Destroy="destroy",(K=h.ConversationState||(h.ConversationState={})).Init="init",K.Invite="invite",K.Active="active",K.Pending="pending",K.Closed="closed",S.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)})},S.prototype.setAnswered=function(e,t,n){this.state=h.ConversationState.Active,this.answeredAt=t,this.channelId=e,this.member=Cn(n),this.inviteId=null},S.prototype.setClosed=function(e){this.state=h.ConversationState.Closed,this.closedAt=e},S.prototype.setDecline=function(e){this.setClosed(e.timestamp),this._cause=e.cause||null},S.prototype.setLeave=function(e){this.setClosed(e.timestamp)},Object.defineProperty(S.prototype,"id",{get:function(){return this.channelId||this.inviteId||this.conversationId},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"cause",{get:function(){return this._cause},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"messages",{get:function(){return this.getMessages()},enumerable:!0,configurable:!0}),S.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})},S.prototype.next=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){throw new Error("TODO")})})},S.prototype.pagination=function(e,t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){throw new Error("TODO")})})},S.prototype.newMessage=function(e){this._messages.push(e)},Object.defineProperty(S.prototype,"allowDecline",{get:function(){return!!this.inviteId},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"allowJoin",{get:function(){return!!this.inviteId},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"allowLeave",{get:function(){return!(!this.channelId||0!==this.closedAt&&this.hasReporting)},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"allowReporting",{get:function(){return 0<this.answeredAt&&this.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(S.prototype,"hasReporting",{get:function(){return this._hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(S.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(S.prototype,"attempt",{get:function(){return this.task},enumerable:!0,configurable:!0}),S.prototype.decline=function(n){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){if(this.inviteId)return(t=n)||0!==this.answeredAt||(t=h.DeclineCause.Busy),[2,this.client.request("decline_chat",{invite_id:this.inviteId,cause:t})];throw new Error("This conversation is joined")})})},S.prototype.join=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.inviteId)return[2,this.client.request("join_chat",{invite_id:this.inviteId})];throw new Error("This conversation is joined")})})},S.prototype.close=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.channelId)return[2,this.client.request("close_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:t})];throw new Error("This conversation not active")})})},S.prototype.leave=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.channelId)return 0===this.closedAt||this.hasReporting||this.cause===h.DeclineCause.Busy?[2,this.client.request("leave_chat",{channel_id:this.channelId,conversation_id:this.conversationId,cause:t})]:[2,this.client.destroyConversation(this)];throw new Error("This conversation not active")})})},S.prototype.sendText=function(r){return N.__awaiter(this,void 0,void 0,function(){var t,n;return N.__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]}})})},S.prototype.sendFile=function(n,r){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.storeFile(this.conversationId,[n],r)];case 1:return t=e.sent(),t=t[0],[2,this.client.request("send_file_chat",{channel_id:this.channelId,conversation_id:this.conversationId,id:t.id,name:n.name,mime:t.mime,url:t.shared,size:t.size})]}})})},S.prototype.send=function(t,n){return N.__awaiter(this,void 0,void 0,function(){return N.__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")})})},S.prototype.addToChat=function(t,n){return N.__awaiter(this,void 0,void 0,function(){return N.__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})]})})},S.prototype.startChat=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("start_chat",{user_id:t})]})})},S.prototype.updateChannel=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("update_channel_chat",{channel_id:this.channelId})]})})},S.prototype.reporting=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.task)return[2,this.task.reporting(t)];throw new Error("this conversation not in queue")})})},S.prototype.renew=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){if(this.task)return[2,this.task.renew(t)];throw new Error("this conversation not in queue")})})},S.prototype.transferToPlan=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("blind_transfer_chat",{conversation_id:this.conversationId,channel_id:this.channelId,plan_id:t})]})})},S.prototype.transferToUser=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.client.request("transfer_user_chat",{conversation_id:this.conversationId,channel_id:this.channelId,user_id:t})]})})},S.prototype.sendMessageTextChunk=function(e){return this.client.request("send_text_chat",{channel_id:this.channelId,conversation_id:this.conversationId,text:e})},S.prototype.messageMember=function(e){if(this.member&&e.channel_id===this.channelId)return{self:!0};for(var t=0,n=this.members;t<n.length;t++){var r=n[t];if(r.id===e.channel_id)return r}return null};var An=S;function S(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(Cn),this._messages=i||[],this.state=h.ConversationState.Invite,this.variables={},this._hasReporting=!(!a||"true"!==a.cc_reporting),this._autoAnswer=!1,this._cause=null,this.lastAction=null,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 Cn(e){return e.messenger=e.type,e}Rn=Error,N.__extends(Kn,Rn),Kn.id="device_not_found";var Rn,Sn=Kn;function Kn(e){e=Rn.call(this,e)||this;return e.id=Kn.id,e}Pn=Error,N.__extends(On,Pn),On.id="device_not_allow";var Pn,Tn=On;function On(e){e=Pn.call(this,e)||this;return e.id=On.id,e}kn=T.EventEmitter,N.__extends(Wn,kn),Wn.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()}},Wn.prototype.send=function(e){return this.socket.send(JSON.stringify(e)),null},Wn.prototype.close=function(e){this.socket.close(e||1e3),delete this.socket},Wn.prototype.onOpen=function(){this.emit("open")},Wn.prototype.onClose=function(e){this.emit("close",e),this.off("*")},Wn.prototype.onMessage=function(e){"\0\0\0\0"!==e&&(e=JSON.parse(e),this.emit("message",e))};var kn,In=Wn;function Wn(e){var t=kn.call(this)||this;return t.host=e,t}var Xn,xn,En="call",Qn="chat",jn="user_state",Un="agent_status",K=((K=Xn=Xn||{}).NotFoundError="NotFoundError",K.NotAllowedError="NotAllowedError",(K=h.Response||(h.Response={})).STATUS_FAIL="FAIL",K.STATUS_OK="OK",xn=T.EventEmitter,N.__extends(P,xn),P.prototype.connect=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){switch(e.label){case 0:return[4,this.connectToSocket()];case 1:return e.sent(),[2]}})})},P.prototype.disconnect=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return this.socket.close(),[2]})})},P.prototype.subscribeCall=function(s,o){return N.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a;return N.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("subscribe_call",o)];case 1:if(t=e.sent(),this.eventHandler.on(En,s),t.items&&t.items.length)for(n=0,r=t.items;n<r.length;n++)(i=r[n]).hangup_at&&0<i.hangup_at&&!i.task||(a={cc_app_id:"",app_id:i.app_id,event:i.state,id:i.id,timestamp:Date.now(),data:{app_id:i.app_id,event:i.state,id:i.id,timestamp:Date.now(),cc_app_id:"",sip_id:"",parent_id:i.parent_id,direction:i.direction,destination:i.destination,queue:i.queue,from:i.from,to:i.to,payload:i.variables}},(a=new qn(this,a)).createdAt=i.created_at,a.answeredAt=i.answered_at||0,a.bridgedAt=i.bridged_at||0,a.hangupAt=i.hangup_at||0,i.task&&(a.task=new wn(this,{attempt_id:i.task.attempt_id,channel:i.task.channel,status:i.task.status,timestamp:Date.now()},i.task),a.queue.reporting="true",a.task.form=i.task.form||null,i.leaving_at&&i.task.processing_sec&&(a.task.startProcessingAt=i.leaving_at,a.task.setProcessing(i.leaving_at,{sec:i.task.processing_sec||0,timeout:i.task.processing_timeout_at||null,renewal_sec:i.task.processing_renewal_sec||0}))),this.callStore.set(a.id,a));return[2,t]}})})},P.prototype.subscribeChat=function(s,o){return N.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a;return N.__generator(this,function(e){switch(e.label){case 0:return[4,this.request("subscribe_chat",o)];case 1:if(t=e.sent(),this.eventHandler.on(Qn,s),t&&t.items)for(n=0,r=t.items;n<r.length;n++){if(i=r[n],a=i.messages.reverse(),(a=new An(this,i.id,i.title,i.members,a,i.variables)).createdAt=i.created_at,a.closedAt=i.closed_at,i.task&&(a.task=new wn(this,{attempt_id:i.task.attempt_id,channel:i.task.channel,status:i.task.status,timestamp:Date.now()},i.task),i.leaving_at&&i.task.processing_sec&&(a.task.startProcessingAt=i.leaving_at,a.task.setProcessing(i.leaving_at,{sec:i.task.processing_sec||0,timeout:i.task.processing_timeout_at||null,renewal_sec:i.task.processing_renewal_sec||0})),a.task.form=i.task.form||null),i.invite_id)a.setInvite(i.invite_id,i.created_at);else{if(!i.channel_id){this.log.error("conversation "+i.id+" not valid");continue}a.setAnswered(i.channel_id,i.joined_at,{id:i.channel_id,name:"TODO",type:"webitel"})}this.conversationStore.set(a.id,a)}return[2,t]}})})},P.prototype.subscribeUsersStatus=function(n,r){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__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(jn,n),[2,t]}})})},P.prototype.subscribeAgentsStatus=function(n,r){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__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(Un,n),[2,t]}})})},P.prototype.subscribeTask=function(e){this.eventHandler.on("task",e)},P.prototype.subscribeJob=function(e){this.eventHandler.on("job",e)},P.prototype.unSubscribe=function(t,e,n){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("un_subscribe_"+t,n)]})})},P.prototype.destroy=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){switch(e.label){case 0:return[4,this.disconnect()];case 1:return(e.sent(),this.phone)?[4,this.phone.unregister()]:[3,3];case 2:e.sent(),this.phone.off("*"),delete this.phone,e.label=3;case 3:return this.eventHandler.off("*"),[2]}})})},P.prototype.allCall=function(){return Array.from(this.callStore.values())},P.prototype.allConversations=function(){return Array.from(this.conversationStore.values())},P.prototype.allTask=function(){return this.agent?Array.from(this.agent.task.values()):[]},P.prototype.allJob=function(){return this.allTask().filter(Gn)},P.prototype.callById=function(e){if(this.callStore.has(e))return this.callStore.get(e)},P.prototype.conversationById=function(e){if(this.conversationStore.has(e))return this.conversationStore.get(e)},P.prototype.callBySipId=function(e){for(var t=0,n=this.allCall();t<n.length;t++){var r=n[t];if(r.sipId&&e.startsWith(r.sipId))return r}},P.prototype.reportingTask=function(t,n){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("cc_reporting",N.__assign({attempt_id:t},n))]})})},P.prototype.agentActiveTasks=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("cc_agent_tasks",{agent_id:t})]})})},P.prototype.auth=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("authentication_challenge",{token:this._config.token})]})})},P.prototype.ping=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("ping",{ping:1})]})})},P.prototype.sessionInfo=function(){return this.connectionInfo.session},Object.defineProperty(P.prototype,"version",{get:function(){return this.connectionInfo.server_version},enumerable:!0,configurable:!0}),Object.defineProperty(P.prototype,"buildVersion",{get:function(){return'"0.1.148"'},enumerable:!0,configurable:!0}),Object.defineProperty(P.prototype,"instanceId",{get:function(){return this.connectionInfo.sock_id},enumerable:!0,configurable:!0}),P.prototype.agentSession=function(){return N.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l,d;return N.__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 mn(this,t),[4,this.agentActiveTasks(this.agent.agentId)];case 2:for(t=e.sent(),n=0,r=t.items;n<r.length;n++)i=r[n],(a=new wn(this,{status:i.status,timestamp:Date.now(),channel:i.channel,attempt_id:i.attempt_id},i)).postProcessData={},a.setState(i.state),i.bridged_at&&(a.bridgedAt=i.bridged_at,a.answeredAt=i.bridged_at),i.leaving_at&&(a.closedAt=i.leaving_at),i.leaving_at&&i.processing_sec&&(a.startProcessingAt=i.leaving_at,a.setProcessing(i.leaving_at,{sec:i.processing_sec||0,timeout:i.processing_timeout_at||null,renewal_sec:i.processing_renewal_sec||0})),a.form=i.form||null,this.agent.task.set(a.id,a);for(s=0,o=this.allCall();s<o.length;s++)(u=o[s]).task&&this.agent.task.set(u.task.id,u.task);for(c=0,l=this.allConversations();c<l.length;c++)(d=l[c]).task&&this.agent.task.set(d.task.id,d.task);return[2,this.agent]}})})},P.prototype.invite=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("call_invite",t)]})})},P.prototype.call=function(n){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){switch(e.label){case 0:if(!this.phone)return[3,5];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.phone.call(n)];case 2:return e.sent(),[3,4];case 3:return t=e.sent(),this.handleError(t),[3,4];case 4:return[3,7];case 5:return[4,this.invite(n)];case 6:e.sent(),e.label=7;case 7:return[2]}})})},P.prototype.callRecordId=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("call_recordings",{id:t})]})})},P.prototype.eavesdrop=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("call_eavesdrop",t)]})})},P.prototype.agentSetOnline=function(t,n,r){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("cc_agent_online",{agent_id:t,channels:n,on_demand:r})]})})},P.prototype.agentSetWaiting=function(t,n){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("cc_agent_waiting",{agent_id:t,channel:n})]})})},P.prototype.agentSetPause=function(t,n){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("cc_agent_pause",{agent_id:t,payload:n})]})})},P.prototype.agentSetOffline=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("cc_agent_offline",{agent_id:t})]})})},P.prototype.inviteToUser=function(e){return this.request("call_user",e)},P.prototype.answer=function(n,r){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){return(t=this.callById(n))?[2,t.answer(r)]:[2]})})},P.prototype.request=function(n,r){var i=this;return new Promise(function(e,t){i.queueRequest.set(++i.reqSeq,{resolve:e,reject:t}),i.socket.send({seq:i.reqSeq,action:n,data:r})})},P.prototype.useWebPhone=function(){return this._config.registerWebDevice||!1},P.prototype.callDestroyed=function(e){return 0<e.hangupAt&&!this.hasAgentTask(e.task)},P.prototype.conversationDestroyed=function(e){return 0<e.closedAt&&!this.hasAgentTask(e.task)&&(e.hasReporting||!(e.lastAction===h.ChatActions.Close&&0<e.answeredAt))},P.prototype.reportingChannelTask=function(e){switch(e.channel){case bn.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 bn.Chat:if(e.agentChannelId){var i=this.conversationById(e.agentChannelId);if(i&&this.conversationDestroyed(i))return void this.destroyConversation(i)}}},P.prototype.registerCallClient=function(n){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){switch(e.label){case 0:this.phone=n,this.subscribePhone(n),e.label=1;case 1:return e.trys.push([1,4,,5]),[4,this.deviceConfig(this.phone.type)];case 2:return t=e.sent(),[4,this.phone.register(t)];case 3:return e.sent(),[3,5];case 4:return t=e.sent(),this.log.error(t),[3,5];case 5:return[2]}})})},P.prototype.subscribePhone=function(e){var n=this;e.on("peerStreams",function(e,t){e=n.callBySession(e);e&&!e.peerStreams.length&&(e.setPeerStreams(t),n.eventHandler.emit(En,h.CallActions.PeerStream,e))}),e.on("localStreams",function(e,t){e=n.callBySession(e);e&&!e.localStreams.length&&(e.setLocalStreams(t),n.eventHandler.emit(En,h.CallActions.LocalStream,e))}),e.on("newSession",this.onNewCallSession.bind(this)),e.on("registered",function(){return n.emit("phone_registered",!0)}),e.on("unregistered",function(){return n.emit("phone_registered",!1)})},P.prototype.deviceConfig=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,this.request("user_default_device",{name:t})]})})},P.prototype.storeFile=function(l,d,_){return N.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return N.__generator(this,function(e){switch(e.label){case 0:if(!d||d.length<1)throw new Error("no files");for(t=new FormData,n=0,r=d;n<r.length;n++)i=r[n],t.append(i.name,i);return[4,B.post(this.basePath+"/api/storage/file/"+l+"/upload",t,{headers:((c={})["X-Webitel-Access"]=this._config.token,c),onUploadProgress:_})];case 1:for(c=e.sent(),a=c.data,s=0,o=a;s<o.length;s++)(u=o[s]).shared=this.basePath+u.shared;return[2,a]}})})},P.prototype.fileUrlDownload=function(e){return this.basePath+"/api/storage/file/"+e+"/download?access_token="+this._config.token},P.prototype.fileUrlStream=function(e){return this.basePath+"/api/storage/file/"+e+"/stream?access_token="+this._config.token},P.prototype.handleError=function(e){if(e)switch(e.name){case Xn.NotFoundError:this.emit("error",new Sn(e.message));break;case Xn.NotAllowedError:this.emit("error",new Tn(e.message));break;default:this.emit("error",e)}},P.prototype.destroyConversation=function(e){this.conversationStore.delete(e.id),this.eventHandler.emit(Qn,h.ChatActions.Destroy,e)},P.prototype.onMessage=function(n){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__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===h.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 En:return[3,4];case Qn:return[3,6];case jn:return[3,8];case"sip":return[3,9];case Un: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]}})})},P.prototype.handleAgentStatus=function(e){this.agent&&e.agent_id===this.agent.agentId&&this.agent.setStatus(e),this.eventHandler.emit(Un,e,this.agent)},P.prototype.handleChannelEvents=function(e){var t;this.agent&&(e.timestamp=Date.now(),t=this.agent.onChannelEvent(e)||void 0,this.eventHandler.emit("task",e.status,t),t&&Gn(t)&&(this.eventHandler.emit("job",t.state,t),e=t.state,-1<[h.ChannelState.Missed.toString(),h.ChannelState.Waiting,h.ChannelState.WrapTime,h.JobState.Closed].indexOf(e)&&this.eventHandler.emit("job",h.JobState.Destroy,t)))},P.prototype.pingServer=function(){return N.__awaiter(this,void 0,void 0,function(){var t,n=this;return N.__generator(this,function(e){switch(e.label){case 0:return this.pingTimer&&this.connectionInfo.ping_interval?(t=setTimeout(function(){return N.__awaiter(n,void 0,void 0,function(){return N.__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]}})})},P.prototype.connected=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__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 yn(this.instanceId,this._config.debug))]:[2]}})})},P.prototype.callBySession=function(e){for(var t=0,n=this.allCall();t<n.length;t++){var r=n[t];if(r.sip===e)return r}},P.prototype.onNewCallSession=function(n){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){return(t=n.callId?this.callById(n.callId):this.callBySipId(n.id))&&(t.setSip(n),this.checkAutoAnswer(t)),[2]})})},P.prototype.checkAutoAnswer=function(e){e.autoAnswer&&e.answerDelay({video:e.params.video,screen:e.params.screen,disableStun:e.params.disableStun},300)},P.prototype.connectToSocket=function(){var n=this;return new Promise(function(e,t){try{n.socket=new In(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")})})},P.prototype.handleUserStateEvent=function(e){this.eventHandler.emit(jn,e)},P.prototype.handleCallEvents=function(n){return N.__awaiter(this,void 0,void 0,function(){var t;return N.__generator(this,function(e){switch(n.timestamp=Date.now(),n.event){case h.CallActions.Ringing:t=new qn(this,n),this.callStore.set(t.id,t),this.checkAutoAnswer(t);break;case h.CallActions.Active:(t=this.callById(n.id))&&t.setActive(n);break;case h.CallActions.Bridge:(t=this.callById(n.id))&&t.setBridged(n);break;case h.CallActions.Execute:(t=this.callById(n.id))&&t.setExecute(n.data);break;case h.CallActions.DTMF:(t=this.callById(n.id))&&t.addDigit(n.data);break;case h.CallActions.Voice:(t=this.callById(n.id))&&t.setVoice();break;case h.CallActions.Silence:(t=this.callById(n.id))&&t.setSilence();break;case h.CallActions.Hold:(t=this.callById(n.id))&&t.setHold(n);break;case h.CallActions.Hangup:(t=this.callById(n.id))&&t.setHangup(n);break;default:throw new Error("Unhandled action")}return t&&(this.eventHandler.emit(En,n.event,t),this.callDestroyed(t)&&this.destroyCall(t)),[2]})})},P.prototype.handleChatEvents=function(_){return N.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l,d;return N.__generator(this,function(e){switch(n=Date.now(),_.action){case h.ChatActions.UserInvite:r=_.data,(t=new An(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 h.ChatActions.Joined:r=_.data,(t=this.conversationById(r.member.id))&&t.setAnswered(r.member.id,n,r.member);break;case h.ChatActions.Message:for((i=_.data).timestamp=n,a=0,s=this.allConversations();a<s.length;a++)!(l=s[a]).closedAt&&-1<l.membersId.indexOf(i.channel_id)&&(t=l);t&&t.newMessage(i);break;case h.ChatActions.Close:for(o=_.data,u=0,c=this.allConversations();u<c.length;u++)!(l=c[u]).closedAt&&-1<l.membersId.indexOf(o.from_channel_id)&&(t=l);t&&t.setClosed(n);break;case h.ChatActions.Leave:d=_.data,(t=this.conversationById(d.leaved_channel_id))&&t.setLeave(d);break;case h.ChatActions.Decline:d=_.data,(t=this.conversationById(d.invite_id))&&t.setDecline(d)}return t&&(t.lastAction=_.action,this.eventHandler.emit(Qn,_.action,t),this.conversationDestroyed(t)&&this.destroyConversation(t)),[2]})})},P.prototype.hasAgentTask=function(e){return!(!this.agent||!e)&&this.agent.hasTask(e)},P.prototype.destroyCall=function(e){this.callStore.delete(e.id),this.eventHandler.emit(En,h.CallActions.Destroy,e)},P);function P(e){var t=xn.call(this)||this;return t._config=e,t.reqSeq=0,t.queueRequest=new Map,t.log=new hn,t.eventHandler=new T.EventEmitter,t.callStore=new Map,t.conversationStore=new Map,t.pingTimer=null,t.basePath=""+(e=(e=(e=(e=e.storageEndpoint||e.endpoint).replace(/^ws/,"http")).endsWith("/")?e.slice(0,-1):e).endsWith("/ws")?e.slice(0,-3):e),t}function Gn(e){return e.channel===bn.Task}Bn=T.EventEmitter,N.__extends(Hn,Bn);var Bn,Mn=Hn;function Hn(){return null!==Bn&&Bn.apply(this,arguments)||this}var Ln="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(function(c){var e=Ln&&Ln.__generator||function(r,i){var a,s,o,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(n){return function(e){var t=[n,e];if(a)throw new TypeError("Generator is already executing.");for(;u;)try{if(a=1,s&&(o=2&t[0]?s.return:t[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,t[1])).done)return o;switch(s=0,(t=o?[2&t[0],o.value]:t)[0]){case 0:case 1:o=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,s=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(o=0<(o=u.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3])){u.label=t[1];break}if(6===t[0]&&u.label<o[1]){u.label=o[1],o=t;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(t);break}o[2]&&u.ops.pop(),u.trys.pop();continue}t=i.call(r,u)}catch(e){t=[6,e],s=0}finally{a=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},t=(Object.defineProperty(c,"__esModule",{value:!0}),c.$listeners=Symbol("EventEmitter.listeners"),c.$addListener=Symbol("EventEmitter.addListener"),n.count=function(e,t){var n=0,e=e[c.$listeners][t];if(e)for(var r=e.first;++n&&r.next;)r=r.next;return n},n.has=function(e,t){if("*"!=t)return void 0!==e[c.$listeners][t];for(t in e[c.$listeners])return!0;return!1},n.keys=function(e){return Object.keys(e[c.$listeners])},n.unhandle=function(n,r,i,e){return n.on(r,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!n[c.$listeners][r].first.next)return i.apply(void 0,e)},e)},n.prototype.on=function(e,t,n){return"function"==typeof t?this[c.$addListener](e,t,n):this[c.$addListener](e,void 0,t)},n.prototype.one=function(e,t,n){return"function"==typeof t?this[c.$addListener](e,t,n,!0):this[c.$addListener](e,void 0,t,!0)},n.prototype.off=function(e,t){if("*"==e){var n=this[c.$listeners];if(this[c.$listeners]={},this._onEventUnhandled)for(var r in n)this._onEventUnhandled(r)}else{if("function"==typeof t){n=this[c.$listeners][e];if(n&&function(e,t){var n=null,r=e.first;for(;;)if(t(r))if(n){if(n.next=r.next,!r.next)break;r=r.next}else{if(!r.next)return;e.first=r=r.next}else{if(!(n=r).next)break;r=r.next}return e.last=n,e}(n,function(e){return e.fn==t}))return this}delete this[c.$listeners][e],this._onEventUnhandled&&this._onEventUnhandled(e)}return this},n.prototype.emit=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];for(var i=this.listeners(e);;){var a=i.next(),s=a.value;if(a.done)return t;a=s.apply(void 0,n);void 0!==a&&(t=a)}},n.prototype.listeners=function(t){var n,r,i;return e(this,function(e){switch(e.label){case 0:if(!(n=this[c.$listeners][t]))return[2];r=null,i=n.first,e.label=1;case 1:return[4,i.fn];case 2:if(e.sent(),i.once){if(!r)return i.next?(n.first=i=i.next,[3,1]):(delete this[c.$listeners][t],this._onEventUnhandled&&this._onEventUnhandled(t),[2]);r.next=i.next}else r=i;return i.next?(i=i.next,[3,1]):(n.last=i,[2]);case 3:return[2]}})},n.prototype[c.$addListener]=function(n,e,r,i){var t,a,s=this;if(void 0===i&&(i=!1),"object"!=typeof n)return"function"==typeof e&&(a=l(this[c.$listeners],t=n,{fn:e,once:i,next:null}),r&&r.push({dispose:function(){return s.off(t,e)}}),e==a.first.fn&&this._onEventHandled&&this._onEventHandled(n)),e;var o,u=this;for(o in n)!function(){var e,t;"function"==typeof n[o]&&(e=n[o],t=l(u[c.$listeners],o,{fn:e,once:i,next:null}),r&&r.push({dispose:function(){return s.off(o,e)}}),e==t.first.fn&&u._onEventHandled&&u._onEventHandled(o))}();return this},n.ev=c.$listeners,n);function n(){this[c.$listeners]={}}function l(e,t,n){var r=e[t];return r?(r.last.next=n,r.last=n):e[t]=r={first:n,last:n},r}c.EventEmitter=t})((Dn={exports:{}},Dn.exports));var Dn=Dn.exports,Fn=((Fn=Dn)&&Fn.__esModule&&Object.prototype.hasOwnProperty.call(Fn,"default")&&Fn.default,Dn.$listeners,Dn.$addListener,Dn.EventEmitter),Nn=(Object.defineProperty(Jn.prototype,"id",{get:function(){return this.callId},enumerable:!0,configurable:!0}),Jn.prototype.getLocalMedia=function(){return[]},Jn.prototype.getPeerMedia=function(){return[]},Jn.prototype.answer=function(e){var t=this;return new Promise(function(e){t.client.answer(t.id),e()})},Jn);function Jn(e,t){this.client=e,this.callId=t,this.incoming=!1,this.instanceId="fixme"}zn=Fn,N.__extends(Vn,zn),Vn.prototype.callOption=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2,t]})})},Vn.prototype.register=function(e){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2]})})},Vn.prototype.unregister=function(){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return[2]})})},Vn.prototype.call=function(t){return N.__awaiter(this,void 0,void 0,function(){return N.__generator(this,function(e){return t.destination&&this.exec(t.destination),[2]})})},Vn.prototype.answer=function(e){this.exec(e,"answer")},Vn.prototype.sipSessionByCallId=function(e){return new Nn(this,e)},Vn.prototype.sipSessionBySipId=function(e){return null},Vn.prototype.open=function(e){this.exec(encodeURIComponent(JSON.stringify(N.__assign({token:e},this.config))),"open")},Vn.prototype.exec=function(e,t){e=""+this.schema+e,t&&(e+=" "+t),t=document.createElement("a");t.download="File name",t.href=e,t.click()};var zn,Dn=Vn;function Vn(e){var t=zn.call(this)||this;return t.config=e,t.type="external",t.schema="wtel://",t}h.AgentPauseCauseServiceApiAxiosParamCreator=X,h.AgentPauseCauseServiceApiFp=l,h.AgentPauseCauseServiceApiFactory=function(o,u,c){return{createAgentPauseCause:function(e,t){return l(o).createAgentPauseCause(e,t).then(function(e){return e(c,u)})},deleteAgentPauseCause:function(e,t){return l(o).deleteAgentPauseCause(e,t).then(function(e){return e(c,u)})},patchAgentPauseCause:function(e,t,n){return l(o).patchAgentPauseCause(e,t,n).then(function(e){return e(c,u)})},readAgentPauseCause:function(e,t){return l(o).readAgentPauseCause(e,t).then(function(e){return e(c,u)})},searchAgentPauseCause:function(e,t,n,r,i,a,s){return l(o).searchAgentPauseCause(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateAgentPauseCause:function(e,t,n){return l(o).updateAgentPauseCause(e,t,n).then(function(e){return e(c,u)})}}},h.AgentPauseCauseServiceApi=E,h.AgentServiceApiAxiosParamCreator=q,h.AgentServiceApiFp=A,h.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)})}}},h.AgentServiceApi=U,h.AgentSkillServiceApiAxiosParamCreator=G,h.AgentSkillServiceApiFp=d,h.AgentSkillServiceApiFactory=function(u,c,l){return{createAgentSkill:function(e,t,n){return d(u).createAgentSkill(e,t,n).then(function(e){return e(l,c)})},deleteAgentSkill:function(e,t,n,r){return d(u).deleteAgentSkill(e,t,n,r).then(function(e){return e(l,c)})},patchAgentSkill:function(e,t,n,r){return d(u).patchAgentSkill(e,t,n,r).then(function(e){return e(l,c)})},readAgentSkill:function(e,t,n,r){return d(u).readAgentSkill(e,t,n,r).then(function(e){return e(l,c)})},searchAgentSkill:function(e,t,n,r,i,a,s,o){return d(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 d(u).searchLookupAgentNotExistsSkill(e,t,n,r,i,a).then(function(e){return e(l,c)})},updateAgentSkill:function(e,t,n,r){return d(u).updateAgentSkill(e,t,n,r).then(function(e){return e(l,c)})}}},h.AgentSkillServiceApi=F,h.AgentTeamServiceApiAxiosParamCreator=V,h.AgentTeamServiceApiFp=$,h.AgentTeamServiceApiFactory=function(c,l,d){return{createAgentTeam:function(e,t){return $(c).createAgentTeam(e,t).then(function(e){return e(d,l)})},deleteAgentTeam:function(e,t,n){return $(c).deleteAgentTeam(e,t,n).then(function(e){return e(d,l)})},readAgentTeam:function(e,t,n){return $(c).readAgentTeam(e,t,n).then(function(e){return e(d,l)})},searchAgentTeam:function(e,t,n,r,i,a,s,o,u){return $(c).searchAgentTeam(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateAgentTeam:function(e,t,n){return $(c).updateAgentTeam(e,t,n).then(function(e){return e(d,l)})}}},h.AgentTeamServiceApi=Z,h.BackendProfileServiceApiAxiosParamCreator=te,h.BackendProfileServiceApiFp=_,h.BackendProfileServiceApiFactory=function(o,u,c){return{createBackendProfile:function(e,t){return _(o).createBackendProfile(e,t).then(function(e){return e(c,u)})},deleteBackendProfile:function(e,t,n){return _(o).deleteBackendProfile(e,t,n).then(function(e){return e(c,u)})},patchBackendProfile:function(e,t,n){return _(o).patchBackendProfile(e,t,n).then(function(e){return e(c,u)})},readBackendProfile:function(e,t,n){return _(o).readBackendProfile(e,t,n).then(function(e){return e(c,u)})},searchBackendProfile:function(e,t,n,r,i,a,s){return _(o).searchBackendProfile(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateBackendProfile:function(e,t,n){return _(o).updateBackendProfile(e,t,n).then(function(e){return e(c,u)})}}},h.BackendProfileServiceApi=re,h.BucketServiceApiAxiosParamCreator=ae,h.BucketServiceApiFp=se,h.BucketServiceApiFactory=function(o,u,c){return{createBucket:function(e,t){return se(o).createBucket(e,t).then(function(e){return e(c,u)})},deleteBucket:function(e,t,n){return se(o).deleteBucket(e,t,n).then(function(e){return e(c,u)})},readBucket:function(e,t,n){return se(o).readBucket(e,t,n).then(function(e){return e(c,u)})},searchBucket:function(e,t,n,r,i,a,s){return se(o).searchBucket(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateBucket:function(e,t,n){return se(o).updateBucket(e,t,n).then(function(e){return e(c,u)})}}},h.BucketServiceApi=ue,h.CalendarServiceApiAxiosParamCreator=le,h.CalendarServiceApiFp=p,h.CalendarServiceApiFactory=function(o,u,c){return{createCalendar:function(e,t){return p(o).createCalendar(e,t).then(function(e){return e(c,u)})},deleteCalendar:function(e,t,n){return p(o).deleteCalendar(e,t,n).then(function(e){return e(c,u)})},readCalendar:function(e,t,n){return p(o).readCalendar(e,t,n).then(function(e){return e(c,u)})},searchCalendar:function(e,t,n,r,i,a,s){return p(o).searchCalendar(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},searchTimezones:function(e,t,n,r){return p(o).searchTimezones(e,t,n,r).then(function(e){return e(c,u)})},updateCalendar:function(e,t,n){return p(o).updateCalendar(e,t,n).then(function(e){return e(c,u)})}}},h.CalendarServiceApi=_e,h.CallServiceApiAxiosParamCreator=H,h.CallServiceApiFp=L,h.CallServiceApiFactory=function(j,U,G){return{aggregateHistoryCall:function(e,t){return L(j).aggregateHistoryCall(e,t).then(function(e){return e(G,U)})},blindTransferCall:function(e,t,n){return L(j).blindTransferCall(e,t,n).then(function(e){return e(G,U)})},confirmPush:function(e,t){return L(j).confirmPush(e,t).then(function(e){return e(G,U)})},createCall:function(e,t){return L(j).createCall(e,t).then(function(e){return e(G,U)})},createCallAnnotation:function(e,t,n){return L(j).createCallAnnotation(e,t,n).then(function(e){return e(G,U)})},deleteCallAnnotation:function(e,t,n){return L(j).deleteCallAnnotation(e,t,n).then(function(e){return e(G,U)})},dtmfCall:function(e,t,n){return L(j).dtmfCall(e,t,n).then(function(e){return e(G,U)})},eavesdropCall:function(e,t,n){return L(j).eavesdropCall(e,t,n).then(function(e){return e(G,U)})},hangupCall:function(e,t,n){return L(j).hangupCall(e,t,n).then(function(e){return e(G,U)})},holdCall:function(e,t,n){return L(j).holdCall(e,t,n).then(function(e){return e(G,U)})},readCall:function(e,t,n){return L(j).readCall(e,t,n).then(function(e){return e(G,U)})},searchActiveCall:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T){return L(j).searchActiveCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T).then(function(e){return e(G,U)})},searchHistoryCall:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,k,I,W,X,x,E,Q){return L(j).searchHistoryCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,f,g,v,y,b,w,m,q,A,C,R,S,K,P,T,O,k,I,W,X,x,E,Q).then(function(e){return e(G,U)})},unHoldCall:function(e,t,n){return L(j).unHoldCall(e,t,n).then(function(e){return e(G,U)})},updateCallAnnotation:function(e,t,n,r){return L(j).updateCallAnnotation(e,t,n,r).then(function(e){return e(G,U)})}}},h.CallServiceApi=fe,h.CognitiveProfileServiceApiAxiosParamCreator=ge,h.CognitiveProfileServiceApiFp=f,h.CognitiveProfileServiceApiFactory=function(c,l,d){return{createCognitiveProfile:function(e,t){return f(c).createCognitiveProfile(e,t).then(function(e){return e(d,l)})},deleteCognitiveProfile:function(e,t){return f(c).deleteCognitiveProfile(e,t).then(function(e){return e(d,l)})},patchCognitiveProfile:function(e,t,n){return f(c).patchCognitiveProfile(e,t,n).then(function(e){return e(d,l)})},readCognitiveProfile:function(e,t){return f(c).readCognitiveProfile(e,t).then(function(e){return e(d,l)})},searchCognitiveProfile:function(e,t,n,r,i,a,s,o,u){return f(c).searchCognitiveProfile(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateCognitiveProfile:function(e,t,n){return f(c).updateCognitiveProfile(e,t,n).then(function(e){return e(d,l)})}}},h.CognitiveProfileServiceApi=ye,h.CommunicationTypeServiceApiAxiosParamCreator=we,h.CommunicationTypeServiceApiFp=me,h.CommunicationTypeServiceApiFactory=function(o,u,c){return{createCommunicationType:function(e,t){return me(o).createCommunicationType(e,t).then(function(e){return e(c,u)})},deleteCommunicationType:function(e,t,n){return me(o).deleteCommunicationType(e,t,n).then(function(e){return e(c,u)})},readCommunicationType:function(e,t,n){return me(o).readCommunicationType(e,t,n).then(function(e){return e(c,u)})},searchCommunicationType:function(e,t,n,r,i,a,s){return me(o).searchCommunicationType(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateCommunicationType:function(e,t,n){return me(o).updateCommunicationType(e,t,n).then(function(e){return e(c,u)})}}},h.CommunicationTypeServiceApi=Ae,h.EmailProfileServiceApiAxiosParamCreator=Re,h.EmailProfileServiceApiFp=c,h.EmailProfileServiceApiFactory=function(s,o,u){return{createEmailProfile:function(e,t){return c(s).createEmailProfile(e,t).then(function(e){return e(u,o)})},deleteEmailProfile:function(e,t){return c(s).deleteEmailProfile(e,t).then(function(e){return e(u,o)})},patchEmailProfile:function(e,t,n){return c(s).patchEmailProfile(e,t,n).then(function(e){return e(u,o)})},readEmailProfile:function(e,t){return c(s).readEmailProfile(e,t).then(function(e){return e(u,o)})},searchEmailProfile:function(e,t,n,r,i,a){return c(s).searchEmailProfile(e,t,n,r,i,a).then(function(e){return e(u,o)})},updateEmailProfile:function(e,t,n){return c(s).updateEmailProfile(e,t,n).then(function(e){return e(u,o)})}}},h.EmailProfileServiceApi=Ke,h.FileServiceApiAxiosParamCreator=Te,h.FileServiceApiFp=Oe,h.FileServiceApiFactory=function(n,r,i){return{deleteFiles:function(e,t){return Oe(n).deleteFiles(e,t).then(function(e){return e(i,r)})}}},h.FileServiceApi=Ie,h.FileTranscriptServiceApiAxiosParamCreator=Xe,h.FileTranscriptServiceApiFp=xe,h.FileTranscriptServiceApiFactory=function(i,a,s){return{createFileTranscript:function(e,t){return xe(i).createFileTranscript(e,t).then(function(e){return e(s,a)})},deleteFileTranscript:function(e,t){return xe(i).deleteFileTranscript(e,t).then(function(e){return e(s,a)})},getFileTranscriptPhrases:function(e,t,n,r){return xe(i).getFileTranscriptPhrases(e,t,n,r).then(function(e){return e(s,a)})}}},h.FileTranscriptServiceApi=Qe,h.ImportTemplateServiceApiAxiosParamCreator=Ue,h.ImportTemplateServiceApiFp=g,h.ImportTemplateServiceApiFactory=function(o,u,c){return{createImportTemplate:function(e,t){return g(o).createImportTemplate(e,t).then(function(e){return e(c,u)})},deleteImportTemplate:function(e,t){return g(o).deleteImportTemplate(e,t).then(function(e){return e(c,u)})},patchImportTemplate:function(e,t,n){return g(o).patchImportTemplate(e,t,n).then(function(e){return e(c,u)})},readImportTemplate:function(e,t){return g(o).readImportTemplate(e,t).then(function(e){return e(c,u)})},searchImportTemplate:function(e,t,n,r,i,a,s){return g(o).searchImportTemplate(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateImportTemplate:function(e,t,n){return g(o).updateImportTemplate(e,t,n).then(function(e){return e(c,u)})}}},h.ImportTemplateServiceApi=Be,h.ListServiceApiAxiosParamCreator=He,h.ListServiceApiFp=v,h.ListServiceApiFactory=function(u,c,l){return{createList:function(e,t){return v(u).createList(e,t).then(function(e){return e(l,c)})},createListCommunication:function(e,t,n){return v(u).createListCommunication(e,t,n).then(function(e){return e(l,c)})},deleteList:function(e,t,n){return v(u).deleteList(e,t,n).then(function(e){return e(l,c)})},deleteListCommunication:function(e,t,n,r){return v(u).deleteListCommunication(e,t,n,r).then(function(e){return e(l,c)})},readList:function(e,t,n){return v(u).readList(e,t,n).then(function(e){return e(l,c)})},readListCommunication:function(e,t,n,r){return v(u).readListCommunication(e,t,n,r).then(function(e){return e(l,c)})},searchList:function(e,t,n,r,i,a,s){return v(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 v(u).searchListCommunication(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateList:function(e,t,n){return v(u).updateList(e,t,n).then(function(e){return e(l,c)})},updateListCommunication:function(e,t,n,r){return v(u).updateListCommunication(e,t,n,r).then(function(e){return e(l,c)})}}},h.ListServiceApi=De,h.MediaFileServiceApiAxiosParamCreator=Ne,h.MediaFileServiceApiFp=Je,h.MediaFileServiceApiFactory=function(o,u,c){return{deleteMediaFile:function(e,t,n){return Je(o).deleteMediaFile(e,t,n).then(function(e){return e(c,u)})},readMediaFile:function(e,t,n){return Je(o).readMediaFile(e,t,n).then(function(e){return e(c,u)})},searchMediaFile:function(e,t,n,r,i,a,s){return Je(o).searchMediaFile(e,t,n,r,i,a,s).then(function(e){return e(c,u)})}}},h.MediaFileServiceApi=Ve,h.MemberServiceApiAxiosParamCreator=C,h.MemberServiceApiFp=R,h.MemberServiceApiFactory=function(m,q,A){return{attemptCallback:function(e,t,n){return R(m).attemptCallback(e,t,n).then(function(e){return e(A,q)})},attemptResult:function(e,t,n,r,i){return R(m).attemptResult(e,t,n,r,i).then(function(e){return e(A,q)})},attemptsRenewalResult:function(e,t,n){return R(m).attemptsRenewalResult(e,t,n).then(function(e){return e(A,q)})},createAttempt:function(e,t,n,r){return R(m).createAttempt(e,t,n,r).then(function(e){return e(A,q)})},createMember:function(e,t,n){return R(m).createMember(e,t,n).then(function(e){return e(A,q)})},createMemberBulk:function(e,t,n){return R(m).createMemberBulk(e,t,n).then(function(e){return e(A,q)})},deleteMember:function(e,t,n,r){return R(m).deleteMember(e,t,n,r).then(function(e){return e(A,q)})},deleteMembers:function(e,t,n){return R(m).deleteMembers(e,t,n).then(function(e){return e(A,q)})},patchMember:function(e,t,n,r){return R(m).patchMember(e,t,n,r).then(function(e){return e(A,q)})},readMember:function(e,t,n,r){return R(m).readMember(e,t,n,r).then(function(e){return e(A,q)})},resetMembers:function(e,t,n){return R(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 R(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 R(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 R(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 R(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 R(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 R(m).updateMember(e,t,n,r).then(function(e){return e(A,q)})}}},h.MemberServiceApi=Ze,h.OutboundResourceGroupServiceApiAxiosParamCreator=et,h.OutboundResourceGroupServiceApiFp=y,h.OutboundResourceGroupServiceApiFactory=function(u,c,l){return{createOutboundResourceGroup:function(e,t){return y(u).createOutboundResourceGroup(e,t).then(function(e){return e(l,c)})},createOutboundResourceInGroup:function(e,t,n){return y(u).createOutboundResourceInGroup(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceGroup:function(e,t,n){return y(u).deleteOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceInGroup:function(e,t,n,r){return y(u).deleteOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})},readOutboundResourceGroup:function(e,t,n){return y(u).readOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},readOutboundResourceInGroup:function(e,t,n,r){return y(u).readOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})},searchOutboundResourceGroup:function(e,t,n,r,i,a,s){return y(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 y(u).searchOutboundResourceInGroup(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateOutboundResourceGroup:function(e,t,n){return y(u).updateOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},updateOutboundResourceInGroup:function(e,t,n,r){return y(u).updateOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})}}},h.OutboundResourceGroupServiceApi=nt,h.OutboundResourceServiceApiAxiosParamCreator=it,h.OutboundResourceServiceApiFp=b,h.OutboundResourceServiceApiFactory=function(u,c,l){return{createOutboundResource:function(e,t){return b(u).createOutboundResource(e,t).then(function(e){return e(l,c)})},createOutboundResourceDisplay:function(e,t,n){return b(u).createOutboundResourceDisplay(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResource:function(e,t,n){return b(u).deleteOutboundResource(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceDisplay:function(e,t,n,r){return b(u).deleteOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})},patchOutboundResource:function(e,t,n){return b(u).patchOutboundResource(e,t,n).then(function(e){return e(l,c)})},readOutboundResource:function(e,t,n){return b(u).readOutboundResource(e,t,n).then(function(e){return e(l,c)})},readOutboundResourceDisplay:function(e,t,n,r){return b(u).readOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})},searchOutboundResource:function(e,t,n,r,i,a,s){return b(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 b(u).searchOutboundResourceDisplay(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateOutboundResource:function(e,t,n){return b(u).updateOutboundResource(e,t,n).then(function(e){return e(l,c)})},updateOutboundResourceDisplay:function(e,t,n,r){return b(u).updateOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})}}},h.OutboundResourceServiceApi=st,h.QueueBucketServiceApiAxiosParamCreator=ot,h.QueueBucketServiceApiFp=ut,h.QueueBucketServiceApiFactory=function(u,c,l){return{createQueueBucket:function(e,t,n){return ut(u).createQueueBucket(e,t,n).then(function(e){return e(l,c)})},deleteQueueBucket:function(e,t,n){return ut(u).deleteQueueBucket(e,t,n).then(function(e){return e(l,c)})},patchQueueBucket:function(e,t,n,r){return ut(u).patchQueueBucket(e,t,n,r).then(function(e){return e(l,c)})},readQueueBucket:function(e,t,n){return ut(u).readQueueBucket(e,t,n).then(function(e){return e(l,c)})},searchQueueBucket:function(e,t,n,r,i,a,s,o){return ut(u).searchQueueBucket(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateQueueBucket:function(e,t,n,r){return ut(u).updateQueueBucket(e,t,n,r).then(function(e){return e(l,c)})}}},h.QueueBucketServiceApi=lt,h.QueueHookServiceApiAxiosParamCreator=_t,h.QueueHookServiceApiFp=ht,h.QueueHookServiceApiFactory=function(l,d,_){return{createQueueHook:function(e,t,n){return ht(l).createQueueHook(e,t,n).then(function(e){return e(_,d)})},deleteQueueHook:function(e,t,n){return ht(l).deleteQueueHook(e,t,n).then(function(e){return e(_,d)})},patchQueueHook:function(e,t,n,r){return ht(l).patchQueueHook(e,t,n,r).then(function(e){return e(_,d)})},readQueueHook:function(e,t,n){return ht(l).readQueueHook(e,t,n).then(function(e){return e(_,d)})},searchQueueHook:function(e,t,n,r,i,a,s,o,u,c){return ht(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 ht(l).updateQueueHook(e,t,n,r).then(function(e){return e(_,d)})}}},h.QueueHookServiceApi=ft,h.QueueResourcesServiceApiAxiosParamCreator=vt,h.QueueResourcesServiceApiFp=yt,h.QueueResourcesServiceApiFactory=function(u,c,l){return{createQueueResourceGroup:function(e,t,n){return yt(u).createQueueResourceGroup(e,t,n).then(function(e){return e(l,c)})},deleteQueueResourceGroup:function(e,t,n,r){return yt(u).deleteQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})},readQueueResourceGroup:function(e,t,n,r){return yt(u).readQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})},searchQueueResourceGroup:function(e,t,n,r,i,a,s,o){return yt(u).searchQueueResourceGroup(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateQueueResourceGroup:function(e,t,n,r){return yt(u).updateQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})}}},h.QueueResourcesServiceApi=wt,h.QueueServiceApiAxiosParamCreator=qt,h.QueueServiceApiFp=w,h.QueueServiceApiFactory=function(_,h,p){return{createQueue:function(e,t){return w(_).createQueue(e,t).then(function(e){return e(p,h)})},deleteQueue:function(e,t,n){return w(_).deleteQueue(e,t,n).then(function(e){return e(p,h)})},patchQueue:function(e,t,n){return w(_).patchQueue(e,t,n).then(function(e){return e(p,h)})},readQueue:function(e,t,n){return w(_).readQueue(e,t,n).then(function(e){return e(p,h)})},searchQueue:function(e,t,n,r,i,a,s,o){return w(_).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 w(_).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 w(_).updateQueue(e,t,n).then(function(e){return e(p,h)})}}},h.QueueServiceApi=Ct,h.QueueSkillServiceApiAxiosParamCreator=St,h.QueueSkillServiceApiFp=Kt,h.QueueSkillServiceApiFactory=function(p,f,g){return{createQueueSkill:function(e,t,n){return Kt(p).createQueueSkill(e,t,n).then(function(e){return e(g,f)})},deleteQueueSkill:function(e,t,n){return Kt(p).deleteQueueSkill(e,t,n).then(function(e){return e(g,f)})},patchQueueSkill:function(e,t,n,r){return Kt(p).patchQueueSkill(e,t,n,r).then(function(e){return e(g,f)})},readQueueSkill:function(e,t,n){return Kt(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 Kt(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 Kt(p).updateQueueSkill(e,t,n,r).then(function(e){return e(g,f)})}}},h.QueueSkillServiceApi=Tt,h.RegionServiceApiAxiosParamCreator=kt,h.RegionServiceApiFp=It,h.RegionServiceApiFactory=function(l,d,_){return{createRegion:function(e,t){return It(l).createRegion(e,t).then(function(e){return e(_,d)})},deleteRegion:function(e,t){return It(l).deleteRegion(e,t).then(function(e){return e(_,d)})},patchRegion:function(e,t,n){return It(l).patchRegion(e,t,n).then(function(e){return e(_,d)})},readRegion:function(e,t){return It(l).readRegion(e,t).then(function(e){return e(_,d)})},searchRegion:function(e,t,n,r,i,a,s,o,u,c){return It(l).searchRegion(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},updateRegion:function(e,t,n){return It(l).updateRegion(e,t,n).then(function(e){return e(_,d)})}}},h.RegionServiceApi=Xt,h.RoutingChatPlanServiceApiAxiosParamCreator=Et,h.RoutingChatPlanServiceApiFp=Qt,h.RoutingChatPlanServiceApiFactory=function(c,l,d){return{createChatPlan:function(e,t){return Qt(c).createChatPlan(e,t).then(function(e){return e(d,l)})},deleteChatPlan:function(e,t){return Qt(c).deleteChatPlan(e,t).then(function(e){return e(d,l)})},patchChatPlan:function(e,t,n){return Qt(c).patchChatPlan(e,t,n).then(function(e){return e(d,l)})},readChatPlan:function(e,t){return Qt(c).readChatPlan(e,t).then(function(e){return e(d,l)})},searchChatPlan:function(e,t,n,r,i,a,s,o,u){return Qt(c).searchChatPlan(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateChatPlan:function(e,t,n){return Qt(c).updateChatPlan(e,t,n).then(function(e){return e(d,l)})}}},h.RoutingChatPlanServiceApi=Ut,h.RoutingOutboundCallServiceApiAxiosParamCreator=Bt,h.RoutingOutboundCallServiceApiFp=m,h.RoutingOutboundCallServiceApiFactory=function(d,_,h){return{createRoutingOutboundCall:function(e,t){return m(d).createRoutingOutboundCall(e,t).then(function(e){return e(h,_)})},deleteRoutingOutboundCall:function(e,t,n){return m(d).deleteRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},movePositionRoutingOutboundCall:function(e,t,n,r){return m(d).movePositionRoutingOutboundCall(e,t,n,r).then(function(e){return e(h,_)})},patchRoutingOutboundCall:function(e,t,n){return m(d).patchRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},readRoutingOutboundCall:function(e,t,n){return m(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 m(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 m(d).updateRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})}}},h.RoutingOutboundCallServiceApi=Ht,h.RoutingSchemaServiceApiAxiosParamCreator=Dt,h.RoutingSchemaServiceApiFp=Ft,h.RoutingSchemaServiceApiFactory=function(l,d,_){return{createRoutingSchema:function(e,t){return Ft(l).createRoutingSchema(e,t).then(function(e){return e(_,d)})},deleteRoutingSchema:function(e,t,n){return Ft(l).deleteRoutingSchema(e,t,n).then(function(e){return e(_,d)})},patchRoutingSchema:function(e,t,n){return Ft(l).patchRoutingSchema(e,t,n).then(function(e){return e(_,d)})},readRoutingSchema:function(e,t,n){return Ft(l).readRoutingSchema(e,t,n).then(function(e){return e(_,d)})},searchRoutingSchema:function(e,t,n,r,i,a,s,o,u,c){return Ft(l).searchRoutingSchema(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},updateRoutingSchema:function(e,t,n){return Ft(l).updateRoutingSchema(e,t,n).then(function(e){return e(_,d)})}}},h.RoutingSchemaServiceApi=Jt,h.RoutingVariableServiceApiAxiosParamCreator=Vt,h.RoutingVariableServiceApiFp=$t,h.RoutingVariableServiceApiFactory=function(i,a,s){return{createRoutingVariable:function(e,t){return $t(i).createRoutingVariable(e,t).then(function(e){return e(s,a)})},deleteRoutingVariable:function(e,t,n){return $t(i).deleteRoutingVariable(e,t,n).then(function(e){return e(s,a)})},readRoutingVariable:function(e,t,n){return $t(i).readRoutingVariable(e,t,n).then(function(e){return e(s,a)})},searchRoutingVariable:function(e,t,n,r){return $t(i).searchRoutingVariable(e,t,n,r).then(function(e){return e(s,a)})},updateRoutingVariable:function(e,t,n){return $t(i).updateRoutingVariable(e,t,n).then(function(e){return e(s,a)})}}},h.RoutingVariableServiceApi=Zt,h.SkillServiceApiAxiosParamCreator=tn,h.SkillServiceApiFp=nn,h.SkillServiceApiFactory=function(o,u,c){return{createSkill:function(e,t){return nn(o).createSkill(e,t).then(function(e){return e(c,u)})},deleteSkill:function(e,t,n){return nn(o).deleteSkill(e,t,n).then(function(e){return e(c,u)})},readSkill:function(e,t,n){return nn(o).readSkill(e,t,n).then(function(e){return e(c,u)})},searchSkill:function(e,t,n,r,i,a,s){return nn(o).searchSkill(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateSkill:function(e,t,n){return nn(o).updateSkill(e,t,n).then(function(e){return e(c,u)})}}},h.SkillServiceApi=an,h.UserHelperServiceApiAxiosParamCreator=on,h.UserHelperServiceApiFp=un,h.UserHelperServiceApiFactory=function(n,r,i){return{defaultDeviceConfig:function(e,t){return un(n).defaultDeviceConfig(e,t).then(function(e){return e(i,r)})}}},h.UserHelperServiceApi=ln,h.Configuration=_n,h.Client=K,h.Call=qn,h.Agent=mn,h.Conversation=An,h.DeviceNotFoundError=Sn,h.DeviceNotAllowPermissionError=Tn,h.SipClient=Mn,h.ExternalClient=Dn,h.SipPhone=yn,h.Log=hn,Object.defineProperty(h,"__esModule",{value:!0})});
2
2
  //# sourceMappingURL=index.umd.min.js.map