webitel-sdk 0.1.164 → 0.1.166
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/index.esm.js +1664 -1664
- package/bundles/index.esm.js.map +1 -1
- package/bundles/index.esm.min.js +1 -1
- package/bundles/index.esm.min.js.map +1 -1
- package/bundles/index.umd.js +1664 -1664
- package/bundles/index.umd.js.map +1 -1
- package/bundles/index.umd.min.js +1 -1
- package/bundles/index.umd.min.js.map +1 -1
- package/esm2015/api/agent-pause-cause-service-api.js +49 -49
- package/esm2015/api/agent-pause-cause-service-api.js.map +1 -1
- package/esm2015/api/agent-service-api.js +151 -151
- package/esm2015/api/agent-service-api.js.map +1 -1
- package/esm2015/api/agent-skill-service-api.js +63 -63
- package/esm2015/api/agent-skill-service-api.js.map +1 -1
- package/esm2015/api/agent-team-service-api.js +40 -40
- package/esm2015/api/agent-team-service-api.js.map +1 -1
- package/esm2015/api/bucket-service-api.js +40 -40
- package/esm2015/api/bucket-service-api.js.map +1 -1
- package/esm2015/api/calendar-service-api.js +47 -47
- package/esm2015/api/calendar-service-api.js.map +1 -1
- package/esm2015/api/call-service-api.js +128 -128
- package/esm2015/api/call-service-api.js.map +1 -1
- package/esm2015/api/communication-type-service-api.js +40 -40
- package/esm2015/api/communication-type-service-api.js.map +1 -1
- package/esm2015/api/email-profile-service-api.js +57 -57
- package/esm2015/api/email-profile-service-api.js.map +1 -1
- package/esm2015/api/list-service-api.js +85 -85
- package/esm2015/api/list-service-api.js.map +1 -1
- package/esm2015/api/member-service-api.js +151 -151
- package/esm2015/api/member-service-api.js.map +1 -1
- package/esm2015/api/outbound-resource-group-service-api.js +85 -85
- package/esm2015/api/outbound-resource-group-service-api.js.map +1 -1
- package/esm2015/api/outbound-resource-service-api.js +94 -94
- package/esm2015/api/outbound-resource-service-api.js.map +1 -1
- package/esm2015/api/queue-bucket-service-api.js +55 -55
- package/esm2015/api/queue-bucket-service-api.js.map +1 -1
- package/esm2015/api/queue-hook-service-api.js +55 -55
- package/esm2015/api/queue-hook-service-api.js.map +1 -1
- package/esm2015/api/queue-resources-service-api.js +45 -45
- package/esm2015/api/queue-resources-service-api.js.map +1 -1
- package/esm2015/api/queue-service-api.js +56 -56
- package/esm2015/api/queue-service-api.js.map +1 -1
- package/esm2015/api/queue-skill-service-api.js +55 -55
- package/esm2015/api/queue-skill-service-api.js.map +1 -1
- package/esm2015/api/region-service-api.js +49 -49
- package/esm2015/api/region-service-api.js.map +1 -1
- package/esm2015/api/routing-chat-plan-service-api.js +49 -49
- package/esm2015/api/routing-chat-plan-service-api.js.map +1 -1
- package/esm2015/api/routing-outbound-call-service-api.js +59 -59
- package/esm2015/api/routing-outbound-call-service-api.js.map +1 -1
- package/esm2015/api/routing-schema-service-api.js +56 -56
- package/esm2015/api/routing-schema-service-api.js.map +1 -1
- package/esm2015/api/routing-variable-service-api.js +40 -40
- package/esm2015/api/routing-variable-service-api.js.map +1 -1
- package/esm2015/api/skill-service-api.js +40 -40
- package/esm2015/api/skill-service-api.js.map +1 -1
- package/esm2015/api/trigger-service-api.js +66 -66
- package/esm2015/api/trigger-service-api.js.map +1 -1
- package/esm2015/api/user-helper-service-api.js +8 -8
- package/esm2015/api/user-helper-service-api.js.map +1 -1
- package/esm2015/enums/cloud-providers/microsoft/microsoft-language.enum.js +77 -54
- package/esm2015/enums/cloud-providers/microsoft/microsoft-language.enum.js.map +1 -1
- package/esm5/api/agent-pause-cause-service-api.js +49 -49
- package/esm5/api/agent-pause-cause-service-api.js.map +1 -1
- package/esm5/api/agent-service-api.js +151 -151
- package/esm5/api/agent-service-api.js.map +1 -1
- package/esm5/api/agent-skill-service-api.js +63 -63
- package/esm5/api/agent-skill-service-api.js.map +1 -1
- package/esm5/api/agent-team-service-api.js +40 -40
- package/esm5/api/agent-team-service-api.js.map +1 -1
- package/esm5/api/bucket-service-api.js +40 -40
- package/esm5/api/bucket-service-api.js.map +1 -1
- package/esm5/api/calendar-service-api.js +47 -47
- package/esm5/api/calendar-service-api.js.map +1 -1
- package/esm5/api/call-service-api.js +128 -128
- package/esm5/api/call-service-api.js.map +1 -1
- package/esm5/api/communication-type-service-api.js +40 -40
- package/esm5/api/communication-type-service-api.js.map +1 -1
- package/esm5/api/email-profile-service-api.js +57 -57
- package/esm5/api/email-profile-service-api.js.map +1 -1
- package/esm5/api/list-service-api.js +85 -85
- package/esm5/api/list-service-api.js.map +1 -1
- package/esm5/api/member-service-api.js +151 -151
- package/esm5/api/member-service-api.js.map +1 -1
- package/esm5/api/outbound-resource-group-service-api.js +85 -85
- package/esm5/api/outbound-resource-group-service-api.js.map +1 -1
- package/esm5/api/outbound-resource-service-api.js +94 -94
- package/esm5/api/outbound-resource-service-api.js.map +1 -1
- package/esm5/api/queue-bucket-service-api.js +55 -55
- package/esm5/api/queue-bucket-service-api.js.map +1 -1
- package/esm5/api/queue-hook-service-api.js +55 -55
- package/esm5/api/queue-hook-service-api.js.map +1 -1
- package/esm5/api/queue-resources-service-api.js +45 -45
- package/esm5/api/queue-resources-service-api.js.map +1 -1
- package/esm5/api/queue-service-api.js +56 -56
- package/esm5/api/queue-service-api.js.map +1 -1
- package/esm5/api/queue-skill-service-api.js +55 -55
- package/esm5/api/queue-skill-service-api.js.map +1 -1
- package/esm5/api/region-service-api.js +49 -49
- package/esm5/api/region-service-api.js.map +1 -1
- package/esm5/api/routing-chat-plan-service-api.js +49 -49
- package/esm5/api/routing-chat-plan-service-api.js.map +1 -1
- package/esm5/api/routing-outbound-call-service-api.js +59 -59
- package/esm5/api/routing-outbound-call-service-api.js.map +1 -1
- package/esm5/api/routing-schema-service-api.js +56 -56
- package/esm5/api/routing-schema-service-api.js.map +1 -1
- package/esm5/api/routing-variable-service-api.js +40 -40
- package/esm5/api/routing-variable-service-api.js.map +1 -1
- package/esm5/api/skill-service-api.js +40 -40
- package/esm5/api/skill-service-api.js.map +1 -1
- package/esm5/api/trigger-service-api.js +66 -66
- package/esm5/api/trigger-service-api.js.map +1 -1
- package/esm5/api/user-helper-service-api.js +8 -8
- package/esm5/api/user-helper-service-api.js.map +1 -1
- package/esm5/enums/cloud-providers/microsoft/microsoft-language.enum.js +77 -54
- package/esm5/enums/cloud-providers/microsoft/microsoft-language.enum.js.map +1 -1
- package/package.json +4 -4
- package/types/api/agent-pause-cause-service-api.d.ts +24 -24
- package/types/api/agent-pause-cause-service-api.d.ts.map +1 -1
- package/types/api/agent-service-api.d.ts +76 -76
- package/types/api/agent-service-api.d.ts.map +1 -1
- package/types/api/agent-skill-service-api.d.ts +28 -28
- package/types/api/agent-skill-service-api.d.ts.map +1 -1
- package/types/api/agent-team-service-api.d.ts +20 -20
- package/types/api/agent-team-service-api.d.ts.map +1 -1
- package/types/api/bucket-service-api.d.ts +20 -20
- package/types/api/bucket-service-api.d.ts.map +1 -1
- package/types/api/calendar-service-api.d.ts +24 -24
- package/types/api/calendar-service-api.d.ts.map +1 -1
- package/types/api/call-service-api.d.ts +60 -60
- package/types/api/call-service-api.d.ts.map +1 -1
- package/types/api/communication-type-service-api.d.ts +20 -20
- package/types/api/communication-type-service-api.d.ts.map +1 -1
- package/types/api/email-profile-service-api.d.ts +28 -28
- package/types/api/email-profile-service-api.d.ts.map +1 -1
- package/types/api/list-service-api.d.ts +40 -40
- package/types/api/list-service-api.d.ts.map +1 -1
- package/types/api/member-service-api.d.ts +68 -68
- package/types/api/member-service-api.d.ts.map +1 -1
- package/types/api/outbound-resource-group-service-api.d.ts +40 -40
- package/types/api/outbound-resource-group-service-api.d.ts.map +1 -1
- package/types/api/outbound-resource-service-api.d.ts +44 -44
- package/types/api/outbound-resource-service-api.d.ts.map +1 -1
- package/types/api/queue-bucket-service-api.d.ts +24 -24
- package/types/api/queue-bucket-service-api.d.ts.map +1 -1
- package/types/api/queue-hook-service-api.d.ts +24 -24
- package/types/api/queue-hook-service-api.d.ts.map +1 -1
- package/types/api/queue-resources-service-api.d.ts +20 -20
- package/types/api/queue-resources-service-api.d.ts.map +1 -1
- package/types/api/queue-service-api.d.ts +28 -28
- package/types/api/queue-service-api.d.ts.map +1 -1
- package/types/api/queue-skill-service-api.d.ts +24 -24
- package/types/api/queue-skill-service-api.d.ts.map +1 -1
- package/types/api/region-service-api.d.ts +24 -24
- package/types/api/region-service-api.d.ts.map +1 -1
- package/types/api/routing-chat-plan-service-api.d.ts +24 -24
- package/types/api/routing-chat-plan-service-api.d.ts.map +1 -1
- package/types/api/routing-outbound-call-service-api.d.ts +28 -28
- package/types/api/routing-outbound-call-service-api.d.ts.map +1 -1
- package/types/api/routing-schema-service-api.d.ts +28 -28
- package/types/api/routing-schema-service-api.d.ts.map +1 -1
- package/types/api/routing-variable-service-api.d.ts +20 -20
- package/types/api/routing-variable-service-api.d.ts.map +1 -1
- package/types/api/skill-service-api.d.ts +20 -20
- package/types/api/skill-service-api.d.ts.map +1 -1
- package/types/api/trigger-service-api.d.ts +32 -32
- package/types/api/trigger-service-api.d.ts.map +1 -1
- package/types/api/user-helper-service-api.d.ts +4 -4
- package/types/api/user-helper-service-api.d.ts.map +1 -1
- package/types/enums/cloud-providers/microsoft/microsoft-language.enum.d.ts.map +1 -1
- package/esm2015/api/create-call-request-endpoint-request.js +0 -13
- package/esm2015/api/create-call-request-endpoint-request.js.map +0 -1
- package/esm2015/api/upload-file-request-metadata.js +0 -13
- package/esm2015/api/upload-file-request-metadata.js.map +0 -1
- package/esm5/api/create-call-request-endpoint-request.js +0 -13
- package/esm5/api/create-call-request-endpoint-request.js.map +0 -1
- package/esm5/api/upload-file-request-metadata.js +0 -13
- package/esm5/api/upload-file-request-metadata.js.map +0 -1
- package/types/api/create-call-request-endpoint-request.d.ts +0 -43
- package/types/api/create-call-request-endpoint-request.d.ts.map +0 -1
- package/types/api/upload-file-request-metadata.d.ts +0 -43
- package/types/api/upload-file-request-metadata.d.ts.map +0 -1
package/bundles/index.umd.min.js
CHANGED
|
@@ -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,V,z,B,T,O){"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(/\/+$/,""),K=(I=Error,V.__extends(U,I),U);function U(e,t){t=I.call(this,t)||this;return t.field=e,t.name="RequiredError",t}function W(g){var e=this;return{agentPauseCauseServiceCreateAgentPauseCause:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling agentPauseCauseServiceCreateAgentPauseCause.");return(t=z.parse("/call_center/pause_causes",!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},agentPauseCauseServiceDeleteAgentPauseCause:function(u,c){return void 0===c&&(c={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling agentPauseCauseServiceDeleteAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__assign({method:"DELETE"},n),c),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=V.__assign(V.__assign(V.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),c.headers),[2,{url:z.format(t),options:r}]}})})},agentPauseCauseServicePatchAgentPauseCause:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling agentPauseCauseServicePatchAgentPauseCause.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling agentPauseCauseServicePatchAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},agentPauseCauseServiceReadAgentPauseCause:function(u,c){return void 0===c&&(c={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling agentPauseCauseServiceReadAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),c),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=V.__assign(V.__assign(V.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),c.headers),[2,{url:z.format(t),options:r}]}})})},agentPauseCauseServiceSearchAgentPauseCause:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/call_center/pause_causes",!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),p.headers),[2,{url:z.format(t),options:r}]}})})},agentPauseCauseServiceUpdateAgentPauseCause:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling agentPauseCauseServiceUpdateAgentPauseCause.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling agentPauseCauseServiceUpdateAgentPauseCause.");return(t="/call_center/pause_causes/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function l(c){return{agentPauseCauseServiceCreateAgentPauseCause:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,W(c).agentPauseCauseServiceCreateAgentPauseCause(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentPauseCauseServiceDeleteAgentPauseCause:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,W(c).agentPauseCauseServiceDeleteAgentPauseCause(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentPauseCauseServicePatchAgentPauseCause:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,W(c).agentPauseCauseServicePatchAgentPauseCause(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentPauseCauseServiceReadAgentPauseCause:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,W(c).agentPauseCauseServiceReadAgentPauseCause(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentPauseCauseServiceSearchAgentPauseCause:function(t,r,i,a,s,o,u){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,W(c).agentPauseCauseServiceSearchAgentPauseCause(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentPauseCauseServiceUpdateAgentPauseCause:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,W(c).agentPauseCauseServiceUpdateAgentPauseCause(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}X=e,V.__extends(E,X),E.prototype.agentPauseCauseServiceCreateAgentPauseCause=function(e,t){var n=this;return l(this.configuration).agentPauseCauseServiceCreateAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},E.prototype.agentPauseCauseServiceDeleteAgentPauseCause=function(e,t){var n=this;return l(this.configuration).agentPauseCauseServiceDeleteAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},E.prototype.agentPauseCauseServicePatchAgentPauseCause=function(e,t,n){var r=this;return l(this.configuration).agentPauseCauseServicePatchAgentPauseCause(e,t,n).then(function(e){return e(r.axios,r.basePath)})},E.prototype.agentPauseCauseServiceReadAgentPauseCause=function(e,t){var n=this;return l(this.configuration).agentPauseCauseServiceReadAgentPauseCause(e,t).then(function(e){return e(n.axios,n.basePath)})},E.prototype.agentPauseCauseServiceSearchAgentPauseCause=function(e,t,n,r,i,a,s){var o=this;return l(this.configuration).agentPauseCauseServiceSearchAgentPauseCause(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},E.prototype.agentPauseCauseServiceUpdateAgentPauseCause=function(e,t,n){var r=this;return l(this.configuration).agentPauseCauseServiceUpdateAgentPauseCause(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var X,D=E;function E(){return null!==X&&X.apply(this,arguments)||this}function w(P){var e=this;return{agentServiceAgentSetState:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("agentId","Required parameter agentId was null or undefined when calling agentServiceAgentSetState.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling agentServiceAgentSetState.");return(t="/call_center/agents/{agent_id}/states/waiting".replace("{agent_id}",encodeURIComponent(String(c))),t=z.parse(t,!0),P&&(n=P.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},agentServiceAgentStateHistory:function(u,c,l,d,_,h,p,g){return void 0===g&&(g={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("agentId","Required parameter agentId was null or undefined when calling agentServiceAgentStateHistory.");return(t="/call_center/agents/{agent_id}/states/history".replace("{agent_id}",encodeURIComponent(String(u))),t=z.parse(t,!0),P&&(n=P.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),g),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==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=V.__assign(V.__assign(V.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),g.headers),[2,{url:z.format(t),options:r}]}})})},agentServiceAgentTodayStatistics:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("agentId","Required parameter agentId was null or undefined when calling agentServiceAgentTodayStatistics.");return(t="/call_center/agents/{agent_id}/statistics/today".replace("{agent_id}",encodeURIComponent(String(u))),t=z.parse(t,!0),P&&(n=P.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),l),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return c&&(a.fields=c),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},agentServiceCreateAgent:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling agentServiceCreateAgent.");return(t=z.parse("/call_center/agents",!0),P&&(n=P.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},agentServiceDeleteAgent:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling agentServiceDeleteAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),P&&(n=P.baseOptions),r=V.__assign(V.__assign({method:"DELETE"},n),l),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},agentServicePatchAgent:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling agentServicePatchAgent.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling agentServicePatchAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),P&&(n=P.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},agentServiceReadAgent:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling agentServiceReadAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),P&&(n=P.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),l),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},agentServiceSearchAgent:function(u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A){return void 0===A&&(A={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/call_center/agents",!0),P&&(n=P.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),A),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.allow_channels=p),g&&(a.supervisor_id=g),f&&(a.team_id=f),v&&(a.region_id=v),b&&(a.auditor_id=b),void 0!==y&&(a.is_supervisor=y),S&&(a.skill_id=S),m&&(a.queue_id=m),void 0!==w&&(a.not_supervisor=w),q&&(a.user_id=q),C&&(a.extension=C),R&&(a.not_team_id=R),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),A.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),A.headers),[2,{url:z.format(t),options:r}]}})})},agentServiceSearchAgentCallStatistics:function(u,c,l,d,_,h,p,g,f,v){return void 0===v&&(v={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/call_center/agents/reports/call",!0),P&&(n=P.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),v),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a["time.from"]=l),void 0!==d&&(a["time.to"]=d),_&&(a.agent_id=_),void 0!==h&&(a.domain_id=h),void 0!==p&&(a.q=p),g&&(a.fields=g),void 0!==f&&(a.sort=f),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),v.headers),[2,{url:z.format(t),options:r}]}})})},agentServiceSearchAgentInQueue:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling agentServiceSearchAgentInQueue.");return(t="/call_center/agents/{id}/queues".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),P&&(n=P.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),p),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),p.headers),[2,{url:z.format(t),options:r}]}})})},agentServiceSearchAgentInQueueStatistics:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("agentId","Required parameter agentId was null or undefined when calling agentServiceSearchAgentInQueueStatistics.");return(t="/call_center/agents/{agent_id}/statistics/queues".replace("{agent_id}",encodeURIComponent(String(u))),t=z.parse(t,!0),P&&(n=P.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),l),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.domain_id=c),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},agentServiceSearchAgentInTeam:function(u,c,l,d,_,h){return void 0===h&&(h={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling agentServiceSearchAgentInTeam.");return(t="/call_center/agents/{id}/teams".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),P&&(n=P.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),h),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.domain_id=_),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),h.headers),[2,{url:z.format(t),options:r}]}})})},agentServiceSearchAgentStateHistory:function(u,c,l,d,_,h,p,g,f){return void 0===f&&(f={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/call_center/agents/states/history",!0),P&&(n=P.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),f),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==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!==g&&(a.from_id=g),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),f.headers),[2,{url:z.format(t),options:r}]}})})},agentServiceSearchAgentStatusStatistic:function(u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A){return void 0===A&&(A={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/call_center/agents/reports/status",!0),P&&(n=P.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),A),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.agent_id=h),void 0!==p&&(a["time.from"]=p),void 0!==g&&(a["time.to"]=g),f&&(a.status=f),v&&(a.queue_id=v),b&&(a.team_id=b),void 0!==y&&(a["utilization.from"]=y),void 0!==S&&(a["utilization.to"]=S),void 0!==m&&(a.has_call=m),w&&(a.skill_id=w),q&&(a.region_id=q),C&&(a.supervisor_id=C),R&&(a.auditor_id=R),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),A.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),A.headers),[2,{url:z.format(t),options:r}]}})})},agentServiceSearchAgentStatusStatisticItem:function(u,c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("agentId","Required parameter agentId was null or undefined when calling agentServiceSearchAgentStatusStatisticItem.");return(t="/call_center/agents/reports/status/{agent_id}".replace("{agent_id}",encodeURIComponent(String(u))),t=z.parse(t,!0),P&&(n=P.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),d),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a["time.from"]=c),void 0!==l&&(a["time.to"]=l),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),d.headers),[2,{url:z.format(t),options:r}]}})})},agentServiceSearchLookupUsersAgentNotExists:function(u,c,l,d,_){return void 0===_&&(_={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/call_center/lookups/agents/users",!0),P&&(n=P.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),_),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.domain_id=d),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),_.headers),[2,{url:z.format(t),options:r}]}})})},agentServiceSearchPauseCauseForAgent:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("agentId","Required parameter agentId was null or undefined when calling agentServiceSearchPauseCauseForAgent.");return(t="/call_center/agents/{agent_id}/pause_causes".replace("{agent_id}",encodeURIComponent(String(u))),t=z.parse(t,!0),P&&(n=P.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),l),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.allow_change=c),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},agentServiceUpdateAgent:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling agentServiceUpdateAgent.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling agentServiceUpdateAgent.");return(t="/call_center/agents/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),P&&(n=P.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},agentServiceUpdateAgentStatus:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling agentServiceUpdateAgentStatus.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling agentServiceUpdateAgentStatus.");return(t="/call_center/agents/{id}/status".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),P&&(n=P.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function q(m){return{agentServiceAgentSetState:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,w(m).agentServiceAgentSetState(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentServiceAgentStateHistory:function(t,r,i,a,s,o,u,c){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,w(m).agentServiceAgentStateHistory(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentServiceAgentTodayStatistics:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,w(m).agentServiceAgentTodayStatistics(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentServiceCreateAgent:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,w(m).agentServiceCreateAgent(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentServiceDeleteAgent:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,w(m).agentServiceDeleteAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentServicePatchAgent:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,w(m).agentServicePatchAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentServiceReadAgent:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,w(m).agentServiceReadAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentServiceSearchAgent:function(t,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,w(m).agentServiceSearchAgent(t,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentServiceSearchAgentCallStatistics:function(t,r,i,a,s,o,u,c,l,d){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,w(m).agentServiceSearchAgentCallStatistics(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentServiceSearchAgentInQueue:function(t,r,i,a,s,o,u){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,w(m).agentServiceSearchAgentInQueue(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentServiceSearchAgentInQueueStatistics:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,w(m).agentServiceSearchAgentInQueueStatistics(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentServiceSearchAgentInTeam:function(t,r,i,a,s,o){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,w(m).agentServiceSearchAgentInTeam(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentServiceSearchAgentStateHistory:function(t,r,i,a,s,o,u,c,l){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,w(m).agentServiceSearchAgentStateHistory(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentServiceSearchAgentStatusStatistic:function(t,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,w(m).agentServiceSearchAgentStatusStatistic(t,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentServiceSearchAgentStatusStatisticItem:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,w(m).agentServiceSearchAgentStatusStatisticItem(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentServiceSearchLookupUsersAgentNotExists:function(t,r,i,a,s){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,w(m).agentServiceSearchLookupUsersAgentNotExists(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentServiceSearchPauseCauseForAgent:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,w(m).agentServiceSearchPauseCauseForAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentServiceUpdateAgent:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,w(m).agentServiceUpdateAgent(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentServiceUpdateAgentStatus:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,w(m).agentServiceUpdateAgentStatus(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}x=e,V.__extends(t,x),t.prototype.agentServiceAgentSetState=function(e,t,n){var r=this;return q(this.configuration).agentServiceAgentSetState(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.agentServiceAgentStateHistory=function(e,t,n,r,i,a,s,o){var u=this;return q(this.configuration).agentServiceAgentStateHistory(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},t.prototype.agentServiceAgentTodayStatistics=function(e,t,n){var r=this;return q(this.configuration).agentServiceAgentTodayStatistics(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.agentServiceCreateAgent=function(e,t){var n=this;return q(this.configuration).agentServiceCreateAgent(e,t).then(function(e){return e(n.axios,n.basePath)})},t.prototype.agentServiceDeleteAgent=function(e,t,n){var r=this;return q(this.configuration).agentServiceDeleteAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.agentServicePatchAgent=function(e,t,n){var r=this;return q(this.configuration).agentServicePatchAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.agentServiceReadAgent=function(e,t,n){var r=this;return q(this.configuration).agentServiceReadAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.agentServiceSearchAgent=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b){var y=this;return q(this.configuration).agentServiceSearchAgent(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b).then(function(e){return e(y.axios,y.basePath)})},t.prototype.agentServiceSearchAgentCallStatistics=function(e,t,n,r,i,a,s,o,u,c){var l=this;return q(this.configuration).agentServiceSearchAgentCallStatistics(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},t.prototype.agentServiceSearchAgentInQueue=function(e,t,n,r,i,a,s){var o=this;return q(this.configuration).agentServiceSearchAgentInQueue(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},t.prototype.agentServiceSearchAgentInQueueStatistics=function(e,t,n){var r=this;return q(this.configuration).agentServiceSearchAgentInQueueStatistics(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.agentServiceSearchAgentInTeam=function(e,t,n,r,i,a){var s=this;return q(this.configuration).agentServiceSearchAgentInTeam(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},t.prototype.agentServiceSearchAgentStateHistory=function(e,t,n,r,i,a,s,o,u){var c=this;return q(this.configuration).agentServiceSearchAgentStateHistory(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},t.prototype.agentServiceSearchAgentStatusStatistic=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b){var y=this;return q(this.configuration).agentServiceSearchAgentStatusStatistic(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b).then(function(e){return e(y.axios,y.basePath)})},t.prototype.agentServiceSearchAgentStatusStatisticItem=function(e,t,n,r){var i=this;return q(this.configuration).agentServiceSearchAgentStatusStatisticItem(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},t.prototype.agentServiceSearchLookupUsersAgentNotExists=function(e,t,n,r,i){var a=this;return q(this.configuration).agentServiceSearchLookupUsersAgentNotExists(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},t.prototype.agentServiceSearchPauseCauseForAgent=function(e,t,n){var r=this;return q(this.configuration).agentServiceSearchPauseCauseForAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.agentServiceUpdateAgent=function(e,t,n){var r=this;return q(this.configuration).agentServiceUpdateAgent(e,t,n).then(function(e){return e(r.axios,r.basePath)})},t.prototype.agentServiceUpdateAgentStatus=function(e,t,n){var r=this;return q(this.configuration).agentServiceUpdateAgentStatus(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var x,G=t;function t(){return null!==x&&x.apply(this,arguments)||this}function Q(f){var e=this;return{agentSkillServiceCreateAgentSkill:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("agentId","Required parameter agentId was null or undefined when calling agentSkillServiceCreateAgentSkill.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling agentSkillServiceCreateAgentSkill.");return(t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(c))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},agentSkillServiceDeleteAgentSkill:function(u,c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("agentId","Required parameter agentId was null or undefined when calling agentSkillServiceDeleteAgentSkill.");if(null==c)throw new K("id","Required parameter id was null or undefined when calling agentSkillServiceDeleteAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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 void 0!==l&&(a.domain_id=l),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),d.headers),[2,{url:z.format(t),options:r}]}})})},agentSkillServicePatchAgentSkill:function(c,l,d,_){return void 0===_&&(_={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("agentId","Required parameter agentId was null or undefined when calling agentSkillServicePatchAgentSkill.");if(null==l)throw new K("id","Required parameter id was null or undefined when calling agentSkillServicePatchAgentSkill.");if(null==d)throw new K("body","Required parameter body was null or undefined when calling agentSkillServicePatchAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__assign({method:"PATCH"},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=V.__assign(V.__assign(V.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},agentSkillServiceReadAgentSkill:function(u,c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("agentId","Required parameter agentId was null or undefined when calling agentSkillServiceReadAgentSkill.");if(null==c)throw new K("id","Required parameter id was null or undefined when calling agentSkillServiceReadAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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!==l&&(a.domain_id=l),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),d.headers),[2,{url:z.format(t),options:r}]}})})},agentSkillServiceSearchAgentSkill:function(u,c,l,d,_,h,p,g){return void 0===g&&(g={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("agentId","Required parameter agentId was null or undefined when calling agentSkillServiceSearchAgentSkill.");return(t="/call_center/agents/{agent_id}/skills".replace("{agent_id}",encodeURIComponent(String(u))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),g),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.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=V.__assign(V.__assign(V.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),g.headers),[2,{url:z.format(t),options:r}]}})})},agentSkillServiceSearchLookupAgentNotExistsSkill:function(u,c,l,d,_,h){return void 0===h&&(h={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("agentId","Required parameter agentId was null or undefined when calling agentSkillServiceSearchLookupAgentNotExistsSkill.");return(t="/call_center/lookups/agents/skills/{agent_id}".replace("{agent_id}",encodeURIComponent(String(u))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.domain_id=_),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),h.headers),[2,{url:z.format(t),options:r}]}})})},agentSkillServiceUpdateAgentSkill:function(c,l,d,_){return void 0===_&&(_={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("agentId","Required parameter agentId was null or undefined when calling agentSkillServiceUpdateAgentSkill.");if(null==l)throw new K("id","Required parameter id was null or undefined when calling agentSkillServiceUpdateAgentSkill.");if(null==d)throw new K("body","Required parameter body was null or undefined when calling agentSkillServiceUpdateAgentSkill.");return(t="/call_center/agents/{agent_id}/skills/{id}".replace("{agent_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function d(l){return{agentSkillServiceCreateAgentSkill:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Q(l).agentSkillServiceCreateAgentSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentSkillServiceDeleteAgentSkill:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Q(l).agentSkillServiceDeleteAgentSkill(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentSkillServicePatchAgentSkill:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Q(l).agentSkillServicePatchAgentSkill(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentSkillServiceReadAgentSkill:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Q(l).agentSkillServiceReadAgentSkill(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentSkillServiceSearchAgentSkill:function(t,r,i,a,s,o,u,c){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Q(l).agentSkillServiceSearchAgentSkill(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentSkillServiceSearchLookupAgentNotExistsSkill:function(t,r,i,a,s,o){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Q(l).agentSkillServiceSearchLookupAgentNotExistsSkill(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentSkillServiceUpdateAgentSkill:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Q(l).agentSkillServiceUpdateAgentSkill(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}j=e,V.__extends(J,j),J.prototype.agentSkillServiceCreateAgentSkill=function(e,t,n){var r=this;return d(this.configuration).agentSkillServiceCreateAgentSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},J.prototype.agentSkillServiceDeleteAgentSkill=function(e,t,n,r){var i=this;return d(this.configuration).agentSkillServiceDeleteAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},J.prototype.agentSkillServicePatchAgentSkill=function(e,t,n,r){var i=this;return d(this.configuration).agentSkillServicePatchAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},J.prototype.agentSkillServiceReadAgentSkill=function(e,t,n,r){var i=this;return d(this.configuration).agentSkillServiceReadAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},J.prototype.agentSkillServiceSearchAgentSkill=function(e,t,n,r,i,a,s,o){var u=this;return d(this.configuration).agentSkillServiceSearchAgentSkill(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},J.prototype.agentSkillServiceSearchLookupAgentNotExistsSkill=function(e,t,n,r,i,a){var s=this;return d(this.configuration).agentSkillServiceSearchLookupAgentNotExistsSkill(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},J.prototype.agentSkillServiceUpdateAgentSkill=function(e,t,n,r){var i=this;return d(this.configuration).agentSkillServiceUpdateAgentSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var j,H=J;function J(){return null!==j&&j.apply(this,arguments)||this}function N(v){var e=this;return{agentTeamServiceCreateAgentTeam:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling agentTeamServiceCreateAgentTeam.");return(t=z.parse("/call_center/teams",!0),v&&(n=v.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},agentTeamServiceDeleteAgentTeam:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling agentTeamServiceDeleteAgentTeam.");return(t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),v&&(n=v.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},agentTeamServiceReadAgentTeam:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling agentTeamServiceReadAgentTeam.");return(t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),v&&(n=v.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},agentTeamServiceSearchAgentTeam:function(u,c,l,d,_,h,p,g,f){return void 0===f&&(f={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/call_center/teams",!0),v&&(n=v.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),f),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),g&&(a.admin_id=g),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),f.headers),[2,{url:z.format(t),options:r}]}})})},agentTeamServiceUpdateAgentTeam:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling agentTeamServiceUpdateAgentTeam.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling agentTeamServiceUpdateAgentTeam.");return(t="/call_center/teams/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),v&&(n=v.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function $(d){return{agentTeamServiceCreateAgentTeam:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,N(d).agentTeamServiceCreateAgentTeam(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentTeamServiceDeleteAgentTeam:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,N(d).agentTeamServiceDeleteAgentTeam(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentTeamServiceReadAgentTeam:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,N(d).agentTeamServiceReadAgentTeam(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentTeamServiceSearchAgentTeam:function(t,r,i,a,s,o,u,c,l){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,N(d).agentTeamServiceSearchAgentTeam(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentTeamServiceUpdateAgentTeam:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,N(d).agentTeamServiceUpdateAgentTeam(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Y=e,V.__extends(ee,Y),ee.prototype.agentTeamServiceCreateAgentTeam=function(e,t){var n=this;return $(this.configuration).agentTeamServiceCreateAgentTeam(e,t).then(function(e){return e(n.axios,n.basePath)})},ee.prototype.agentTeamServiceDeleteAgentTeam=function(e,t,n){var r=this;return $(this.configuration).agentTeamServiceDeleteAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ee.prototype.agentTeamServiceReadAgentTeam=function(e,t,n){var r=this;return $(this.configuration).agentTeamServiceReadAgentTeam(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ee.prototype.agentTeamServiceSearchAgentTeam=function(e,t,n,r,i,a,s,o,u){var c=this;return $(this.configuration).agentTeamServiceSearchAgentTeam(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},ee.prototype.agentTeamServiceUpdateAgentTeam=function(e,t,n){var r=this;return $(this.configuration).agentTeamServiceUpdateAgentTeam(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(g){var e=this;return{createBackendProfile:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling createBackendProfile.");return(t=z.parse("/storage/backend_profiles",!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},deleteBackendProfile:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling deleteBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},patchBackendProfile:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling patchBackendProfile.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling patchBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},readBackendProfile:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling readBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},searchBackendProfile:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/storage/backend_profiles",!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),p.headers),[2,{url:z.format(t),options:r}]}})})},updateBackendProfile:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling updateBackendProfile.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling updateBackendProfile.");return(t="/storage/backend_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function _(c){return{createBackendProfile:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteBackendProfile:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchBackendProfile:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readBackendProfile:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchBackendProfile:function(t,r,i,a,s,o,u){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateBackendProfile:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ne=e,V.__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(g){var e=this;return{bucketServiceCreateBucket:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling bucketServiceCreateBucket.");return(t=z.parse("/call_center/buckets",!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},bucketServiceDeleteBucket:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling bucketServiceDeleteBucket.");return(t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},bucketServiceReadBucket:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling bucketServiceReadBucket.");return(t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},bucketServiceSearchBucket:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/call_center/buckets",!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),p.headers),[2,{url:z.format(t),options:r}]}})})},bucketServiceUpdateBucket:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling bucketServiceUpdateBucket.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling bucketServiceUpdateBucket.");return(t="/call_center/buckets/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function se(c){return{bucketServiceCreateBucket:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,ae(c).bucketServiceCreateBucket(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},bucketServiceDeleteBucket:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,ae(c).bucketServiceDeleteBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},bucketServiceReadBucket:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,ae(c).bucketServiceReadBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},bucketServiceSearchBucket:function(t,r,i,a,s,o,u){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,ae(c).bucketServiceSearchBucket(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},bucketServiceUpdateBucket:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,ae(c).bucketServiceUpdateBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}oe=e,V.__extends(ce,oe),ce.prototype.bucketServiceCreateBucket=function(e,t){var n=this;return se(this.configuration).bucketServiceCreateBucket(e,t).then(function(e){return e(n.axios,n.basePath)})},ce.prototype.bucketServiceDeleteBucket=function(e,t,n){var r=this;return se(this.configuration).bucketServiceDeleteBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ce.prototype.bucketServiceReadBucket=function(e,t,n){var r=this;return se(this.configuration).bucketServiceReadBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ce.prototype.bucketServiceSearchBucket=function(e,t,n,r,i,a,s){var o=this;return se(this.configuration).bucketServiceSearchBucket(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},ce.prototype.bucketServiceUpdateBucket=function(e,t,n){var r=this;return se(this.configuration).bucketServiceUpdateBucket(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(g){var e=this;return{calendarServiceCreateCalendar:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling calendarServiceCreateCalendar.");return(t=z.parse("/calendars",!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},calendarServiceDeleteCalendar:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling calendarServiceDeleteCalendar.");return(t="/calendars/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},calendarServiceReadCalendar:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling calendarServiceReadCalendar.");return(t="/calendars/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},calendarServiceSearchCalendar:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/calendars",!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),p.headers),[2,{url:z.format(t),options:r}]}})})},calendarServiceSearchTimezones:function(u,c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/calendars/timezones",!0),g&&(n=g.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),d),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),d.headers),[2,{url:z.format(t),options:r}]}})})},calendarServiceUpdateCalendar:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling calendarServiceUpdateCalendar.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling calendarServiceUpdateCalendar.");return(t="/calendars/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function p(c){return{calendarServiceCreateCalendar:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,le(c).calendarServiceCreateCalendar(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},calendarServiceDeleteCalendar:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,le(c).calendarServiceDeleteCalendar(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},calendarServiceReadCalendar:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,le(c).calendarServiceReadCalendar(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},calendarServiceSearchCalendar:function(t,r,i,a,s,o,u){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,le(c).calendarServiceSearchCalendar(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},calendarServiceSearchTimezones:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,le(c).calendarServiceSearchTimezones(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},calendarServiceUpdateCalendar:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,le(c).calendarServiceUpdateCalendar(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}de=e,V.__extends(he,de),he.prototype.calendarServiceCreateCalendar=function(e,t){var n=this;return p(this.configuration).calendarServiceCreateCalendar(e,t).then(function(e){return e(n.axios,n.basePath)})},he.prototype.calendarServiceDeleteCalendar=function(e,t,n){var r=this;return p(this.configuration).calendarServiceDeleteCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})},he.prototype.calendarServiceReadCalendar=function(e,t,n){var r=this;return p(this.configuration).calendarServiceReadCalendar(e,t,n).then(function(e){return e(r.axios,r.basePath)})},he.prototype.calendarServiceSearchCalendar=function(e,t,n,r,i,a,s){var o=this;return p(this.configuration).calendarServiceSearchCalendar(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},he.prototype.calendarServiceSearchTimezones=function(e,t,n,r){var i=this;return p(this.configuration).calendarServiceSearchTimezones(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},he.prototype.calendarServiceUpdateCalendar=function(e,t,n){var r=this;return p(this.configuration).calendarServiceUpdateCalendar(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 L(N){var e=this;return{callServiceAggregateHistoryCall:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling callServiceAggregateHistoryCall.");return(t=z.parse("/calls/history/aggregate",!0),N&&(n=N.baseOptions),r=V.__assign(V.__assign({method:"POST"},n),l),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},callServiceBlindTransferCall:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling callServiceBlindTransferCall.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling callServiceBlindTransferCall.");return(t="/calls/active/{id}/transfer".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),N&&(n=N.baseOptions),r=V.__assign(V.__assign({method:"PATCH"},n),d),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},callServiceConfirmPush:function(u,c){return void 0===c&&(c={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling callServiceConfirmPush.");return(t="/calls/active/{id}/confirm_push".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),N&&(n=N.baseOptions),r=V.__assign(V.__assign({method:"PATCH"},n),c),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.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=V.__assign(V.__assign(V.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),c.headers),[2,{url:z.format(t),options:r}]}})})},callServiceCreateCall:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling callServiceCreateCall.");return(t=z.parse("/calls",!0),N&&(n=N.baseOptions),r=V.__assign(V.__assign({method:"POST"},n),l),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},callServiceCreateCallAnnotation:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("callId","Required parameter callId was null or undefined when calling callServiceCreateCallAnnotation.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling callServiceCreateCallAnnotation.");return(t="/calls/history/{call_id}/annotation".replace("{call_id}",encodeURIComponent(String(c))),t=z.parse(t,!0),N&&(n=N.baseOptions),r=V.__assign(V.__assign({method:"POST"},n),d),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},callServiceDeleteCallAnnotation:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("callId","Required parameter callId was null or undefined when calling callServiceDeleteCallAnnotation.");if(null==c)throw new K("id","Required parameter id was null or undefined when calling callServiceDeleteCallAnnotation.");return(t="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),N&&(n=N.baseOptions),r=V.__assign(V.__assign({method:"DELETE"},n),l),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},callServiceDtmfCall:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling callServiceDtmfCall.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling callServiceDtmfCall.");return(t="/calls/active/{id}/dtmf".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),N&&(n=N.baseOptions),r=V.__assign(V.__assign({method:"PATCH"},n),d),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},callServiceEavesdropCall:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling callServiceEavesdropCall.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling callServiceEavesdropCall.");return(t="/calls/active/{id}/eavesdrop".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),N&&(n=N.baseOptions),r=V.__assign(V.__assign({method:"POST"},n),d),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},callServiceHangupCall:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling callServiceHangupCall.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling callServiceHangupCall.");return(t="/calls/active/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),N&&(n=N.baseOptions),r=V.__assign(V.__assign({method:"DELETE"},n),d),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},callServiceHoldCall:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling callServiceHoldCall.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling callServiceHoldCall.");return(t="/calls/active/{id}/hold".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),N&&(n=N.baseOptions),r=V.__assign(V.__assign({method:"PATCH"},n),d),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},callServiceReadCall:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling callServiceReadCall.");return(t="/calls/active/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),N&&(n=N.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),l),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},callServiceSearchActiveCall:function(u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A,P,k,T,K,O,I,U,W,X,D,E){return void 0===E&&(E={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/calls/active",!0),N&&(n=N.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),E),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 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),g&&(a.user_id=g),f&&(a.agent_id=f),v&&(a.queue_id=v),b&&(a.team_id=b),y&&(a.member_id=y),S&&(a.gateway_id=S),void 0!==m&&(a["duration.from"]=m),void 0!==w&&(a["duration.to"]=w),void 0!==q&&(a.skip_parent=q),void 0!==C&&(a.parent_id=C),R&&(a.cause=R),void 0!==A&&(a.exists_file=A),void 0!==P&&(a.domain_id=P),void 0!==k&&(a.number=k),T&&(a.direction=T),void 0!==K&&(a["answered_at.from"]=K),void 0!==O&&(a["answered_at.to"]=O),void 0!==I&&(a.missed=I),void 0!==U&&(a["stored_at.from"]=U),void 0!==W&&(a["stored_at.to"]=W),X&&(a.supervisor_id=X),D&&(a.state=D),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),E.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),E.headers),[2,{url:z.format(t),options:r}]}})})},callServiceSearchHistoryCall:function(u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A,P,k,T,K,O,I,U,W,X,D,E,x,G,Q,j,H,M,L,F,J,B){return void 0===B&&(B={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/calls/history",!0),N&&(n=N.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),B),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 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),g&&(a.user_id=g),f&&(a.agent_id=f),v&&(a.queue_id=v),b&&(a.team_id=b),y&&(a.member_id=y),S&&(a.gateway_id=S),void 0!==m&&(a["duration.from"]=m),void 0!==w&&(a["duration.to"]=w),void 0!==q&&(a.skip_parent=q),void 0!==C&&(a.parent_id=C),R&&(a.cause=R),void 0!==A&&(a.has_file=A),void 0!==P&&(a.domain_id=P),void 0!==k&&(a.number=k),void 0!==T&&(a.direction=T),void 0!==K&&(a["answered_at.from"]=K),void 0!==O&&(a["answered_at.to"]=O),void 0!==I&&(a.missed=I),void 0!==U&&(a["stored_at.from"]=U),void 0!==W&&(a["stored_at.to"]=W),X&&(a.id=X),D&&(a.transfer_from=D),E&&(a.transfer_to=E),x&&(a.dependency_id=x),G&&(a.tags=G),Q&&(a.amd_result=Q),void 0!==j&&(a.fts=j),H&&(a.directions=H),void 0!==M&&(a.has_transcript=M),void 0!==L&&(a.agent_description=L),F&&(a.owner_id=F),J&&(a.grantee_id=J),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),B.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),B.headers),[2,{url:z.format(t),options:r}]}})})},callServiceUnHoldCall:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling callServiceUnHoldCall.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling callServiceUnHoldCall.");return(t="/calls/active/{id}/unhold".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),N&&(n=N.baseOptions),r=V.__assign(V.__assign({method:"PATCH"},n),d),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},callServiceUpdateCallAnnotation:function(c,l,d,_){return void 0===_&&(_={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("callId","Required parameter callId was null or undefined when calling callServiceUpdateCallAnnotation.");if(null==l)throw new K("id","Required parameter id was null or undefined when calling callServiceUpdateCallAnnotation.");if(null==d)throw new K("body","Required parameter body was null or undefined when calling callServiceUpdateCallAnnotation.");return(t="/calls/history/{call_id}/annotation/{id}".replace("{call_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=z.parse(t,!0),N&&(n=N.baseOptions),r=V.__assign(V.__assign({method:"PUT"},n),_),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=V.__assign(V.__assign(V.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function F(H){return{callServiceAggregateHistoryCall:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,L(H).callServiceAggregateHistoryCall(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},callServiceBlindTransferCall:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,L(H).callServiceBlindTransferCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},callServiceConfirmPush:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,L(H).callServiceConfirmPush(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},callServiceCreateCall:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,L(H).callServiceCreateCall(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},callServiceCreateCallAnnotation:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,L(H).callServiceCreateCallAnnotation(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},callServiceDeleteCallAnnotation:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,L(H).callServiceDeleteCallAnnotation(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},callServiceDtmfCall:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,L(H).callServiceDtmfCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},callServiceEavesdropCall:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,L(H).callServiceEavesdropCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},callServiceHangupCall:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,L(H).callServiceHangupCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},callServiceHoldCall:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,L(H).callServiceHoldCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},callServiceReadCall:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,L(H).callServiceReadCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},callServiceSearchActiveCall:function(t,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A,P,k,T,K,O){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,L(H).callServiceSearchActiveCall(t,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A,P,k,T,K,O)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},callServiceSearchHistoryCall:function(t,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A,P,k,T,K,O,I,U,W,X,D,E,x,G,Q,j){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,L(H).callServiceSearchHistoryCall(t,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A,P,k,T,K,O,I,U,W,X,D,E,x,G,Q,j)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},callServiceUnHoldCall:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,L(H).callServiceUnHoldCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},callServiceUpdateCallAnnotation:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,L(H).callServiceUpdateCallAnnotation(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}pe=e,V.__extends(n,pe),n.prototype.callServiceAggregateHistoryCall=function(e,t){var n=this;return F(this.configuration).callServiceAggregateHistoryCall(e,t).then(function(e){return e(n.axios,n.basePath)})},n.prototype.callServiceBlindTransferCall=function(e,t,n){var r=this;return F(this.configuration).callServiceBlindTransferCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.callServiceConfirmPush=function(e,t){var n=this;return F(this.configuration).callServiceConfirmPush(e,t).then(function(e){return e(n.axios,n.basePath)})},n.prototype.callServiceCreateCall=function(e,t){var n=this;return F(this.configuration).callServiceCreateCall(e,t).then(function(e){return e(n.axios,n.basePath)})},n.prototype.callServiceCreateCallAnnotation=function(e,t,n){var r=this;return F(this.configuration).callServiceCreateCallAnnotation(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.callServiceDeleteCallAnnotation=function(e,t,n){var r=this;return F(this.configuration).callServiceDeleteCallAnnotation(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.callServiceDtmfCall=function(e,t,n){var r=this;return F(this.configuration).callServiceDtmfCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.callServiceEavesdropCall=function(e,t,n){var r=this;return F(this.configuration).callServiceEavesdropCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.callServiceHangupCall=function(e,t,n){var r=this;return F(this.configuration).callServiceHangupCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.callServiceHoldCall=function(e,t,n){var r=this;return F(this.configuration).callServiceHoldCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.callServiceReadCall=function(e,t,n){var r=this;return F(this.configuration).callServiceReadCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.callServiceSearchActiveCall=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A,P,k,T){var K=this;return F(this.configuration).callServiceSearchActiveCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A,P,k,T).then(function(e){return e(K.axios,K.basePath)})},n.prototype.callServiceSearchHistoryCall=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A,P,k,T,K,O,I,U,W,D,E,x,G,Q){var X=this;return F(this.configuration).callServiceSearchHistoryCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A,P,k,T,K,O,I,U,W,D,E,x,G,Q).then(function(e){return e(X.axios,X.basePath)})},n.prototype.callServiceUnHoldCall=function(e,t,n){var r=this;return F(this.configuration).callServiceUnHoldCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},n.prototype.callServiceUpdateCallAnnotation=function(e,t,n,r){var i=this;return F(this.configuration).callServiceUpdateCallAnnotation(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var pe,ge=n;function n(){return null!==pe&&pe.apply(this,arguments)||this}function fe(v){var e=this;return{createCognitiveProfile:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling createCognitiveProfile.");return(t=z.parse("/storage/cognitive_profiles",!0),v&&(n=v.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},deleteCognitiveProfile:function(u,c){return void 0===c&&(c={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling deleteCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),v&&(n=v.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),c.headers),[2,{url:z.format(t),options:r}]}})})},patchCognitiveProfile:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling patchCognitiveProfile.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling patchCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),v&&(n=v.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},readCognitiveProfile:function(u,c){return void 0===c&&(c={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling readCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),v&&(n=v.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),c.headers),[2,{url:z.format(t),options:r}]}})})},searchCognitiveProfile:function(u,c,l,d,_,h,p,g,f){return void 0===f&&(f={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/storage/cognitive_profiles",!0),v&&(n=v.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),f),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!==g&&(a.enabled=g),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),f.headers),[2,{url:z.format(t),options:r}]}})})},updateCognitiveProfile:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling updateCognitiveProfile.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling updateCognitiveProfile.");return(t="/storage/cognitive_profiles/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),v&&(n=v.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function g(d){return{createCognitiveProfile:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,fe(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCognitiveProfile:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,fe(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchCognitiveProfile:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,fe(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCognitiveProfile:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,fe(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchCognitiveProfile:function(t,r,i,a,s,o,u,c,l){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,fe(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCognitiveProfile:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,fe(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ve=e,V.__extends(ye,ve),ye.prototype.createCognitiveProfile=function(e,t){var n=this;return g(this.configuration).createCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ye.prototype.deleteCognitiveProfile=function(e,t){var n=this;return g(this.configuration).deleteCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ye.prototype.patchCognitiveProfile=function(e,t,n){var r=this;return g(this.configuration).patchCognitiveProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ye.prototype.readCognitiveProfile=function(e,t){var n=this;return g(this.configuration).readCognitiveProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ye.prototype.searchCognitiveProfile=function(e,t,n,r,i,a,s,o,u){var c=this;return g(this.configuration).searchCognitiveProfile(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},ye.prototype.updateCognitiveProfile=function(e,t,n){var r=this;return g(this.configuration).updateCognitiveProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var ve,be=ye;function ye(){return null!==ve&&ve.apply(this,arguments)||this}function Se(g){var e=this;return{communicationTypeServiceCreateCommunicationType:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling communicationTypeServiceCreateCommunicationType.");return(t=z.parse("/call_center/communication_type",!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},communicationTypeServiceDeleteCommunicationType:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling communicationTypeServiceDeleteCommunicationType.");return(t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},communicationTypeServiceReadCommunicationType:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling communicationTypeServiceReadCommunicationType.");return(t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},communicationTypeServiceSearchCommunicationType:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/call_center/communication_type",!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),p.headers),[2,{url:z.format(t),options:r}]}})})},communicationTypeServiceUpdateCommunicationType:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling communicationTypeServiceUpdateCommunicationType.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling communicationTypeServiceUpdateCommunicationType.");return(t="/call_center/communication_type/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function me(c){return{communicationTypeServiceCreateCommunicationType:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Se(c).communicationTypeServiceCreateCommunicationType(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},communicationTypeServiceDeleteCommunicationType:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Se(c).communicationTypeServiceDeleteCommunicationType(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},communicationTypeServiceReadCommunicationType:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Se(c).communicationTypeServiceReadCommunicationType(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},communicationTypeServiceSearchCommunicationType:function(t,r,i,a,s,o,u){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Se(c).communicationTypeServiceSearchCommunicationType(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},communicationTypeServiceUpdateCommunicationType:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Se(c).communicationTypeServiceUpdateCommunicationType(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}we=e,V.__extends(Ce,we),Ce.prototype.communicationTypeServiceCreateCommunicationType=function(e,t){var n=this;return me(this.configuration).communicationTypeServiceCreateCommunicationType(e,t).then(function(e){return e(n.axios,n.basePath)})},Ce.prototype.communicationTypeServiceDeleteCommunicationType=function(e,t,n){var r=this;return me(this.configuration).communicationTypeServiceDeleteCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ce.prototype.communicationTypeServiceReadCommunicationType=function(e,t,n){var r=this;return me(this.configuration).communicationTypeServiceReadCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ce.prototype.communicationTypeServiceSearchCommunicationType=function(e,t,n,r,i,a,s){var o=this;return me(this.configuration).communicationTypeServiceSearchCommunicationType(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Ce.prototype.communicationTypeServiceUpdateCommunicationType=function(e,t,n){var r=this;return me(this.configuration).communicationTypeServiceUpdateCommunicationType(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var we,qe=Ce;function Ce(){return null!==we&&we.apply(this,arguments)||this}function Re(p){var e=this;return{emailProfileServiceCreateEmailProfile:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling emailProfileServiceCreateEmailProfile.");return(t=z.parse("/email/profile",!0),p&&(n=p.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},emailProfileServiceDeleteEmailProfile:function(u,c){return void 0===c&&(c={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling emailProfileServiceDeleteEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),p&&(n=p.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),c.headers),[2,{url:z.format(t),options:r}]}})})},emailProfileServicePatchEmailProfile:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling emailProfileServicePatchEmailProfile.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling emailProfileServicePatchEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),p&&(n=p.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},emailProfileServiceReadEmailProfile:function(u,c){return void 0===c&&(c={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling emailProfileServiceReadEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),p&&(n=p.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),c.headers),[2,{url:z.format(t),options:r}]}})})},emailProfileServiceSearchEmailProfile:function(u,c,l,d,_,h){return void 0===h&&(h={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/email/profile",!0),p&&(n=p.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),h.headers),[2,{url:z.format(t),options:r}]}})})},emailProfileServiceTestEmailProfile:function(u,c){return void 0===c&&(c={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling emailProfileServiceTestEmailProfile.");return(t="/email/profile/{id}/test".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),p&&(n=p.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),c.headers),[2,{url:z.format(t),options:r}]}})})},emailProfileServiceUpdateEmailProfile:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling emailProfileServiceUpdateEmailProfile.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling emailProfileServiceUpdateEmailProfile.");return(t="/email/profile/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),p&&(n=p.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function c(u){return{emailProfileServiceCreateEmailProfile:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).emailProfileServiceCreateEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},emailProfileServiceDeleteEmailProfile:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).emailProfileServiceDeleteEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},emailProfileServicePatchEmailProfile:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).emailProfileServicePatchEmailProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},emailProfileServiceReadEmailProfile:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).emailProfileServiceReadEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},emailProfileServiceSearchEmailProfile:function(t,r,i,a,s,o){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).emailProfileServiceSearchEmailProfile(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},emailProfileServiceTestEmailProfile:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).emailProfileServiceTestEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},emailProfileServiceUpdateEmailProfile:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).emailProfileServiceUpdateEmailProfile(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Ae=e,V.__extends(ke,Ae),ke.prototype.emailProfileServiceCreateEmailProfile=function(e,t){var n=this;return c(this.configuration).emailProfileServiceCreateEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ke.prototype.emailProfileServiceDeleteEmailProfile=function(e,t){var n=this;return c(this.configuration).emailProfileServiceDeleteEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ke.prototype.emailProfileServicePatchEmailProfile=function(e,t,n){var r=this;return c(this.configuration).emailProfileServicePatchEmailProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ke.prototype.emailProfileServiceReadEmailProfile=function(e,t){var n=this;return c(this.configuration).emailProfileServiceReadEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ke.prototype.emailProfileServiceSearchEmailProfile=function(e,t,n,r,i,a){var s=this;return c(this.configuration).emailProfileServiceSearchEmailProfile(e,t,n,r,i,a).then(function(e){return e(s.axios,s.basePath)})},ke.prototype.emailProfileServiceTestEmailProfile=function(e,t){var n=this;return c(this.configuration).emailProfileServiceTestEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},ke.prototype.emailProfileServiceUpdateEmailProfile=function(e,t,n){var r=this;return c(this.configuration).emailProfileServiceUpdateEmailProfile(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Ae,Pe=ke;function ke(){return null!==Ae&&Ae.apply(this,arguments)||this}function Te(d){var e=this;return{deleteFiles:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling deleteFiles.");return(t=z.parse("/storage/file",!0),d&&(n=d.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function Ke(i){return{deleteFiles:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Oe=e,V.__extends(Ue,Oe),Ue.prototype.deleteFiles=function(e,t){var n=this;return Ke(this.configuration).deleteFiles(e,t).then(function(e){return e(n.axios,n.basePath)})};var Oe,Ie=Ue;function Ue(){return null!==Oe&&Oe.apply(this,arguments)||this}function We(_){var e=this;return{createFileTranscript:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling createFileTranscript.");return(t=z.parse("/storage/transcript_file",!0),_&&(n=_.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},deleteFileTranscript:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling deleteFileTranscript.");return(t=z.parse("/storage/transcript_file",!0),_&&(n=_.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},getFileTranscriptPhrases:function(u,c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling getFileTranscriptPhrases.");return(t="/storage/transcript_file/{id}/phrases".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),_&&(n=_.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),d.headers),[2,{url:z.format(t),options:r}]}})})}}}function Xe(s){return{createFileTranscript:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,We(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteFileTranscript:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,We(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},getFileTranscriptPhrases:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,We(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}De=e,V.__extends(xe,De),xe.prototype.createFileTranscript=function(e,t){var n=this;return Xe(this.configuration).createFileTranscript(e,t).then(function(e){return e(n.axios,n.basePath)})},xe.prototype.deleteFileTranscript=function(e,t){var n=this;return Xe(this.configuration).deleteFileTranscript(e,t).then(function(e){return e(n.axios,n.basePath)})},xe.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 De,Ee=xe;function xe(){return null!==De&&De.apply(this,arguments)||this}function Ge(g){var e=this;return{createImportTemplate:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling createImportTemplate.");return(t=z.parse("/storage/import_templates",!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},deleteImportTemplate:function(u,c){return void 0===c&&(c={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling deleteImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__assign({method:"DELETE"},n),c),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=V.__assign(V.__assign(V.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),c.headers),[2,{url:z.format(t),options:r}]}})})},patchImportTemplate:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling patchImportTemplate.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling patchImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},readImportTemplate:function(u,c){return void 0===c&&(c={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling readImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),c),i={},a={},g&&g.apiKey)?"function"!=typeof g.apiKey?[3,2]:[4,g.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,g.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return t.query=V.__assign(V.__assign(V.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),c.headers),[2,{url:z.format(t),options:r}]}})})},searchImportTemplate:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/storage/import_templates",!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),p.headers),[2,{url:z.format(t),options:r}]}})})},updateImportTemplate:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling updateImportTemplate.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling updateImportTemplate.");return(t="/storage/import_templates/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function Qe(c){return{createImportTemplate:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Ge(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteImportTemplate:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Ge(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchImportTemplate:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Ge(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readImportTemplate:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Ge(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchImportTemplate:function(t,r,i,a,s,o,u){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Ge(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateImportTemplate:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Ge(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}je=e,V.__extends(Be,je),Be.prototype.createImportTemplate=function(e,t){var n=this;return Qe(this.configuration).createImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},Be.prototype.deleteImportTemplate=function(e,t){var n=this;return Qe(this.configuration).deleteImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},Be.prototype.patchImportTemplate=function(e,t,n){var r=this;return Qe(this.configuration).patchImportTemplate(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Be.prototype.readImportTemplate=function(e,t){var n=this;return Qe(this.configuration).readImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},Be.prototype.searchImportTemplate=function(e,t,n,r,i,a,s){var o=this;return Qe(this.configuration).searchImportTemplate(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Be.prototype.updateImportTemplate=function(e,t,n){var r=this;return Qe(this.configuration).updateImportTemplate(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var je,He=Be;function Be(){return null!==je&&je.apply(this,arguments)||this}function Me(b){var e=this;return{listServiceCreateList:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling listServiceCreateList.");return(t=z.parse("/call_center/list",!0),b&&(n=b.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},listServiceCreateListCommunication:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("listId","Required parameter listId was null or undefined when calling listServiceCreateListCommunication.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling listServiceCreateListCommunication.");return(t="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(c))),t=z.parse(t,!0),b&&(n=b.baseOptions),r=V.__assign(V.__assign({method:"POST"},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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},listServiceDeleteList:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling listServiceDeleteList.");return(t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),b&&(n=b.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},listServiceDeleteListCommunication:function(u,c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("listId","Required parameter listId was null or undefined when calling listServiceDeleteListCommunication.");if(null==c)throw new K("id","Required parameter id was null or undefined when calling listServiceDeleteListCommunication.");return(t="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),b&&(n=b.baseOptions),r=V.__assign(V.__assign({method:"DELETE"},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 void 0!==l&&(a.domain_id=l),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),d.headers),[2,{url:z.format(t),options:r}]}})})},listServiceReadList:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling listServiceReadList.");return(t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),b&&(n=b.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},listServiceReadListCommunication:function(u,c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("listId","Required parameter listId was null or undefined when calling listServiceReadListCommunication.");if(null==c)throw new K("id","Required parameter id was null or undefined when calling listServiceReadListCommunication.");return(t="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),b&&(n=b.baseOptions),r=V.__assign(V.__assign({method:"GET"},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 void 0!==l&&(a.domain_id=l),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),d.headers),[2,{url:z.format(t),options:r}]}})})},listServiceSearchList:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/call_center/list",!0),b&&(n=b.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),p),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),p.headers),[2,{url:z.format(t),options:r}]}})})},listServiceSearchListCommunication:function(u,c,l,d,_,h,p,g,f,v){return void 0===v&&(v={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("listId","Required parameter listId was null or undefined when calling listServiceSearchListCommunication.");return(t="/call_center/list/{list_id}/communication".replace("{list_id}",encodeURIComponent(String(u))),t=z.parse(t,!0),b&&(n=b.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),v),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.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),void 0!==g&&(a["expire_at.from"]=g),void 0!==f&&(a["expire_at.to"]=f),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),v.headers),[2,{url:z.format(t),options:r}]}})})},listServiceUpdateList:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling listServiceUpdateList.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling listServiceUpdateList.");return(t="/call_center/list/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),b&&(n=b.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},listServiceUpdateListCommunication:function(c,l,d,_){return void 0===_&&(_={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("listId","Required parameter listId was null or undefined when calling listServiceUpdateListCommunication.");if(null==l)throw new K("id","Required parameter id was null or undefined when calling listServiceUpdateListCommunication.");if(null==d)throw new K("body","Required parameter body was null or undefined when calling listServiceUpdateListCommunication.");return(t="/call_center/list/{list_id}/communication/{id}".replace("{list_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=z.parse(t,!0),b&&(n=b.baseOptions),r=V.__assign(V.__assign({method:"PUT"},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=V.__assign(V.__assign(V.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function f(_){return{listServiceCreateList:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Me(_).listServiceCreateList(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},listServiceCreateListCommunication:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Me(_).listServiceCreateListCommunication(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},listServiceDeleteList:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Me(_).listServiceDeleteList(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},listServiceDeleteListCommunication:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Me(_).listServiceDeleteListCommunication(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},listServiceReadList:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Me(_).listServiceReadList(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},listServiceReadListCommunication:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Me(_).listServiceReadListCommunication(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},listServiceSearchList:function(t,r,i,a,s,o,u){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Me(_).listServiceSearchList(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},listServiceSearchListCommunication:function(t,r,i,a,s,o,u,c,l,d){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Me(_).listServiceSearchListCommunication(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},listServiceUpdateList:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Me(_).listServiceUpdateList(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},listServiceUpdateListCommunication:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Me(_).listServiceUpdateListCommunication(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Le=e,V.__extends(Je,Le),Je.prototype.listServiceCreateList=function(e,t){var n=this;return f(this.configuration).listServiceCreateList(e,t).then(function(e){return e(n.axios,n.basePath)})},Je.prototype.listServiceCreateListCommunication=function(e,t,n){var r=this;return f(this.configuration).listServiceCreateListCommunication(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Je.prototype.listServiceDeleteList=function(e,t,n){var r=this;return f(this.configuration).listServiceDeleteList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Je.prototype.listServiceDeleteListCommunication=function(e,t,n,r){var i=this;return f(this.configuration).listServiceDeleteListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Je.prototype.listServiceReadList=function(e,t,n){var r=this;return f(this.configuration).listServiceReadList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Je.prototype.listServiceReadListCommunication=function(e,t,n,r){var i=this;return f(this.configuration).listServiceReadListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Je.prototype.listServiceSearchList=function(e,t,n,r,i,a,s){var o=this;return f(this.configuration).listServiceSearchList(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Je.prototype.listServiceSearchListCommunication=function(e,t,n,r,i,a,s,o,u,c){var l=this;return f(this.configuration).listServiceSearchListCommunication(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},Je.prototype.listServiceUpdateList=function(e,t,n){var r=this;return f(this.configuration).listServiceUpdateList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Je.prototype.listServiceUpdateListCommunication=function(e,t,n,r){var i=this;return f(this.configuration).listServiceUpdateListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var Le,Fe=Je;function Je(){return null!==Le&&Le.apply(this,arguments)||this}function Ne(g){var e=this;return{deleteMediaFile:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling deleteMediaFile.");return(t="/storage/media/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},readMediaFile:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling readMediaFile.");return(t="/storage/media/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},searchMediaFile:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/storage/media",!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),p.headers),[2,{url:z.format(t),options:r}]}})})}}}function Ve(c){return{deleteMediaFile:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readMediaFile:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchMediaFile:function(t,r,i,a,s,o,u){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ze=e,V.__extends(Ye,ze),Ye.prototype.deleteMediaFile=function(e,t,n){var r=this;return Ve(this.configuration).deleteMediaFile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ye.prototype.readMediaFile=function(e,t,n){var r=this;return Ve(this.configuration).readMediaFile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ye.prototype.searchMediaFile=function(e,t,n,r,i,a,s){var o=this;return Ve(this.configuration).searchMediaFile(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})};var ze,$e=Ye;function Ye(){return null!==ze&&ze.apply(this,arguments)||this}function C(T){var e=this;return{memberServiceAttemptCallback:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("attemptId","Required parameter attemptId was null or undefined when calling memberServiceAttemptCallback.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling memberServiceAttemptCallback.");return(t="/call_center/attempts/{attempt_id}".replace("{attempt_id}",encodeURIComponent(String(c))),t=z.parse(t,!0),T&&(n=T.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},memberServiceAttemptResult:function(c,l,d,_,h){return void 0===h&&(h={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("queueId","Required parameter queueId was null or undefined when calling memberServiceAttemptResult.");if(null==l)throw new K("memberId","Required parameter memberId was null or undefined when calling memberServiceAttemptResult.");if(null==d)throw new K("attemptId","Required parameter attemptId was null or undefined when calling memberServiceAttemptResult.");if(null==_)throw new K("body","Required parameter body was null or undefined when calling memberServiceAttemptResult.");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=z.parse(t,!0),T&&(n=T.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),h.headers),u="string"!=typeof _||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:z.format(t),options:r}]}})})},memberServiceAttemptsRenewalResult:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("attemptId","Required parameter attemptId was null or undefined when calling memberServiceAttemptsRenewalResult.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling memberServiceAttemptsRenewalResult.");return(t="/call_center/queues/attempts/{attempt_id}/renewal".replace("{attempt_id}",encodeURIComponent(String(c))),t=z.parse(t,!0),T&&(n=T.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},memberServiceCreateAttempt:function(c,l,d,_){return void 0===_&&(_={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("queueId","Required parameter queueId was null or undefined when calling memberServiceCreateAttempt.");if(null==l)throw new K("memberId","Required parameter memberId was null or undefined when calling memberServiceCreateAttempt.");if(null==d)throw new K("body","Required parameter body was null or undefined when calling memberServiceCreateAttempt.");return(t="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(c))).replace("{member_id}",encodeURIComponent(String(l))),t=z.parse(t,!0),T&&(n=T.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},memberServiceCreateMember:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("queueId","Required parameter queueId was null or undefined when calling memberServiceCreateMember.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling memberServiceCreateMember.");return(t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(c))),t=z.parse(t,!0),T&&(n=T.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},memberServiceCreateMemberBulk:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("queueId","Required parameter queueId was null or undefined when calling memberServiceCreateMemberBulk.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling memberServiceCreateMemberBulk.");return(t="/call_center/queues/{queue_id}/members/bulk".replace("{queue_id}",encodeURIComponent(String(c))),t=z.parse(t,!0),T&&(n=T.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},memberServiceDeleteMember:function(u,c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("queueId","Required parameter queueId was null or undefined when calling memberServiceDeleteMember.");if(null==c)throw new K("id","Required parameter id was null or undefined when calling memberServiceDeleteMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),T&&(n=T.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),d.headers),[2,{url:z.format(t),options:r}]}})})},memberServiceDeleteMembers:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("queueId","Required parameter queueId was null or undefined when calling memberServiceDeleteMembers.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling memberServiceDeleteMembers.");return(t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(c))),t=z.parse(t,!0),T&&(n=T.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},memberServicePatchMember:function(c,l,d,_){return void 0===_&&(_={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("queueId","Required parameter queueId was null or undefined when calling memberServicePatchMember.");if(null==l)throw new K("id","Required parameter id was null or undefined when calling memberServicePatchMember.");if(null==d)throw new K("body","Required parameter body was null or undefined when calling memberServicePatchMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=z.parse(t,!0),T&&(n=T.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},memberServiceReadMember:function(u,c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("queueId","Required parameter queueId was null or undefined when calling memberServiceReadMember.");if(null==c)throw new K("id","Required parameter id was null or undefined when calling memberServiceReadMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),T&&(n=T.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),d.headers),[2,{url:z.format(t),options:r}]}})})},memberServiceResetMembers:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("queueId","Required parameter queueId was null or undefined when calling memberServiceResetMembers.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling memberServiceResetMembers.");return(t="/call_center/queues/{queue_id}/members/reset".replace("{queue_id}",encodeURIComponent(String(c))),t=z.parse(t,!0),T&&(n=T.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},memberServiceSearchAttempts:function(u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A,P){return void 0===P&&(P={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/call_center/queues/attempts/active",!0),T&&(n=T.baseOptions),r=V.__assign(V.__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=_),void 0!==h&&(a["joined_at.from"]=h),void 0!==p&&(a["joined_at.to"]=p),g&&(a.id=g),f&&(a.queue_id=f),v&&(a.bucket_id=v),b&&(a.member_id=b),y&&(a.agent_id=y),S&&(a.result=S),void 0!==m&&(a["leaving_at.from"]=m),void 0!==w&&(a["leaving_at.to"]=w),void 0!==q&&(a["offering_at.from"]=q),void 0!==C&&(a["offering_at.to"]=C),void 0!==R&&(a["duration.from"]=R),void 0!==A&&(a["duration.to"]=A),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),P.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),P.headers),[2,{url:z.format(t),options:r}]}})})},memberServiceSearchAttemptsHistory:function(u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A,P){return void 0===P&&(P={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/call_center/queues/attempts/history",!0),T&&(n=T.baseOptions),r=V.__assign(V.__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=_),void 0!==h&&(a["joined_at.from"]=h),void 0!==p&&(a["joined_at.to"]=p),g&&(a.id=g),f&&(a.queue_id=f),v&&(a.bucket_id=v),b&&(a.member_id=b),y&&(a.agent_id=y),S&&(a.result=S),void 0!==m&&(a["leaving_at.from"]=m),void 0!==w&&(a["leaving_at.to"]=w),void 0!==q&&(a["offering_at.from"]=q),void 0!==C&&(a["offering_at.to"]=C),void 0!==R&&(a["duration.from"]=R),void 0!==A&&(a["duration.to"]=A),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),P.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),P.headers),[2,{url:z.format(t),options:r}]}})})},memberServiceSearchMemberAttempts:function(u,c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("queueId","Required parameter queueId was null or undefined when calling memberServiceSearchMemberAttempts.");if(null==c)throw new K("memberId","Required parameter memberId was null or undefined when calling memberServiceSearchMemberAttempts.");return(t="/call_center/queues/{queue_id}/members/{member_id}/attempts".replace("{queue_id}",encodeURIComponent(String(u))).replace("{member_id}",encodeURIComponent(String(c))),t=z.parse(t,!0),T&&(n=T.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),d.headers),[2,{url:z.format(t),options:r}]}})})},memberServiceSearchMemberInQueue:function(u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A,P,k){return void 0===k&&(k={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("queueId","Required parameter queueId was null or undefined when calling memberServiceSearchMemberInQueue.");return(t="/call_center/queues/{queue_id}/members".replace("{queue_id}",encodeURIComponent(String(u))),t=z.parse(t,!0),T&&(n=T.baseOptions),r=V.__assign(V.__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!==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),g&&(a.bucket_id=g),void 0!==f&&(a.destination=f),void 0!==v&&(a["created_at.from"]=v),void 0!==b&&(a["created_at.to"]=b),void 0!==y&&(a["offering_at.from"]=y),void 0!==S&&(a["offering_at.to"]=S),m&&(a.stop_cause=m),void 0!==w&&(a["priority.from"]=w),void 0!==q&&(a["priority.to"]=q),void 0!==C&&(a.name=C),void 0!==R&&(a["attempts.from"]=R),void 0!==A&&(a["attempts.to"]=A),P&&(a.agent_id=P),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),k.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),k.headers),[2,{url:z.format(t),options:r}]}})})},memberServiceSearchMembers:function(u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A,P,k){return void 0===k&&(k={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/call_center/members",!0),T&&(n=T.baseOptions),r=V.__assign(V.__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=_),h&&(a.id=h),p&&(a.queue_id=p),g&&(a.bucket_id=g),void 0!==f&&(a.destination=f),void 0!==v&&(a["created_at.from"]=v),void 0!==b&&(a["created_at.to"]=b),void 0!==y&&(a["offering_at.from"]=y),void 0!==S&&(a["offering_at.to"]=S),m&&(a.stop_cause=m),void 0!==w&&(a["priority.from"]=w),void 0!==q&&(a["priority.to"]=q),void 0!==C&&(a.name=C),void 0!==R&&(a["attempts.from"]=R),void 0!==A&&(a["attempts.to"]=A),P&&(a.agent_id=P),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),k.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),k.headers),[2,{url:z.format(t),options:r}]}})})},memberServiceUpdateMember:function(c,l,d,_){return void 0===_&&(_={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("queueId","Required parameter queueId was null or undefined when calling memberServiceUpdateMember.");if(null==l)throw new K("id","Required parameter id was null or undefined when calling memberServiceUpdateMember.");if(null==d)throw new K("body","Required parameter body was null or undefined when calling memberServiceUpdateMember.");return(t="/call_center/queues/{queue_id}/members/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=z.parse(t,!0),T&&(n=T.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function R(q){return{memberServiceAttemptCallback:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,C(q).memberServiceAttemptCallback(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},memberServiceAttemptResult:function(t,r,i,a,s){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,C(q).memberServiceAttemptResult(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},memberServiceAttemptsRenewalResult:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,C(q).memberServiceAttemptsRenewalResult(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},memberServiceCreateAttempt:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,C(q).memberServiceCreateAttempt(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},memberServiceCreateMember:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,C(q).memberServiceCreateMember(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},memberServiceCreateMemberBulk:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,C(q).memberServiceCreateMemberBulk(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},memberServiceDeleteMember:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,C(q).memberServiceDeleteMember(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},memberServiceDeleteMembers:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,C(q).memberServiceDeleteMembers(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},memberServicePatchMember:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,C(q).memberServicePatchMember(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},memberServiceReadMember:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,C(q).memberServiceReadMember(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},memberServiceResetMembers:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,C(q).memberServiceResetMembers(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},memberServiceSearchAttempts:function(t,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,C(q).memberServiceSearchAttempts(t,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},memberServiceSearchAttemptsHistory:function(t,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,C(q).memberServiceSearchAttemptsHistory(t,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},memberServiceSearchMemberAttempts:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,C(q).memberServiceSearchMemberAttempts(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},memberServiceSearchMemberInQueue:function(t,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m,w){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,C(q).memberServiceSearchMemberInQueue(t,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m,w)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},memberServiceSearchMembers:function(t,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m,w){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,C(q).memberServiceSearchMembers(t,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m,w)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},memberServiceUpdateMember:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,C(q).memberServiceUpdateMember(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Ze=e,V.__extends(r,Ze),r.prototype.memberServiceAttemptCallback=function(e,t,n){var r=this;return R(this.configuration).memberServiceAttemptCallback(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.memberServiceAttemptResult=function(e,t,n,r,i){var a=this;return R(this.configuration).memberServiceAttemptResult(e,t,n,r,i).then(function(e){return e(a.axios,a.basePath)})},r.prototype.memberServiceAttemptsRenewalResult=function(e,t,n){var r=this;return R(this.configuration).memberServiceAttemptsRenewalResult(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.memberServiceCreateAttempt=function(e,t,n,r){var i=this;return R(this.configuration).memberServiceCreateAttempt(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.memberServiceCreateMember=function(e,t,n){var r=this;return R(this.configuration).memberServiceCreateMember(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.memberServiceCreateMemberBulk=function(e,t,n){var r=this;return R(this.configuration).memberServiceCreateMemberBulk(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.memberServiceDeleteMember=function(e,t,n,r){var i=this;return R(this.configuration).memberServiceDeleteMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.memberServiceDeleteMembers=function(e,t,n){var r=this;return R(this.configuration).memberServiceDeleteMembers(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.memberServicePatchMember=function(e,t,n,r){var i=this;return R(this.configuration).memberServicePatchMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.memberServiceReadMember=function(e,t,n,r){var i=this;return R(this.configuration).memberServiceReadMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.memberServiceResetMembers=function(e,t,n){var r=this;return R(this.configuration).memberServiceResetMembers(e,t,n).then(function(e){return e(r.axios,r.basePath)})},r.prototype.memberServiceSearchAttempts=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y){var S=this;return R(this.configuration).memberServiceSearchAttempts(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y).then(function(e){return e(S.axios,S.basePath)})},r.prototype.memberServiceSearchAttemptsHistory=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y){var S=this;return R(this.configuration).memberServiceSearchAttemptsHistory(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y).then(function(e){return e(S.axios,S.basePath)})},r.prototype.memberServiceSearchMemberAttempts=function(e,t,n,r){var i=this;return R(this.configuration).memberServiceSearchMemberAttempts(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},r.prototype.memberServiceSearchMemberInQueue=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S){var m=this;return R(this.configuration).memberServiceSearchMemberInQueue(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S).then(function(e){return e(m.axios,m.basePath)})},r.prototype.memberServiceSearchMembers=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S){var m=this;return R(this.configuration).memberServiceSearchMembers(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S).then(function(e){return e(m.axios,m.basePath)})},r.prototype.memberServiceUpdateMember=function(e,t,n,r){var i=this;return R(this.configuration).memberServiceUpdateMember(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var Ze,et=r;function r(){return null!==Ze&&Ze.apply(this,arguments)||this}function tt(f){var e=this;return{outboundResourceGroupServiceCreateOutboundResourceGroup:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling outboundResourceGroupServiceCreateOutboundResourceGroup.");return(t=z.parse("/call_center/resource_group",!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},outboundResourceGroupServiceCreateOutboundResourceInGroup:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("groupId","Required parameter groupId was null or undefined when calling outboundResourceGroupServiceCreateOutboundResourceInGroup.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling outboundResourceGroupServiceCreateOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(c))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},outboundResourceGroupServiceDeleteOutboundResourceGroup:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling outboundResourceGroupServiceDeleteOutboundResourceGroup.");return(t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},outboundResourceGroupServiceDeleteOutboundResourceInGroup:function(u,c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("groupId","Required parameter groupId was null or undefined when calling outboundResourceGroupServiceDeleteOutboundResourceInGroup.");if(null==c)throw new K("id","Required parameter id was null or undefined when calling outboundResourceGroupServiceDeleteOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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 void 0!==l&&(a.domain_id=l),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),d.headers),[2,{url:z.format(t),options:r}]}})})},outboundResourceGroupServiceReadOutboundResourceGroup:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling outboundResourceGroupServiceReadOutboundResourceGroup.");return(t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},outboundResourceGroupServiceReadOutboundResourceInGroup:function(u,c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("groupId","Required parameter groupId was null or undefined when calling outboundResourceGroupServiceReadOutboundResourceInGroup.");if(null==c)throw new K("id","Required parameter id was null or undefined when calling outboundResourceGroupServiceReadOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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!==l&&(a.domain_id=l),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),d.headers),[2,{url:z.format(t),options:r}]}})})},outboundResourceGroupServiceSearchOutboundResourceGroup:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/call_center/resource_group",!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),p.headers),[2,{url:z.format(t),options:r}]}})})},outboundResourceGroupServiceSearchOutboundResourceInGroup:function(u,c,l,d,_,h,p,g){return void 0===g&&(g={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("groupId","Required parameter groupId was null or undefined when calling outboundResourceGroupServiceSearchOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource".replace("{group_id}",encodeURIComponent(String(u))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),g),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.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=V.__assign(V.__assign(V.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),g.headers),[2,{url:z.format(t),options:r}]}})})},outboundResourceGroupServiceUpdateOutboundResourceGroup:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling outboundResourceGroupServiceUpdateOutboundResourceGroup.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling outboundResourceGroupServiceUpdateOutboundResourceGroup.");return(t="/call_center/resource_group/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},outboundResourceGroupServiceUpdateOutboundResourceInGroup:function(c,l,d,_){return void 0===_&&(_={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("groupId","Required parameter groupId was null or undefined when calling outboundResourceGroupServiceUpdateOutboundResourceInGroup.");if(null==l)throw new K("id","Required parameter id was null or undefined when calling outboundResourceGroupServiceUpdateOutboundResourceInGroup.");if(null==d)throw new K("body","Required parameter body was null or undefined when calling outboundResourceGroupServiceUpdateOutboundResourceInGroup.");return(t="/call_center/resource_group/{group_id}/resource/{id}".replace("{group_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function v(l){return{outboundResourceGroupServiceCreateOutboundResourceGroup:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).outboundResourceGroupServiceCreateOutboundResourceGroup(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},outboundResourceGroupServiceCreateOutboundResourceInGroup:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).outboundResourceGroupServiceCreateOutboundResourceInGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},outboundResourceGroupServiceDeleteOutboundResourceGroup:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).outboundResourceGroupServiceDeleteOutboundResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},outboundResourceGroupServiceDeleteOutboundResourceInGroup:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).outboundResourceGroupServiceDeleteOutboundResourceInGroup(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},outboundResourceGroupServiceReadOutboundResourceGroup:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).outboundResourceGroupServiceReadOutboundResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},outboundResourceGroupServiceReadOutboundResourceInGroup:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).outboundResourceGroupServiceReadOutboundResourceInGroup(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},outboundResourceGroupServiceSearchOutboundResourceGroup:function(t,r,i,a,s,o,u){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).outboundResourceGroupServiceSearchOutboundResourceGroup(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},outboundResourceGroupServiceSearchOutboundResourceInGroup:function(t,r,i,a,s,o,u,c){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).outboundResourceGroupServiceSearchOutboundResourceInGroup(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},outboundResourceGroupServiceUpdateOutboundResourceGroup:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).outboundResourceGroupServiceUpdateOutboundResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},outboundResourceGroupServiceUpdateOutboundResourceInGroup:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).outboundResourceGroupServiceUpdateOutboundResourceInGroup(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}nt=e,V.__extends(it,nt),it.prototype.outboundResourceGroupServiceCreateOutboundResourceGroup=function(e,t){var n=this;return v(this.configuration).outboundResourceGroupServiceCreateOutboundResourceGroup(e,t).then(function(e){return e(n.axios,n.basePath)})},it.prototype.outboundResourceGroupServiceCreateOutboundResourceInGroup=function(e,t,n){var r=this;return v(this.configuration).outboundResourceGroupServiceCreateOutboundResourceInGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},it.prototype.outboundResourceGroupServiceDeleteOutboundResourceGroup=function(e,t,n){var r=this;return v(this.configuration).outboundResourceGroupServiceDeleteOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},it.prototype.outboundResourceGroupServiceDeleteOutboundResourceInGroup=function(e,t,n,r){var i=this;return v(this.configuration).outboundResourceGroupServiceDeleteOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},it.prototype.outboundResourceGroupServiceReadOutboundResourceGroup=function(e,t,n){var r=this;return v(this.configuration).outboundResourceGroupServiceReadOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},it.prototype.outboundResourceGroupServiceReadOutboundResourceInGroup=function(e,t,n,r){var i=this;return v(this.configuration).outboundResourceGroupServiceReadOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},it.prototype.outboundResourceGroupServiceSearchOutboundResourceGroup=function(e,t,n,r,i,a,s){var o=this;return v(this.configuration).outboundResourceGroupServiceSearchOutboundResourceGroup(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},it.prototype.outboundResourceGroupServiceSearchOutboundResourceInGroup=function(e,t,n,r,i,a,s,o){var u=this;return v(this.configuration).outboundResourceGroupServiceSearchOutboundResourceInGroup(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},it.prototype.outboundResourceGroupServiceUpdateOutboundResourceGroup=function(e,t,n){var r=this;return v(this.configuration).outboundResourceGroupServiceUpdateOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},it.prototype.outboundResourceGroupServiceUpdateOutboundResourceInGroup=function(e,t,n,r){var i=this;return v(this.configuration).outboundResourceGroupServiceUpdateOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var nt,rt=it;function it(){return null!==nt&&nt.apply(this,arguments)||this}function at(f){var e=this;return{outboundResourceServiceCreateOutboundResource:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling outboundResourceServiceCreateOutboundResource.");return(t=z.parse("/call_center/resources",!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},outboundResourceServiceCreateOutboundResourceDisplay:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("resourceId","Required parameter resourceId was null or undefined when calling outboundResourceServiceCreateOutboundResourceDisplay.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling outboundResourceServiceCreateOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(c))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},outboundResourceServiceDeleteOutboundResource:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling outboundResourceServiceDeleteOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},outboundResourceServiceDeleteOutboundResourceDisplay:function(u,c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("resourceId","Required parameter resourceId was null or undefined when calling outboundResourceServiceDeleteOutboundResourceDisplay.");if(null==c)throw new K("id","Required parameter id was null or undefined when calling outboundResourceServiceDeleteOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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 void 0!==l&&(a.domain_id=l),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),d.headers),[2,{url:z.format(t),options:r}]}})})},outboundResourceServicePatchOutboundResource:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling outboundResourceServicePatchOutboundResource.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling outboundResourceServicePatchOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},outboundResourceServiceReadOutboundResource:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling outboundResourceServiceReadOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},outboundResourceServiceReadOutboundResourceDisplay:function(u,c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("resourceId","Required parameter resourceId was null or undefined when calling outboundResourceServiceReadOutboundResourceDisplay.");if(null==c)throw new K("id","Required parameter id was null or undefined when calling outboundResourceServiceReadOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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!==l&&(a.domain_id=l),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),d.headers),[2,{url:z.format(t),options:r}]}})})},outboundResourceServiceSearchOutboundResource:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/call_center/resources",!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),p.headers),[2,{url:z.format(t),options:r}]}})})},outboundResourceServiceSearchOutboundResourceDisplay:function(u,c,l,d,_,h,p,g){return void 0===g&&(g={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("resourceId","Required parameter resourceId was null or undefined when calling outboundResourceServiceSearchOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display".replace("{resource_id}",encodeURIComponent(String(u))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),g),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.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=V.__assign(V.__assign(V.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),g.headers),[2,{url:z.format(t),options:r}]}})})},outboundResourceServiceUpdateOutboundResource:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling outboundResourceServiceUpdateOutboundResource.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling outboundResourceServiceUpdateOutboundResource.");return(t="/call_center/resources/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},outboundResourceServiceUpdateOutboundResourceDisplay:function(c,l,d,_){return void 0===_&&(_={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("resourceId","Required parameter resourceId was null or undefined when calling outboundResourceServiceUpdateOutboundResourceDisplay.");if(null==l)throw new K("id","Required parameter id was null or undefined when calling outboundResourceServiceUpdateOutboundResourceDisplay.");if(null==d)throw new K("body","Required parameter body was null or undefined when calling outboundResourceServiceUpdateOutboundResourceDisplay.");return(t="/call_center/resources/{resource_id}/display/{id}".replace("{resource_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function b(l){return{outboundResourceServiceCreateOutboundResource:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).outboundResourceServiceCreateOutboundResource(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},outboundResourceServiceCreateOutboundResourceDisplay:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).outboundResourceServiceCreateOutboundResourceDisplay(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},outboundResourceServiceDeleteOutboundResource:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).outboundResourceServiceDeleteOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},outboundResourceServiceDeleteOutboundResourceDisplay:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).outboundResourceServiceDeleteOutboundResourceDisplay(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},outboundResourceServicePatchOutboundResource:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).outboundResourceServicePatchOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},outboundResourceServiceReadOutboundResource:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).outboundResourceServiceReadOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},outboundResourceServiceReadOutboundResourceDisplay:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).outboundResourceServiceReadOutboundResourceDisplay(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},outboundResourceServiceSearchOutboundResource:function(t,r,i,a,s,o,u){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).outboundResourceServiceSearchOutboundResource(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},outboundResourceServiceSearchOutboundResourceDisplay:function(t,r,i,a,s,o,u,c){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).outboundResourceServiceSearchOutboundResourceDisplay(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},outboundResourceServiceUpdateOutboundResource:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).outboundResourceServiceUpdateOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},outboundResourceServiceUpdateOutboundResourceDisplay:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).outboundResourceServiceUpdateOutboundResourceDisplay(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}st=e,V.__extends(ut,st),ut.prototype.outboundResourceServiceCreateOutboundResource=function(e,t){var n=this;return b(this.configuration).outboundResourceServiceCreateOutboundResource(e,t).then(function(e){return e(n.axios,n.basePath)})},ut.prototype.outboundResourceServiceCreateOutboundResourceDisplay=function(e,t,n){var r=this;return b(this.configuration).outboundResourceServiceCreateOutboundResourceDisplay(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ut.prototype.outboundResourceServiceDeleteOutboundResource=function(e,t,n){var r=this;return b(this.configuration).outboundResourceServiceDeleteOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ut.prototype.outboundResourceServiceDeleteOutboundResourceDisplay=function(e,t,n,r){var i=this;return b(this.configuration).outboundResourceServiceDeleteOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},ut.prototype.outboundResourceServicePatchOutboundResource=function(e,t,n){var r=this;return b(this.configuration).outboundResourceServicePatchOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ut.prototype.outboundResourceServiceReadOutboundResource=function(e,t,n){var r=this;return b(this.configuration).outboundResourceServiceReadOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ut.prototype.outboundResourceServiceReadOutboundResourceDisplay=function(e,t,n,r){var i=this;return b(this.configuration).outboundResourceServiceReadOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},ut.prototype.outboundResourceServiceSearchOutboundResource=function(e,t,n,r,i,a,s){var o=this;return b(this.configuration).outboundResourceServiceSearchOutboundResource(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},ut.prototype.outboundResourceServiceSearchOutboundResourceDisplay=function(e,t,n,r,i,a,s,o){var u=this;return b(this.configuration).outboundResourceServiceSearchOutboundResourceDisplay(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},ut.prototype.outboundResourceServiceUpdateOutboundResource=function(e,t,n){var r=this;return b(this.configuration).outboundResourceServiceUpdateOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ut.prototype.outboundResourceServiceUpdateOutboundResourceDisplay=function(e,t,n,r){var i=this;return b(this.configuration).outboundResourceServiceUpdateOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var st,ot=ut;function ut(){return null!==st&&st.apply(this,arguments)||this}function ct(f){var e=this;return{queueBucketServiceCreateQueueBucket:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("queueId","Required parameter queueId was null or undefined when calling queueBucketServiceCreateQueueBucket.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling queueBucketServiceCreateQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(c))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},queueBucketServiceDeleteQueueBucket:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("queueId","Required parameter queueId was null or undefined when calling queueBucketServiceDeleteQueueBucket.");if(null==c)throw new K("id","Required parameter id was null or undefined when calling queueBucketServiceDeleteQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},queueBucketServicePatchQueueBucket:function(c,l,d,_){return void 0===_&&(_={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("queueId","Required parameter queueId was null or undefined when calling queueBucketServicePatchQueueBucket.");if(null==l)throw new K("id","Required parameter id was null or undefined when calling queueBucketServicePatchQueueBucket.");if(null==d)throw new K("body","Required parameter body was null or undefined when calling queueBucketServicePatchQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__assign({method:"PATCH"},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=V.__assign(V.__assign(V.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},queueBucketServiceReadQueueBucket:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("queueId","Required parameter queueId was null or undefined when calling queueBucketServiceReadQueueBucket.");if(null==c)throw new K("id","Required parameter id was null or undefined when calling queueBucketServiceReadQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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 t.query=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},queueBucketServiceSearchQueueBucket:function(u,c,l,d,_,h,p,g){return void 0===g&&(g={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("queueId","Required parameter queueId was null or undefined when calling queueBucketServiceSearchQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets".replace("{queue_id}",encodeURIComponent(String(u))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),g),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.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=V.__assign(V.__assign(V.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),g.headers),[2,{url:z.format(t),options:r}]}})})},queueBucketServiceUpdateQueueBucket:function(c,l,d,_){return void 0===_&&(_={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("queueId","Required parameter queueId was null or undefined when calling queueBucketServiceUpdateQueueBucket.");if(null==l)throw new K("id","Required parameter id was null or undefined when calling queueBucketServiceUpdateQueueBucket.");if(null==d)throw new K("body","Required parameter body was null or undefined when calling queueBucketServiceUpdateQueueBucket.");return(t="/call_center/queues/{queue_id}/buckets/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function lt(l){return{queueBucketServiceCreateQueueBucket:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,ct(l).queueBucketServiceCreateQueueBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueBucketServiceDeleteQueueBucket:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,ct(l).queueBucketServiceDeleteQueueBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueBucketServicePatchQueueBucket:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,ct(l).queueBucketServicePatchQueueBucket(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueBucketServiceReadQueueBucket:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,ct(l).queueBucketServiceReadQueueBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueBucketServiceSearchQueueBucket:function(t,r,i,a,s,o,u,c){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,ct(l).queueBucketServiceSearchQueueBucket(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueBucketServiceUpdateQueueBucket:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,ct(l).queueBucketServiceUpdateQueueBucket(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}dt=e,V.__extends(ht,dt),ht.prototype.queueBucketServiceCreateQueueBucket=function(e,t,n){var r=this;return lt(this.configuration).queueBucketServiceCreateQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ht.prototype.queueBucketServiceDeleteQueueBucket=function(e,t,n){var r=this;return lt(this.configuration).queueBucketServiceDeleteQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ht.prototype.queueBucketServicePatchQueueBucket=function(e,t,n,r){var i=this;return lt(this.configuration).queueBucketServicePatchQueueBucket(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},ht.prototype.queueBucketServiceReadQueueBucket=function(e,t,n){var r=this;return lt(this.configuration).queueBucketServiceReadQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ht.prototype.queueBucketServiceSearchQueueBucket=function(e,t,n,r,i,a,s,o){var u=this;return lt(this.configuration).queueBucketServiceSearchQueueBucket(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},ht.prototype.queueBucketServiceUpdateQueueBucket=function(e,t,n,r){var i=this;return lt(this.configuration).queueBucketServiceUpdateQueueBucket(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var dt,_t=ht;function ht(){return null!==dt&&dt.apply(this,arguments)||this}function pt(b){var e=this;return{queueHookServiceCreateQueueHook:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("queueId","Required parameter queueId was null or undefined when calling queueHookServiceCreateQueueHook.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling queueHookServiceCreateQueueHook.");return(t="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(c))),t=z.parse(t,!0),b&&(n=b.baseOptions),r=V.__assign(V.__assign({method:"POST"},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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},queueHookServiceDeleteQueueHook:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("queueId","Required parameter queueId was null or undefined when calling queueHookServiceDeleteQueueHook.");if(null==c)throw new K("id","Required parameter id was null or undefined when calling queueHookServiceDeleteQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),b&&(n=b.baseOptions),r=V.__assign(V.__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 t.query=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},queueHookServicePatchQueueHook:function(c,l,d,_){return void 0===_&&(_={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("queueId","Required parameter queueId was null or undefined when calling queueHookServicePatchQueueHook.");if(null==l)throw new K("id","Required parameter id was null or undefined when calling queueHookServicePatchQueueHook.");if(null==d)throw new K("body","Required parameter body was null or undefined when calling queueHookServicePatchQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=z.parse(t,!0),b&&(n=b.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},queueHookServiceReadQueueHook:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("queueId","Required parameter queueId was null or undefined when calling queueHookServiceReadQueueHook.");if(null==c)throw new K("id","Required parameter id was null or undefined when calling queueHookServiceReadQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),b&&(n=b.baseOptions),r=V.__assign(V.__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 t.query=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},queueHookServiceSearchQueueHook:function(u,c,l,d,_,h,p,g,f,v){return void 0===v&&(v={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("queueId","Required parameter queueId was null or undefined when calling queueHookServiceSearchQueueHook.");return(t="/call_center/queues/{queue_id}/hooks".replace("{queue_id}",encodeURIComponent(String(u))),t=z.parse(t,!0),b&&(n=b.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),v),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.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),g&&(a.schema_id=g),f&&(a.event=f),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),v.headers),[2,{url:z.format(t),options:r}]}})})},queueHookServiceUpdateQueueHook:function(c,l,d,_){return void 0===_&&(_={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("queueId","Required parameter queueId was null or undefined when calling queueHookServiceUpdateQueueHook.");if(null==l)throw new K("id","Required parameter id was null or undefined when calling queueHookServiceUpdateQueueHook.");if(null==d)throw new K("body","Required parameter body was null or undefined when calling queueHookServiceUpdateQueueHook.");return(t="/call_center/queues/{queue_id}/hooks/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=z.parse(t,!0),b&&(n=b.baseOptions),r=V.__assign(V.__assign({method:"PUT"},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=V.__assign(V.__assign(V.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function gt(_){return{queueHookServiceCreateQueueHook:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,pt(_).queueHookServiceCreateQueueHook(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueHookServiceDeleteQueueHook:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,pt(_).queueHookServiceDeleteQueueHook(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueHookServicePatchQueueHook:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,pt(_).queueHookServicePatchQueueHook(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueHookServiceReadQueueHook:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,pt(_).queueHookServiceReadQueueHook(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueHookServiceSearchQueueHook:function(t,r,i,a,s,o,u,c,l,d){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,pt(_).queueHookServiceSearchQueueHook(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueHookServiceUpdateQueueHook:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,pt(_).queueHookServiceUpdateQueueHook(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ft=e,V.__extends(bt,ft),bt.prototype.queueHookServiceCreateQueueHook=function(e,t,n){var r=this;return gt(this.configuration).queueHookServiceCreateQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},bt.prototype.queueHookServiceDeleteQueueHook=function(e,t,n){var r=this;return gt(this.configuration).queueHookServiceDeleteQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},bt.prototype.queueHookServicePatchQueueHook=function(e,t,n,r){var i=this;return gt(this.configuration).queueHookServicePatchQueueHook(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},bt.prototype.queueHookServiceReadQueueHook=function(e,t,n){var r=this;return gt(this.configuration).queueHookServiceReadQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},bt.prototype.queueHookServiceSearchQueueHook=function(e,t,n,r,i,a,s,o,u,c){var l=this;return gt(this.configuration).queueHookServiceSearchQueueHook(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},bt.prototype.queueHookServiceUpdateQueueHook=function(e,t,n,r){var i=this;return gt(this.configuration).queueHookServiceUpdateQueueHook(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var ft,vt=bt;function bt(){return null!==ft&&ft.apply(this,arguments)||this}function yt(f){var e=this;return{queueResourcesServiceCreateQueueResourceGroup:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("queueId","Required parameter queueId was null or undefined when calling queueResourcesServiceCreateQueueResourceGroup.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling queueResourcesServiceCreateQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(c))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},queueResourcesServiceDeleteQueueResourceGroup:function(u,c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("queueId","Required parameter queueId was null or undefined when calling queueResourcesServiceDeleteQueueResourceGroup.");if(null==c)throw new K("id","Required parameter id was null or undefined when calling queueResourcesServiceDeleteQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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 void 0!==l&&(a.domain_id=l),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),d.headers),[2,{url:z.format(t),options:r}]}})})},queueResourcesServiceReadQueueResourceGroup:function(u,c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("queueId","Required parameter queueId was null or undefined when calling queueResourcesServiceReadQueueResourceGroup.");if(null==c)throw new K("id","Required parameter id was null or undefined when calling queueResourcesServiceReadQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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!==l&&(a.domain_id=l),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),d.headers),[2,{url:z.format(t),options:r}]}})})},queueResourcesServiceSearchQueueResourceGroup:function(u,c,l,d,_,h,p,g){return void 0===g&&(g={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("queueId","Required parameter queueId was null or undefined when calling queueResourcesServiceSearchQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups".replace("{queue_id}",encodeURIComponent(String(u))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),g),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.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=V.__assign(V.__assign(V.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),g.headers),[2,{url:z.format(t),options:r}]}})})},queueResourcesServiceUpdateQueueResourceGroup:function(c,l,d,_){return void 0===_&&(_={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("queueId","Required parameter queueId was null or undefined when calling queueResourcesServiceUpdateQueueResourceGroup.");if(null==l)throw new K("id","Required parameter id was null or undefined when calling queueResourcesServiceUpdateQueueResourceGroup.");if(null==d)throw new K("body","Required parameter body was null or undefined when calling queueResourcesServiceUpdateQueueResourceGroup.");return(t="/call_center/queues/{queue_id}/resource_groups/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=z.parse(t,!0),f&&(n=f.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function St(l){return{queueResourcesServiceCreateQueueResourceGroup:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,yt(l).queueResourcesServiceCreateQueueResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueResourcesServiceDeleteQueueResourceGroup:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,yt(l).queueResourcesServiceDeleteQueueResourceGroup(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueResourcesServiceReadQueueResourceGroup:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,yt(l).queueResourcesServiceReadQueueResourceGroup(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueResourcesServiceSearchQueueResourceGroup:function(t,r,i,a,s,o,u,c){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,yt(l).queueResourcesServiceSearchQueueResourceGroup(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueResourcesServiceUpdateQueueResourceGroup:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,yt(l).queueResourcesServiceUpdateQueueResourceGroup(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}mt=e,V.__extends(qt,mt),qt.prototype.queueResourcesServiceCreateQueueResourceGroup=function(e,t,n){var r=this;return St(this.configuration).queueResourcesServiceCreateQueueResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},qt.prototype.queueResourcesServiceDeleteQueueResourceGroup=function(e,t,n,r){var i=this;return St(this.configuration).queueResourcesServiceDeleteQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},qt.prototype.queueResourcesServiceReadQueueResourceGroup=function(e,t,n,r){var i=this;return St(this.configuration).queueResourcesServiceReadQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},qt.prototype.queueResourcesServiceSearchQueueResourceGroup=function(e,t,n,r,i,a,s,o){var u=this;return St(this.configuration).queueResourcesServiceSearchQueueResourceGroup(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},qt.prototype.queueResourcesServiceUpdateQueueResourceGroup=function(e,t,n,r){var i=this;return St(this.configuration).queueResourcesServiceUpdateQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var mt,wt=qt;function qt(){return null!==mt&&mt.apply(this,arguments)||this}function Ct(S){var e=this;return{queueServiceCreateQueue:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling queueServiceCreateQueue.");return(t=z.parse("/call_center/queues",!0),S&&(n=S.baseOptions),r=V.__assign(V.__assign({method:"POST"},n),l),i={},a={},S&&S.apiKey)?"function"!=typeof S.apiKey?[3,2]:[4,S.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,S.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},queueServiceDeleteQueue:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling queueServiceDeleteQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),S&&(n=S.baseOptions),r=V.__assign(V.__assign({method:"DELETE"},n),l),i={},a={},S&&S.apiKey)?"function"!=typeof S.apiKey?[3,2]:[4,S.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,S.apiKey];case 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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},queueServicePatchQueue:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling queueServicePatchQueue.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling queueServicePatchQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),S&&(n=S.baseOptions),r=V.__assign(V.__assign({method:"PATCH"},n),d),i={},a={},S&&S.apiKey)?"function"!=typeof S.apiKey?[3,2]:[4,S.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,S.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},queueServiceReadQueue:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling queueServiceReadQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),S&&(n=S.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),l),i={},a={},S&&S.apiKey)?"function"!=typeof S.apiKey?[3,2]:[4,S.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,S.apiKey];case 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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},queueServiceSearchQueue:function(u,c,l,d,_,h,p,g){return void 0===g&&(g={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/call_center/queues",!0),S&&(n=S.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),g),i={},a={},S&&S.apiKey)?"function"!=typeof S.apiKey?[3,2]:[4,S.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,S.apiKey];case 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=V.__assign(V.__assign(V.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),g.headers),[2,{url:z.format(t),options:r}]}})})},queueServiceSearchQueueReportGeneral:function(u,c,l,d,_,h,p,g,f,v,b,y){return void 0===y&&(y={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/call_center/queues/reports/general",!0),S&&(n=S.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),y),i={},a={},S&&S.apiKey)?"function"!=typeof S.apiKey?[3,2]:[4,S.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,S.apiKey];case 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!==g&&(a.q=g),f&&(a.queue_id=f),v&&(a.team_id=v),b&&(a.type=b),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),y.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),y.headers),[2,{url:z.format(t),options:r}]}})})},queueServiceUpdateQueue:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling queueServiceUpdateQueue.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling queueServiceUpdateQueue.");return(t="/call_center/queues/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),S&&(n=S.baseOptions),r=V.__assign(V.__assign({method:"PUT"},n),d),i={},a={},S&&S.apiKey)?"function"!=typeof S.apiKey?[3,2]:[4,S.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,S.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function y(p){return{queueServiceCreateQueue:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Ct(p).queueServiceCreateQueue(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueServiceDeleteQueue:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Ct(p).queueServiceDeleteQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueServicePatchQueue:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Ct(p).queueServicePatchQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueServiceReadQueue:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Ct(p).queueServiceReadQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueServiceSearchQueue:function(t,r,i,a,s,o,u,c){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Ct(p).queueServiceSearchQueue(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueServiceSearchQueueReportGeneral:function(t,r,i,a,s,o,u,c,l,d,_,h){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Ct(p).queueServiceSearchQueueReportGeneral(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueServiceUpdateQueue:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Ct(p).queueServiceUpdateQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Rt=e,V.__extends(Pt,Rt),Pt.prototype.queueServiceCreateQueue=function(e,t){var n=this;return y(this.configuration).queueServiceCreateQueue(e,t).then(function(e){return e(n.axios,n.basePath)})},Pt.prototype.queueServiceDeleteQueue=function(e,t,n){var r=this;return y(this.configuration).queueServiceDeleteQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Pt.prototype.queueServicePatchQueue=function(e,t,n){var r=this;return y(this.configuration).queueServicePatchQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Pt.prototype.queueServiceReadQueue=function(e,t,n){var r=this;return y(this.configuration).queueServiceReadQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Pt.prototype.queueServiceSearchQueue=function(e,t,n,r,i,a,s,o){var u=this;return y(this.configuration).queueServiceSearchQueue(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},Pt.prototype.queueServiceSearchQueueReportGeneral=function(e,t,n,r,i,a,s,o,u,c,l,d){var _=this;return y(this.configuration).queueServiceSearchQueueReportGeneral(e,t,n,r,i,a,s,o,u,c,l,d).then(function(e){return e(_.axios,_.basePath)})},Pt.prototype.queueServiceUpdateQueue=function(e,t,n){var r=this;return y(this.configuration).queueServiceUpdateQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Rt,At=Pt;function Pt(){return null!==Rt&&Rt.apply(this,arguments)||this}function kt(w){var e=this;return{queueSkillServiceCreateQueueSkill:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("queueId","Required parameter queueId was null or undefined when calling queueSkillServiceCreateQueueSkill.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling queueSkillServiceCreateQueueSkill.");return(t="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(c))),t=z.parse(t,!0),w&&(n=w.baseOptions),r=V.__assign(V.__assign({method:"POST"},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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},queueSkillServiceDeleteQueueSkill:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("queueId","Required parameter queueId was null or undefined when calling queueSkillServiceDeleteQueueSkill.");if(null==c)throw new K("id","Required parameter id was null or undefined when calling queueSkillServiceDeleteQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),w&&(n=w.baseOptions),r=V.__assign(V.__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 t.query=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},queueSkillServicePatchQueueSkill:function(c,l,d,_){return void 0===_&&(_={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("queueId","Required parameter queueId was null or undefined when calling queueSkillServicePatchQueueSkill.");if(null==l)throw new K("id","Required parameter id was null or undefined when calling queueSkillServicePatchQueueSkill.");if(null==d)throw new K("body","Required parameter body was null or undefined when calling queueSkillServicePatchQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=z.parse(t,!0),w&&(n=w.baseOptions),r=V.__assign(V.__assign({method:"PATCH"},n),_),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=V.__assign(V.__assign(V.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},queueSkillServiceReadQueueSkill:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("queueId","Required parameter queueId was null or undefined when calling queueSkillServiceReadQueueSkill.");if(null==c)throw new K("id","Required parameter id was null or undefined when calling queueSkillServiceReadQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(u))).replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),w&&(n=w.baseOptions),r=V.__assign(V.__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 t.query=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},queueSkillServiceSearchQueueSkill:function(u,c,l,d,_,h,p,g,f,v,b,y,S,m){return void 0===m&&(m={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("queueId","Required parameter queueId was null or undefined when calling queueSkillServiceSearchQueueSkill.");return(t="/call_center/queues/{queue_id}/skills".replace("{queue_id}",encodeURIComponent(String(u))),t=z.parse(t,!0),w&&(n=w.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),m),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.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),g&&(a.skill_id=g),f&&(a.bucket_id=f),v&&(a.lvl=v),b&&(a.min_capacity=b),y&&(a.max_capacity=y),void 0!==S&&(a.enabled=S),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),m.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),m.headers),[2,{url:z.format(t),options:r}]}})})},queueSkillServiceUpdateQueueSkill:function(c,l,d,_){return void 0===_&&(_={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("queueId","Required parameter queueId was null or undefined when calling queueSkillServiceUpdateQueueSkill.");if(null==l)throw new K("id","Required parameter id was null or undefined when calling queueSkillServiceUpdateQueueSkill.");if(null==d)throw new K("body","Required parameter body was null or undefined when calling queueSkillServiceUpdateQueueSkill.");return(t="/call_center/queues/{queue_id}/skills/{id}".replace("{queue_id}",encodeURIComponent(String(c))).replace("{id}",encodeURIComponent(String(l))),t=z.parse(t,!0),w&&(n=w.baseOptions),r=V.__assign(V.__assign({method:"PUT"},n),_),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=V.__assign(V.__assign(V.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function Tt(f){return{queueSkillServiceCreateQueueSkill:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,kt(f).queueSkillServiceCreateQueueSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueSkillServiceDeleteQueueSkill:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,kt(f).queueSkillServiceDeleteQueueSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueSkillServicePatchQueueSkill:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,kt(f).queueSkillServicePatchQueueSkill(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueSkillServiceReadQueueSkill:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,kt(f).queueSkillServiceReadQueueSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueSkillServiceSearchQueueSkill:function(t,r,i,a,s,o,u,c,l,d,_,h,p,g){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,kt(f).queueSkillServiceSearchQueueSkill(t,r,i,a,s,o,u,c,l,d,_,h,p,g)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},queueSkillServiceUpdateQueueSkill:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,kt(f).queueSkillServiceUpdateQueueSkill(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Kt=e,V.__extends(It,Kt),It.prototype.queueSkillServiceCreateQueueSkill=function(e,t,n){var r=this;return Tt(this.configuration).queueSkillServiceCreateQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},It.prototype.queueSkillServiceDeleteQueueSkill=function(e,t,n){var r=this;return Tt(this.configuration).queueSkillServiceDeleteQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},It.prototype.queueSkillServicePatchQueueSkill=function(e,t,n,r){var i=this;return Tt(this.configuration).queueSkillServicePatchQueueSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},It.prototype.queueSkillServiceReadQueueSkill=function(e,t,n){var r=this;return Tt(this.configuration).queueSkillServiceReadQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},It.prototype.queueSkillServiceSearchQueueSkill=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){var p=this;return Tt(this.configuration).queueSkillServiceSearchQueueSkill(e,t,n,r,i,a,s,o,u,c,l,d,_,h).then(function(e){return e(p.axios,p.basePath)})},It.prototype.queueSkillServiceUpdateQueueSkill=function(e,t,n,r){var i=this;return Tt(this.configuration).queueSkillServiceUpdateQueueSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var Kt,Ot=It;function It(){return null!==Kt&&Kt.apply(this,arguments)||this}function Ut(b){var e=this;return{regionServiceCreateRegion:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling regionServiceCreateRegion.");return(t=z.parse("/regions",!0),b&&(n=b.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},regionServiceDeleteRegion:function(u,c){return void 0===c&&(c={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling regionServiceDeleteRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),b&&(n=b.baseOptions),r=V.__assign(V.__assign({method:"DELETE"},n),c),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 t.query=V.__assign(V.__assign(V.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),c.headers),[2,{url:z.format(t),options:r}]}})})},regionServicePatchRegion:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling regionServicePatchRegion.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling regionServicePatchRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),b&&(n=b.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},regionServiceReadRegion:function(u,c){return void 0===c&&(c={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling regionServiceReadRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),b&&(n=b.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),c),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 t.query=V.__assign(V.__assign(V.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),c.headers),[2,{url:z.format(t),options:r}]}})})},regionServiceSearchRegion:function(u,c,l,d,_,h,p,g,f,v){return void 0===v&&(v={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/regions",!0),b&&(n=b.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),v),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),void 0!==g&&(a.description=g),f&&(a.timezone_id=f),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),v.headers),[2,{url:z.format(t),options:r}]}})})},regionServiceUpdateRegion:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling regionServiceUpdateRegion.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling regionServiceUpdateRegion.");return(t="/regions/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),b&&(n=b.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function Wt(_){return{regionServiceCreateRegion:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Ut(_).regionServiceCreateRegion(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},regionServiceDeleteRegion:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Ut(_).regionServiceDeleteRegion(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},regionServicePatchRegion:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Ut(_).regionServicePatchRegion(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},regionServiceReadRegion:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Ut(_).regionServiceReadRegion(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},regionServiceSearchRegion:function(t,r,i,a,s,o,u,c,l,d){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Ut(_).regionServiceSearchRegion(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},regionServiceUpdateRegion:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Ut(_).regionServiceUpdateRegion(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Xt=e,V.__extends(Et,Xt),Et.prototype.regionServiceCreateRegion=function(e,t){var n=this;return Wt(this.configuration).regionServiceCreateRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},Et.prototype.regionServiceDeleteRegion=function(e,t){var n=this;return Wt(this.configuration).regionServiceDeleteRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},Et.prototype.regionServicePatchRegion=function(e,t,n){var r=this;return Wt(this.configuration).regionServicePatchRegion(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Et.prototype.regionServiceReadRegion=function(e,t){var n=this;return Wt(this.configuration).regionServiceReadRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},Et.prototype.regionServiceSearchRegion=function(e,t,n,r,i,a,s,o,u,c){var l=this;return Wt(this.configuration).regionServiceSearchRegion(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},Et.prototype.regionServiceUpdateRegion=function(e,t,n){var r=this;return Wt(this.configuration).regionServiceUpdateRegion(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Xt,Dt=Et;function Et(){return null!==Xt&&Xt.apply(this,arguments)||this}function xt(v){var e=this;return{routingChatPlanServiceCreateChatPlan:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling routingChatPlanServiceCreateChatPlan.");return(t=z.parse("/routing/outbound/chat",!0),v&&(n=v.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},routingChatPlanServiceDeleteChatPlan:function(u,c){return void 0===c&&(c={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling routingChatPlanServiceDeleteChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),v&&(n=v.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),c.headers),[2,{url:z.format(t),options:r}]}})})},routingChatPlanServicePatchChatPlan:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling routingChatPlanServicePatchChatPlan.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling routingChatPlanServicePatchChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),v&&(n=v.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},routingChatPlanServiceReadChatPlan:function(u,c){return void 0===c&&(c={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling routingChatPlanServiceReadChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),v&&(n=v.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),c.headers),[2,{url:z.format(t),options:r}]}})})},routingChatPlanServiceSearchChatPlan:function(u,c,l,d,_,h,p,g,f){return void 0===f&&(f={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/routing/outbound/chat",!0),v&&(n=v.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),f),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!==g&&(a.enabled=g),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),f.headers),[2,{url:z.format(t),options:r}]}})})},routingChatPlanServiceUpdateChatPlan:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling routingChatPlanServiceUpdateChatPlan.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling routingChatPlanServiceUpdateChatPlan.");return(t="/routing/outbound/chat/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),v&&(n=v.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function Gt(d){return{routingChatPlanServiceCreateChatPlan:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,xt(d).routingChatPlanServiceCreateChatPlan(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingChatPlanServiceDeleteChatPlan:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,xt(d).routingChatPlanServiceDeleteChatPlan(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingChatPlanServicePatchChatPlan:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,xt(d).routingChatPlanServicePatchChatPlan(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingChatPlanServiceReadChatPlan:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,xt(d).routingChatPlanServiceReadChatPlan(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingChatPlanServiceSearchChatPlan:function(t,r,i,a,s,o,u,c,l){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,xt(d).routingChatPlanServiceSearchChatPlan(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingChatPlanServiceUpdateChatPlan:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,xt(d).routingChatPlanServiceUpdateChatPlan(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Qt=e,V.__extends(Ht,Qt),Ht.prototype.routingChatPlanServiceCreateChatPlan=function(e,t){var n=this;return Gt(this.configuration).routingChatPlanServiceCreateChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},Ht.prototype.routingChatPlanServiceDeleteChatPlan=function(e,t){var n=this;return Gt(this.configuration).routingChatPlanServiceDeleteChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},Ht.prototype.routingChatPlanServicePatchChatPlan=function(e,t,n){var r=this;return Gt(this.configuration).routingChatPlanServicePatchChatPlan(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ht.prototype.routingChatPlanServiceReadChatPlan=function(e,t){var n=this;return Gt(this.configuration).routingChatPlanServiceReadChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},Ht.prototype.routingChatPlanServiceSearchChatPlan=function(e,t,n,r,i,a,s,o,u){var c=this;return Gt(this.configuration).routingChatPlanServiceSearchChatPlan(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},Ht.prototype.routingChatPlanServiceUpdateChatPlan=function(e,t,n){var r=this;return Gt(this.configuration).routingChatPlanServiceUpdateChatPlan(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Qt,jt=Ht;function Ht(){return null!==Qt&&Qt.apply(this,arguments)||this}function Bt(y){var e=this;return{routingOutboundCallServiceCreateRoutingOutboundCall:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling routingOutboundCallServiceCreateRoutingOutboundCall.");return(t=z.parse("/routing/outbound/calls",!0),y&&(n=y.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},routingOutboundCallServiceDeleteRoutingOutboundCall:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling routingOutboundCallServiceDeleteRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),y&&(n=y.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},routingOutboundCallServiceMovePositionRoutingOutboundCall:function(c,l,d,_){return void 0===_&&(_={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("fromId","Required parameter fromId was null or undefined when calling routingOutboundCallServiceMovePositionRoutingOutboundCall.");if(null==l)throw new K("toId","Required parameter toId was null or undefined when calling routingOutboundCallServiceMovePositionRoutingOutboundCall.");if(null==d)throw new K("body","Required parameter body was null or undefined when calling routingOutboundCallServiceMovePositionRoutingOutboundCall.");return(t="/routing/outbound/calls/{from_id}/to/{to_id}".replace("{from_id}",encodeURIComponent(String(c))).replace("{to_id}",encodeURIComponent(String(l))),t=z.parse(t,!0),y&&(n=y.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},routingOutboundCallServicePatchRoutingOutboundCall:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling routingOutboundCallServicePatchRoutingOutboundCall.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling routingOutboundCallServicePatchRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),y&&(n=y.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},routingOutboundCallServiceReadRoutingOutboundCall:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling routingOutboundCallServiceReadRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),y&&(n=y.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},routingOutboundCallServiceSearchRoutingOutboundCall:function(u,c,l,d,_,h,p,g,f,v,b){return void 0===b&&(b={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/routing/outbound/calls",!0),y&&(n=y.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),b),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),g&&(a.schema_id=g),void 0!==f&&(a.pattern=f),void 0!==v&&(a.description=v),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),b.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),b.headers),[2,{url:z.format(t),options:r}]}})})},routingOutboundCallServiceUpdateRoutingOutboundCall:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling routingOutboundCallServiceUpdateRoutingOutboundCall.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling routingOutboundCallServiceUpdateRoutingOutboundCall.");return(t="/routing/outbound/calls/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),y&&(n=y.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function S(h){return{routingOutboundCallServiceCreateRoutingOutboundCall:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).routingOutboundCallServiceCreateRoutingOutboundCall(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingOutboundCallServiceDeleteRoutingOutboundCall:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).routingOutboundCallServiceDeleteRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingOutboundCallServiceMovePositionRoutingOutboundCall:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).routingOutboundCallServiceMovePositionRoutingOutboundCall(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingOutboundCallServicePatchRoutingOutboundCall:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).routingOutboundCallServicePatchRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingOutboundCallServiceReadRoutingOutboundCall:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).routingOutboundCallServiceReadRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingOutboundCallServiceSearchRoutingOutboundCall:function(t,r,i,a,s,o,u,c,l,d,_){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).routingOutboundCallServiceSearchRoutingOutboundCall(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingOutboundCallServiceUpdateRoutingOutboundCall:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Bt(h).routingOutboundCallServiceUpdateRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Mt=e,V.__extends(Ft,Mt),Ft.prototype.routingOutboundCallServiceCreateRoutingOutboundCall=function(e,t){var n=this;return S(this.configuration).routingOutboundCallServiceCreateRoutingOutboundCall(e,t).then(function(e){return e(n.axios,n.basePath)})},Ft.prototype.routingOutboundCallServiceDeleteRoutingOutboundCall=function(e,t,n){var r=this;return S(this.configuration).routingOutboundCallServiceDeleteRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ft.prototype.routingOutboundCallServiceMovePositionRoutingOutboundCall=function(e,t,n,r){var i=this;return S(this.configuration).routingOutboundCallServiceMovePositionRoutingOutboundCall(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Ft.prototype.routingOutboundCallServicePatchRoutingOutboundCall=function(e,t,n){var r=this;return S(this.configuration).routingOutboundCallServicePatchRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ft.prototype.routingOutboundCallServiceReadRoutingOutboundCall=function(e,t,n){var r=this;return S(this.configuration).routingOutboundCallServiceReadRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ft.prototype.routingOutboundCallServiceSearchRoutingOutboundCall=function(e,t,n,r,i,a,s,o,u,c,l){var d=this;return S(this.configuration).routingOutboundCallServiceSearchRoutingOutboundCall(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(d.axios,d.basePath)})},Ft.prototype.routingOutboundCallServiceUpdateRoutingOutboundCall=function(e,t,n){var r=this;return S(this.configuration).routingOutboundCallServiceUpdateRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Mt,Lt=Ft;function Ft(){return null!==Mt&&Mt.apply(this,arguments)||this}function Jt(y){var e=this;return{routingSchemaServiceCreateRoutingSchema:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling routingSchemaServiceCreateRoutingSchema.");return(t=z.parse("/routing/schema",!0),y&&(n=y.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},routingSchemaServiceDeleteRoutingSchema:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling routingSchemaServiceDeleteRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),y&&(n=y.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},routingSchemaServicePatchRoutingSchema:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling routingSchemaServicePatchRoutingSchema.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling routingSchemaServicePatchRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),y&&(n=y.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},routingSchemaServiceReadRoutingSchema:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling routingSchemaServiceReadRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),y&&(n=y.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},routingSchemaServiceSearchRoutingSchema:function(u,c,l,d,_,h,p,g,f,v,b){return void 0===b&&(b={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/routing/schema",!0),y&&(n=y.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),b),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),g&&(a.type=g),void 0!==f&&(a.editor=f),v&&(a.tags=v),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),b.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),b.headers),[2,{url:z.format(t),options:r}]}})})},routingSchemaServiceSearchRoutingSchemaTags:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/routing/schema/tags",!0),y&&(n=y.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),p),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.type=h),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),p.headers),[2,{url:z.format(t),options:r}]}})})},routingSchemaServiceUpdateRoutingSchema:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling routingSchemaServiceUpdateRoutingSchema.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling routingSchemaServiceUpdateRoutingSchema.");return(t="/routing/schema/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),y&&(n=y.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function m(h){return{routingSchemaServiceCreateRoutingSchema:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(h).routingSchemaServiceCreateRoutingSchema(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingSchemaServiceDeleteRoutingSchema:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(h).routingSchemaServiceDeleteRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingSchemaServicePatchRoutingSchema:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(h).routingSchemaServicePatchRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingSchemaServiceReadRoutingSchema:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(h).routingSchemaServiceReadRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingSchemaServiceSearchRoutingSchema:function(t,r,i,a,s,o,u,c,l,d,_){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(h).routingSchemaServiceSearchRoutingSchema(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingSchemaServiceSearchRoutingSchemaTags:function(t,r,i,a,s,o,u){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(h).routingSchemaServiceSearchRoutingSchemaTags(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingSchemaServiceUpdateRoutingSchema:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(h).routingSchemaServiceUpdateRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Nt=e,V.__extends(zt,Nt),zt.prototype.routingSchemaServiceCreateRoutingSchema=function(e,t){var n=this;return m(this.configuration).routingSchemaServiceCreateRoutingSchema(e,t).then(function(e){return e(n.axios,n.basePath)})},zt.prototype.routingSchemaServiceDeleteRoutingSchema=function(e,t,n){var r=this;return m(this.configuration).routingSchemaServiceDeleteRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},zt.prototype.routingSchemaServicePatchRoutingSchema=function(e,t,n){var r=this;return m(this.configuration).routingSchemaServicePatchRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},zt.prototype.routingSchemaServiceReadRoutingSchema=function(e,t,n){var r=this;return m(this.configuration).routingSchemaServiceReadRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},zt.prototype.routingSchemaServiceSearchRoutingSchema=function(e,t,n,r,i,a,s,o,u,c,l){var d=this;return m(this.configuration).routingSchemaServiceSearchRoutingSchema(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(d.axios,d.basePath)})},zt.prototype.routingSchemaServiceSearchRoutingSchemaTags=function(e,t,n,r,i,a,s){var o=this;return m(this.configuration).routingSchemaServiceSearchRoutingSchemaTags(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},zt.prototype.routingSchemaServiceUpdateRoutingSchema=function(e,t,n){var r=this;return m(this.configuration).routingSchemaServiceUpdateRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Nt,Vt=zt;function zt(){return null!==Nt&&Nt.apply(this,arguments)||this}function $t(_){var e=this;return{routingVariableServiceCreateRoutingVariable:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling routingVariableServiceCreateRoutingVariable.");return(t=z.parse("/routing/variables",!0),_&&(n=_.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},routingVariableServiceDeleteRoutingVariable:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling routingVariableServiceDeleteRoutingVariable.");return(t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),_&&(n=_.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},routingVariableServiceReadRoutingVariable:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling routingVariableServiceReadRoutingVariable.");return(t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),_&&(n=_.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},routingVariableServiceSearchRoutingVariable:function(u,c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/routing/variables",!0),_&&(n=_.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),d.headers),[2,{url:z.format(t),options:r}]}})})},routingVariableServiceUpdateRoutingVariable:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling routingVariableServiceUpdateRoutingVariable.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling routingVariableServiceUpdateRoutingVariable.");return(t="/routing/variables/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),_&&(n=_.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function Yt(s){return{routingVariableServiceCreateRoutingVariable:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,$t(s).routingVariableServiceCreateRoutingVariable(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingVariableServiceDeleteRoutingVariable:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,$t(s).routingVariableServiceDeleteRoutingVariable(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingVariableServiceReadRoutingVariable:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,$t(s).routingVariableServiceReadRoutingVariable(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingVariableServiceSearchRoutingVariable:function(t,r,i,a){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,$t(s).routingVariableServiceSearchRoutingVariable(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},routingVariableServiceUpdateRoutingVariable:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,$t(s).routingVariableServiceUpdateRoutingVariable(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Zt=e,V.__extends(tn,Zt),tn.prototype.routingVariableServiceCreateRoutingVariable=function(e,t){var n=this;return Yt(this.configuration).routingVariableServiceCreateRoutingVariable(e,t).then(function(e){return e(n.axios,n.basePath)})},tn.prototype.routingVariableServiceDeleteRoutingVariable=function(e,t,n){var r=this;return Yt(this.configuration).routingVariableServiceDeleteRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},tn.prototype.routingVariableServiceReadRoutingVariable=function(e,t,n){var r=this;return Yt(this.configuration).routingVariableServiceReadRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},tn.prototype.routingVariableServiceSearchRoutingVariable=function(e,t,n,r){var i=this;return Yt(this.configuration).routingVariableServiceSearchRoutingVariable(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},tn.prototype.routingVariableServiceUpdateRoutingVariable=function(e,t,n){var r=this;return Yt(this.configuration).routingVariableServiceUpdateRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Zt,en=tn;function tn(){return null!==Zt&&Zt.apply(this,arguments)||this}function nn(g){var e=this;return{skillServiceCreateSkill:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling skillServiceCreateSkill.");return(t=z.parse("/call_center/skills",!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},skillServiceDeleteSkill:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling skillServiceDeleteSkill.");return(t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},skillServiceReadSkill:function(u,c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling skillServiceReadSkill.");return(t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),l.headers),[2,{url:z.format(t),options:r}]}})})},skillServiceSearchSkill:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/call_center/skills",!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),p.headers),[2,{url:z.format(t),options:r}]}})})},skillServiceUpdateSkill:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling skillServiceUpdateSkill.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling skillServiceUpdateSkill.");return(t="/call_center/skills/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),g&&(n=g.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function rn(c){return{skillServiceCreateSkill:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,nn(c).skillServiceCreateSkill(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},skillServiceDeleteSkill:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,nn(c).skillServiceDeleteSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},skillServiceReadSkill:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,nn(c).skillServiceReadSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},skillServiceSearchSkill:function(t,r,i,a,s,o,u){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,nn(c).skillServiceSearchSkill(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},skillServiceUpdateSkill:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,nn(c).skillServiceUpdateSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}an=e,V.__extends(on,an),on.prototype.skillServiceCreateSkill=function(e,t){var n=this;return rn(this.configuration).skillServiceCreateSkill(e,t).then(function(e){return e(n.axios,n.basePath)})},on.prototype.skillServiceDeleteSkill=function(e,t,n){var r=this;return rn(this.configuration).skillServiceDeleteSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},on.prototype.skillServiceReadSkill=function(e,t,n){var r=this;return rn(this.configuration).skillServiceReadSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},on.prototype.skillServiceSearchSkill=function(e,t,n,r,i,a,s){var o=this;return rn(this.configuration).skillServiceSearchSkill(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},on.prototype.skillServiceUpdateSkill=function(e,t,n){var r=this;return rn(this.configuration).skillServiceUpdateSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var an,sn=on;function on(){return null!==an&&an.apply(this,arguments)||this}function un(v){var e=this;return{triggerServiceCreateTrigger:function(c,l){return void 0===l&&(l={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("body","Required parameter body was null or undefined when calling triggerServiceCreateTrigger.");return(t=z.parse("/trigger",!0),v&&(n=v.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},triggerServiceCreateTriggerJob:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("triggerId","Required parameter triggerId was null or undefined when calling triggerServiceCreateTriggerJob.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling triggerServiceCreateTriggerJob.");return(t="/trigger/{trigger_id}/job".replace("{trigger_id}",encodeURIComponent(String(c))),t=z.parse(t,!0),v&&(n=v.baseOptions),r=V.__assign(V.__assign({method:"POST"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},triggerServiceDeleteTrigger:function(u,c){return void 0===c&&(c={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling triggerServiceDeleteTrigger.");return(t="/trigger/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),v&&(n=v.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),c.headers),[2,{url:z.format(t),options:r}]}})})},triggerServicePatchTrigger:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling triggerServicePatchTrigger.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling triggerServicePatchTrigger.");return(t="/trigger/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),v&&(n=v.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})},triggerServiceReadTrigger:function(u,c){return void 0===c&&(c={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("id","Required parameter id was null or undefined when calling triggerServiceReadTrigger.");return(t="/trigger/{id}".replace("{id}",encodeURIComponent(String(u))),t=z.parse(t,!0),v&&(n=v.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),c.headers),[2,{url:z.format(t),options:r}]}})})},triggerServiceSearchTrigger:function(u,c,l,d,_,h,p,g){return void 0===g&&(g={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:return(t=z.parse("/trigger",!0),v&&(n=v.baseOptions),r=V.__assign(V.__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.schema_id=p),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),g.headers),[2,{url:z.format(t),options:r}]}})})},triggerServiceSearchTriggerJob:function(u,c,l,d,_,h,p,g,f){return void 0===f&&(f={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("triggerId","Required parameter triggerId was null or undefined when calling triggerServiceSearchTriggerJob.");return(t="/trigger/{trigger_id}/job".replace("{trigger_id}",encodeURIComponent(String(u))),t=z.parse(t,!0),v&&(n=v.baseOptions),r=V.__assign(V.__assign({method:"GET"},n),f),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),void 0!==p&&(a["created_at.from"]=p),void 0!==g&&(a["created_at.to"]=g),t.query=V.__assign(V.__assign(V.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),f.headers),[2,{url:z.format(t),options:r}]}})})},triggerServiceUpdateTrigger:function(c,l,d){return void 0===d&&(d={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return V.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new K("id","Required parameter id was null or undefined when calling triggerServiceUpdateTrigger.");if(null==l)throw new K("body","Required parameter body was null or undefined when calling triggerServiceUpdateTrigger.");return(t="/trigger/{id}".replace("{id}",encodeURIComponent(String(c))),t=z.parse(t,!0),v&&(n=v.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__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:z.format(t),options:r}]}})})}}}function A(d){return{triggerServiceCreateTrigger:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,un(d).triggerServiceCreateTrigger(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},triggerServiceCreateTriggerJob:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,un(d).triggerServiceCreateTriggerJob(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},triggerServiceDeleteTrigger:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,un(d).triggerServiceDeleteTrigger(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},triggerServicePatchTrigger:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,un(d).triggerServicePatchTrigger(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},triggerServiceReadTrigger:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,un(d).triggerServiceReadTrigger(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},triggerServiceSearchTrigger:function(t,r,i,a,s,o,u,c){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,un(d).triggerServiceSearchTrigger(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},triggerServiceSearchTriggerJob:function(t,r,i,a,s,o,u,c,l){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,un(d).triggerServiceSearchTriggerJob(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=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},triggerServiceUpdateTrigger:function(t,r,i){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,un(d).triggerServiceUpdateTrigger(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}cn=e,V.__extends(dn,cn),dn.prototype.triggerServiceCreateTrigger=function(e,t){var n=this;return A(this.configuration).triggerServiceCreateTrigger(e,t).then(function(e){return e(n.axios,n.basePath)})},dn.prototype.triggerServiceCreateTriggerJob=function(e,t,n){var r=this;return A(this.configuration).triggerServiceCreateTriggerJob(e,t,n).then(function(e){return e(r.axios,r.basePath)})},dn.prototype.triggerServiceDeleteTrigger=function(e,t){var n=this;return A(this.configuration).triggerServiceDeleteTrigger(e,t).then(function(e){return e(n.axios,n.basePath)})},dn.prototype.triggerServicePatchTrigger=function(e,t,n){var r=this;return A(this.configuration).triggerServicePatchTrigger(e,t,n).then(function(e){return e(r.axios,r.basePath)})},dn.prototype.triggerServiceReadTrigger=function(e,t){var n=this;return A(this.configuration).triggerServiceReadTrigger(e,t).then(function(e){return e(n.axios,n.basePath)})},dn.prototype.triggerServiceSearchTrigger=function(e,t,n,r,i,a,s,o){var u=this;return A(this.configuration).triggerServiceSearchTrigger(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},dn.prototype.triggerServiceSearchTriggerJob=function(e,t,n,r,i,a,s,o,u){var c=this;return A(this.configuration).triggerServiceSearchTriggerJob(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},dn.prototype.triggerServiceUpdateTrigger=function(e,t,n){var r=this;return A(this.configuration).triggerServiceUpdateTrigger(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var cn,ln=dn;function dn(){return null!==cn&&cn.apply(this,arguments)||this}function _n(l){var e=this;return{userHelperServiceDefaultDeviceConfig:function(u,c){return void 0===c&&(c={}),V.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return V.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new K("type","Required parameter type was null or undefined when calling userHelperServiceDefaultDeviceConfig.");return(t="/user/device/config/{type}".replace("{type}",encodeURIComponent(String(u))),t=z.parse(t,!0),l&&(n=l.baseOptions),r=V.__assign(V.__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=V.__assign(V.__assign(V.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=V.__assign(V.__assign(V.__assign({},i),o),c.headers),[2,{url:z.format(t),options:r}]}})})}}}function hn(i){return{userHelperServiceDefaultDeviceConfig:function(t,r){return V.__awaiter(this,void 0,void 0,function(){var n;return V.__generator(this,function(e){switch(e.label){case 0:return[4,_n(i).userHelperServiceDefaultDeviceConfig(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=B),void 0===t&&(t=M);t=V.__assign(V.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}pn=e,V.__extends(fn,pn),fn.prototype.userHelperServiceDefaultDeviceConfig=function(e,t){var n=this;return hn(this.configuration).userHelperServiceDefaultDeviceConfig(e,t).then(function(e){return e(n.axios,n.basePath)})};var pn,gn=fn;function fn(){return null!==pn&&pn.apply(this,arguments)||this}function vn(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}(P=h.EngineBoolFilter||(h.EngineBoolFilter={})).Undefined="undefined",P.True="true",P.False="false",(P=h.EngineRoutingSchemaType||(h.EngineRoutingSchemaType={})).Default="default",P.Voice="voice",P.Chat="chat",P.Processing="processing",P.Service="service",(P=h.EngineTriggerJobState||(h.EngineTriggerJobState={})).Idle="idle",P.Active="active",P.Done="done",P.Error="error",(P=h.EngineTriggerType||(h.EngineTriggerType={})).DefaultTriggerType="default_trigger_type",P.Cron="cron",(P=h.HistoryFileJobHistoryFileJobAction||(h.HistoryFileJobHistoryFileJobAction={})).Undefined="undefined",P.STT="STT",P.Delete="delete",(P=h.HistoryFileJobHistoryFileJobState||(h.HistoryFileJobHistoryFileJobState={})).Idle="idle",P.Active="active",P.Finished="finished",P.Error="error",(h.ProtobufNullValue||(h.ProtobufNullValue={})).NULLVALUE="NULL_VALUE",(P=h.StorageImportSourceType||(h.StorageImportSourceType={})).DefaultSourceType="DefaultSourceType",P.Dialer="Dialer",(P=h.StorageProviderType||(h.StorageProviderType={})).DefaultProvider="DefaultProvider",P.Microsoft="Microsoft",(P=h.StorageServiceType||(h.StorageServiceType={})).DefaultService="DefaultService",P.STT="STT",P.TTS="TTS",(P=h.StorageUploadStatusCode||(h.StorageUploadStatusCode={})).Unknown="Unknown",P.Ok="Ok",P.Failed="Failed",yn.prototype.debug=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("debug",e,t)},yn.prototype.info=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("info",e,t)},yn.prototype.warn=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("warn",e,t)},yn.prototype.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("error",e,t)},yn.prototype.emitLogMessage=function(e,t,n){0<n.length?console[e].apply(console,V.__spreadArrays([t],n)):console[e](t)};var bn=yn;function yn(){}Object.defineProperty(mn.prototype,"id",{get:function(){return this.session.id},enumerable:!0,configurable:!0}),mn.prototype.getLocalMedia=function(){if(this.session.connection){var e=this.session.connection.getLocalStreams();if(e.length)return e}return[]},mn.prototype.getPeerMedia=function(){if(this.session.connection){var e=this.session.connection.getRemoteStreams();if(e.length)return e}return[]},mn.prototype.answer=function(e){var t=this;return new Promise(function(){t.session.answer(e)})};var Sn=mn;function mn(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")}wn=T.EventEmitter,V.__extends(a,wn),a.prototype.callOption=function(n){return void 0===n&&(n={}),V.__awaiter(this,void 0,void 0,function(){var t;return V.__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 V.__awaiter(this,void 0,void 0,function(){var t,n;return V.__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 V.__awaiter(this,void 0,void 0,function(){var t,n;return V.__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,V.__assign(V.__assign({},n),t))];case 2:return e.sent(),[2]}})})},a.prototype.register=function(n){return V.__awaiter(this,void 0,void 0,function(){var t,i=this;return V.__generator(this,function(e){return t=new O.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 O.UA(t)).on("newRTCSession",function(e){var t=e.session,n=t.id,r=new Sn(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 V.__awaiter(i,void 0,void 0,function(){return V.__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 V.__awaiter(this,void 0,void 0,function(){return V.__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 V.__awaiter(this,void 0,void 0,function(){var t=this;return V.__generator(this,function(e){return[2,new Promise(function(n,r){return V.__awaiter(t,void 0,void 0,function(){var t;return V.__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 V.__awaiter(this,void 0,void 0,function(){var t,n;return V.__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 V.__awaiter(this,void 0,void 0,function(){var t=this;return V.__generator(this,function(e){return[2,new Promise(function(n,r){return V.__awaiter(t,void 0,void 0,function(){var t;return V.__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 V.__awaiter(this,void 0,void 0,function(){return V.__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 wn,qn=a;function a(e,t){var n=wn.call(this)||this;return n.instanceId=e,n.type="webrtc",n.sessionCache=new Map,t?O.debug.enable("*"):O.debug.disable(),n.log=new bn,n.on("unregistered",function(){n.sessionCache.clear()}),n}(P=h.JobState||(h.JobState={})).Distribute="distribute",P.Offering="offering",P.Bridged="bridged",P.Missed="missed",P.Processing="processing",P.Closed="closed",P.Destroy="destroy",(P=Cn=Cn||{}).Call="call",P.Chat="chat",P.Task="task",Object.defineProperty(i.prototype,"queue",{get:function(){return{id:this.distribute.queue_id,name:this.distribute.queue_name}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"duration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"hasForm",{get:function(){return this.distribute.has_form||!1},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"channel",{get:function(){return this.distribute.channel},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"allowAccept",{get:function(){return this.channel===Cn.Task&&0===this.bridgedAt&&0===this.closedAt},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"allowDecline",{get:function(){return this.allowAccept},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"allowClose",{get:function(){return this.channel===Cn.Task&&0===this.closedAt&&0<this.bridgedAt},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"memberId",{get:function(){return this.distribute.member_id},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"queueId",{get:function(){return this.distribute.queue_id},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"hasReporting",{get:function(){return this.distribute.has_reporting},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"allowReporting",{get:function(){return this.hasReporting&&0<this.bridgedAt},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"agentChannelId",{get:function(){return this.distribute.agent_channel_id},enumerable:!0,configurable:!0}),i.prototype.setState=function(e){this.state=e},i.prototype.setAnswered=function(e){this.answeredAt=e,this.lastStatusChange=Date.now()},i.prototype.setOffering=function(e){this.offeringAt=e.timestamp},i.prototype.setBridged=function(e){this.bridgedAt=e.timestamp,this.lastStatusChange=Date.now(),e.form&&(this.form=e.form)},i.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},i.prototype.setClosed=function(e){this.stopAt=e,this.state=h.JobState.Closed},i.prototype.setTransferred=function(e){this.distribute=e,this.history.push(e)},i.prototype.setMissed=function(){this.state=h.JobState.Missed},Object.defineProperty(i.prototype,"processingTimeoutAt",{get:function(){return this._processing&&this._processing.timeout?this._processing.timeout:null},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"processingSec",{get:function(){return this._processing&&this._processing.sec?this._processing.sec:null},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"attempt",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(i.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(i.prototype,"isMember",{get:function(){return!!this.memberId},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"displayNumber",{get:function(){return this.communication.destination},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"displayName",{get:function(){return this.distribute.member_name||null},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"display",{get:function(){return this.displayName+" ("+this.displayNumber+")"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"renewalSec",{get:function(){return this._processing&&this._processing.renewal_sec?this._processing.renewal_sec:null},enumerable:!0,configurable:!0}),i.prototype.accept=function(){return V.__awaiter(this,void 0,void 0,function(){return V.__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})]})})},i.prototype.close=function(){return V.__awaiter(this,void 0,void 0,function(){return V.__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})]})})},i.prototype.decline=function(){return V.__awaiter(this,void 0,void 0,function(){return V.__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})]})})},i.prototype.reporting=function(n){return V.__awaiter(this,void 0,void 0,function(){var t;return V.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.request("cc_reporting",V.__assign({attempt_id:this.id},n))];case 1:return t=e.sent(),this.reportedAt=Date.now(),[2,t]}})})},i.prototype.renew=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.client.request("cc_renewal",{attempt_id:this.id,renewal_sec:t||this.processingSec})]})})},i.prototype.formAction=function(t,n){return V.__awaiter(this,void 0,void 0,function(){return V.__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 Cn,Rn=i;function i(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]}(P=h.AgentStatus||(h.AgentStatus={})).Online="online",P.Offline="offline",P.Pause="pause",P.BreakOut="break_out",(P=h.ChannelState||(h.ChannelState={})).Waiting="waiting",P.Distribute="distribute",P.Offering="offering",P.Answered="answered",P.Active="active",P.Bridged="bridged",P.Hold="hold",P.Missed="missed",P.WrapTime="wrap_time",P.Processing="processing",P.Transfer="transfer",P.Form="form",(P=h.ChannelType||(h.ChannelType={})).Call="call",P.Email="email",P.Chat="chat",P.Job="task";Object.defineProperty(s.prototype,"agentId",{get:function(){return this.info.agent_id},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"onDemand",{get:function(){return this.info.on_demand},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"status",{get:function(){return this.info.status},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"statusPayload",{get:function(){return this.info.status_payload},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"isAdmin",{get:function(){return this.info.is_admin},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"isSupervisor",{get:function(){return this.info.is_supervisor},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"team",{get:function(){return this.info.team},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"supervisor",{get:function(){return this.info.supervisor},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"auditor",{get:function(){return this.info.auditor},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"channels",{get:function(){return[this._channel]},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"channel",{get:function(){return this._channel},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"stateDuration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!0,configurable:!0}),s.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 Rn(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},s.prototype.online=function(t,n){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.client.agentSetOnline(this.agentId,t,n)]})})},s.prototype.waiting=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.client.agentSetWaiting(this.agentId,t)]})})},s.prototype.pause=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.client.agentSetPause(this.agentId,t)]})})},s.prototype.offline=function(){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.client.agentSetOffline(this.agentId)]})})},s.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()},s.prototype.directMember=function(t,n){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.client.request("cc_member_direct",{agent_id:this.agentId,member_id:t,communication_id:n})]})})},s.prototype.offlineMembers=function(n,r,i){return V.__awaiter(this,void 0,void 0,function(){var t;return V.__generator(this,function(e){switch(e.label){case 0:return[4,(t=this).client.request("cc_fetch_offline_members",{agent_id:this.agentId,page:r,q:n,per_page:i})];case 1:return t._listOfflineMembers=e.sent(),[2,this._listOfflineMembers]}})})},s.prototype.hasTask=function(e){return this.task.has(e.id)},s.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},s.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 An=s;function s(e,t){this.client=e,this.info=t,this.task=new Map,this._channel=t.channels[0],this._listOfflineMembers=null,this.lastStatusChange=Date.now()-1e3*this.info.status_duration}(P=h.CallReportingStatus||(h.CallReportingStatus={})).Abandoned="abandoned",P.Cancel="cancel",P.Success="success",P.Failed="failed",P.Missed="missed",P.Timeout="timeout",P.Endless="endless",P.Transferred="transferred",(P=h.CallActions||(h.CallActions={})).Ringing="ringing",P.Active="active",P.Bridge="bridge",P.Hold="hold",P.DTMF="dtmf",P.Voice="voice",P.Silence="silence",P.Execute="execute",P.Update="update",P.Hangup="hangup",P.Reporting="reporting",P.PeerStream="peerStream",P.LocalStream="localStream",P.Destroy="destroy",(P=h.CallDirection||(h.CallDirection={})).Inbound="inbound",P.Outbound="outbound";o.prototype.setState=function(e){this.state=e.event},o.prototype.setSip=function(e){e&&!this.sip&&(this.sip=e,this.localStreams=e.getLocalMedia(),this.peerStreams=e.getPeerMedia())},Object.defineProperty(o.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(o.prototype,"allowDtmf",{get:function(){return 0<this.answeredAt&&this.allowHangup},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"allowHangup",{get:function(){return 0===this.hangupAt},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"allowHold",{get:function(){return 0===this.hangupAt&&("active"===this.state||"bridge"===this.state)},enumerable:!0,configurable:!0}),Object.defineProperty(o.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(o.prototype,"allowUnHold",{get:function(){return 0===this.hangupAt&&"hold"===this.state},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"memberCommunication",{get:function(){return this.task?this.task.communication:null},enumerable:!0,configurable:!0}),o.prototype.getMember=function(e){return V.__awaiter(this,void 0,void 0,function(){return V.__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(o.prototype,"isMember",{get:function(){return!(!this.task||!this.task.isMember)},enumerable:!0,configurable:!0}),o.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)},o.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)},o.prototype.setHold=function(e){this.setState(e)},o.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},o.prototype.setPeerStreams=function(e){this.peerStreams=e||[]},o.prototype.setLocalStreams=function(e){this.localStreams=e||[]},o.prototype.setVoice=function(){this.voice=!0},o.prototype.setSilence=function(){this.voice=!1},o.prototype.setExecute=function(e){this.applications.push(e.application)},o.prototype.addDigit=function(e){this.digits.push(e.digit)},o.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(o.prototype,"allowReporting",{get:function(){return 0<this.answeredAt&&this.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"hasReporting",{get:function(){return!!this.task&&this.task.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"display",{get:function(){return this.displayNumber+" ("+this.displayName+")"},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"muted",{get:function(){return this._muted},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isHold",{get:function(){return this.state===h.CallActions.Hold},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"allowInboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"allowOutboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"active",{get:function(){return 0===this.hangupAt},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"displayNumber",{get:function(){return"inbound"===this.direction?this.from.number:this.to?this.to.number:this.destination},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"displayName",{get:function(){return"inbound"===this.direction?this.from.name:this.to?this.to.name:this.destination},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"autoAnswer",{get:function(){return this.queue&&"offline"===this.queue.queue_type||this.params&&!0===this.params.autoAnswer},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"attempt",{get:function(){return this.task},enumerable:!0,configurable:!0}),o.prototype.answer=function(n){return V.__awaiter(this,void 0,void 0,function(){var t;return V.__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]}})})},o.prototype.answerDelay=function(t,e){var n=this;this.autoAnswered||(this.autoAnswered=!0,setTimeout(function(){return V.__awaiter(n,void 0,void 0,function(){return V.__generator(this,function(e){switch(e.label){case 0:return[4,this.answer(t)];case 1:return e.sent(),[2]}})})},e))},o.prototype.hangup=function(n){return V.__awaiter(this,void 0,void 0,function(){var t;return V.__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})]})})},o.prototype.eavesdrop=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return t.id=this.id,[2,this.client.request("call_eavesdrop",t)]})})},o.prototype.toggleHold=function(){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return this.state===h.CallActions.Hold?[2,this.unHold()]:[2,this.hold()]})})},o.prototype.hold=function(){return V.__awaiter(this,void 0,void 0,function(){return V.__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})]})})},o.prototype.unHold=function(){return V.__awaiter(this,void 0,void 0,function(){return V.__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})]})})},o.prototype.sendDTMF=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.client.request("call_dtmf",{id:this.id,app_id:this.appId,dtmf:t})]})})},o.prototype.blindTransfer=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.client.request("call_blind_transfer",{id:this.id,app_id:this.appId,destination:t})]})})},o.prototype.mute=function(n){return void 0===n&&(n=!1),V.__awaiter(this,void 0,void 0,function(){var t;return V.__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]}})})},o.prototype.bridgeTo=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__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})]})})},o.prototype.reporting=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){if(this.task)return[2,this.task.reporting(t)];throw new Error("this call not in queue")})})},o.prototype.renew=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){if(this.task)return[2,this.task.renew(t)];throw new Error("this conversation not in queue")})})},o.prototype.callToUser=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__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 Pn=o;function o(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)}(P=h.DeclineCause||(h.DeclineCause={})).Timeout="TIMEOUT",P.Busy="BUSY",P.Cancel="CANCEL",(P=h.ChatActions||(h.ChatActions={})).Message="message",P.UserInvite="user_invite",P.Invite="invite_conversation",P.Joined="join_conversation",P.Close="close_conversation",P.Leave="leave_conversation",P.Decline="decline_invite",P.Update="update_channel",P.Destroy="destroy",(P=h.ConversationState||(h.ConversationState={})).Init="init",P.Invite="invite",P.Active="active",P.Pending="pending",P.Closed="closed",u.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)})},u.prototype.setAnswered=function(e,t,n){this.state=h.ConversationState.Active,this.answeredAt=t,this.channelId=e,this.member=Tn(n),this.inviteId=null},u.prototype.setClosed=function(e){this.state=h.ConversationState.Closed,this.closedAt=e},u.prototype.setDecline=function(e){this.setClosed(e.timestamp),this._cause=e.cause||null},u.prototype.setLeave=function(e){this.setClosed(e.timestamp)},Object.defineProperty(u.prototype,"id",{get:function(){return this.channelId||this.inviteId||this.conversationId},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"cause",{get:function(){return this._cause},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"messages",{get:function(){return this.getMessages()},enumerable:!0,configurable:!0}),u.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})},u.prototype.next=function(){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){throw new Error("TODO")})})},u.prototype.pagination=function(e,t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){throw new Error("TODO")})})},u.prototype.newMessage=function(e){this._messages.push(e)},Object.defineProperty(u.prototype,"allowDecline",{get:function(){return!!this.inviteId},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"allowJoin",{get:function(){return!!this.inviteId},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"allowLeave",{get:function(){return!(!this.channelId||0!==this.closedAt&&this.hasReporting)},enumerable:!0,configurable:!0}),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._hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(u.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(u.prototype,"attempt",{get:function(){return this.task},enumerable:!0,configurable:!0}),u.prototype.decline=function(n){return V.__awaiter(this,void 0,void 0,function(){var t;return V.__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")})})},u.prototype.join=function(){return V.__awaiter(this,void 0,void 0,function(){return V.__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")})})},u.prototype.close=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__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")})})},u.prototype.leave=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__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")})})},u.prototype.sendText=function(r){return V.__awaiter(this,void 0,void 0,function(){var t,n;return V.__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]}})})},u.prototype.sendFile=function(n,r){return V.__awaiter(this,void 0,void 0,function(){var t;return V.__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})]}})})},u.prototype.send=function(t,n){return V.__awaiter(this,void 0,void 0,function(){return V.__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")})})},u.prototype.addToChat=function(t,n){return V.__awaiter(this,void 0,void 0,function(){return V.__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})]})})},u.prototype.startChat=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.client.request("start_chat",{user_id:t})]})})},u.prototype.updateChannel=function(){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.client.request("update_channel_chat",{channel_id:this.channelId})]})})},u.prototype.reporting=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){if(this.task)return[2,this.task.reporting(t)];throw new Error("this conversation not in queue")})})},u.prototype.renew=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){if(this.task)return[2,this.task.renew(t)];throw new Error("this conversation not in queue")})})},u.prototype.transferToPlan=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.client.request("blind_transfer_chat",{conversation_id:this.conversationId,channel_id:this.channelId,plan_id:t})]})})},u.prototype.transferToUser=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.client.request("transfer_user_chat",{conversation_id:this.conversationId,channel_id:this.channelId,user_id:t})]})})},u.prototype.sendMessageTextChunk=function(e){return this.client.request("send_text_chat",{channel_id:this.channelId,conversation_id:this.conversationId,text:e})},u.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 kn=u;function u(e,t,n,r,i,a){for(var s in this.client=e,this.conversationId=t,this.title=n,this.channelId=null,this.createdAt=Date.now(),this.answeredAt=0,this.updatedAt=0,this.invitedAt=0,this.closedAt=0,this.task=null,this.data=null,this.queue=null,this.members=(r||[]).map(Tn),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.queue={id:+a.cc_queue_id||null,name:a.cc_queue_name||""},this.task=this.client.agent.task.get(+a.cc_attempt_id)||null)}function Tn(e){return e.messenger=e.type,e}(h.TypeErrors||(h.TypeErrors={})).RolePermission="api.context.permissions.app_error";Kn=Error,V.__extends(In,Kn),In.id="device_not_found";var Kn,On=In;function In(e){e=Kn.call(this,e)||this;return e.id=In.id,e}Un=Error,V.__extends(Xn,Un),Xn.id="device_not_allow";var Un,Wn=Xn;function Xn(e){e=Un.call(this,e)||this;return e.id=Xn.id,e}Dn=Error,V.__extends(Gn,Dn),Gn.id="api.context.permissions.app_error";var Dn,En,xn=Gn;function Gn(e){e=Dn.call(this,e)||this;return e.id=Gn.id,e}(En=En||{}).HideMember="hide_member";Qn=T.EventEmitter,V.__extends(Hn,Qn),Hn.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()}},Hn.prototype.send=function(e){return this.socket.send(JSON.stringify(e)),null},Hn.prototype.close=function(e){this.socket.close(e||1e3),delete this.socket},Hn.prototype.onOpen=function(){this.emit("open")},Hn.prototype.onClose=function(e){this.emit("close",e),this.off("*")},Hn.prototype.onMessage=function(e){"\0\0\0\0"!==e&&(e=JSON.parse(e),this.emit("message",e))};var Qn,jn=Hn;function Hn(e){var t=Qn.call(this)||this;return t.host=e,t}var Bn,Mn,Ln="call",Fn="chat",Jn="user_state",Nn="agent_status",P=((P=Bn=Bn||{}).NotFoundError="NotFoundError",P.NotAllowedError="NotAllowedError",(P=h.Response||(h.Response={})).STATUS_FAIL="FAIL",P.STATUS_OK="OK",Mn=T.EventEmitter,V.__extends(k,Mn),k.prototype.connect=function(){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){switch(e.label){case 0:return[4,this.connectToSocket()];case 1:return e.sent(),[2]}})})},k.prototype.disconnect=function(){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return this.socket.close(),[2]})})},k.prototype.subscribeCall=function(s,o){return V.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a;return V.__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(Ln,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 Pn(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 Rn(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]}})})},k.prototype.subscribeChat=function(s,o){return V.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a;return V.__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(Fn,s),t&&t.items)for(n=0,r=t.items;n<r.length;n++){if(i=r[n],a=i.messages.reverse(),(a=new kn(this,i.id,i.title,i.members,a,i.variables)).createdAt=i.created_at,a.closedAt=i.closed_at,i.task&&(a.task=new Rn(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]}})})},k.prototype.subscribeUsersStatus=function(n,r){return V.__awaiter(this,void 0,void 0,function(){var t;return V.__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]}})})},k.prototype.subscribeAgentsStatus=function(n,r){return V.__awaiter(this,void 0,void 0,function(){var t;return V.__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(Nn,n),[2,t]}})})},k.prototype.subscribeTask=function(e){this.eventHandler.on("task",e)},k.prototype.subscribeJob=function(e){this.eventHandler.on("job",e)},k.prototype.unSubscribe=function(t,e,n){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.request("un_subscribe_"+t,n)]})})},k.prototype.destroy=function(){return V.__awaiter(this,void 0,void 0,function(){return V.__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]}})})},k.prototype.allCall=function(){return Array.from(this.callStore.values())},k.prototype.allConversations=function(){return Array.from(this.conversationStore.values())},k.prototype.allTask=function(){return this.agent?Array.from(this.agent.task.values()):[]},k.prototype.allJob=function(){return this.allTask().filter(Vn)},k.prototype.callById=function(e){if(this.callStore.has(e))return this.callStore.get(e)},k.prototype.conversationById=function(e){if(this.conversationStore.has(e))return this.conversationStore.get(e)},k.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}},k.prototype.reportingTask=function(t,n){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.request("cc_reporting",V.__assign({attempt_id:t},n))]})})},k.prototype.agentActiveTasks=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.request("cc_agent_tasks",{agent_id:t})]})})},k.prototype.auth=function(){return V.__awaiter(this,void 0,void 0,function(){var t;return V.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,4]),[4,this.request("authentication_challenge",{token:this._config.token})];case 1:return[2,e.sent()];case 2:return t=e.sent(),this.handleError(t),[4,this.disconnect()];case 3:throw e.sent(),t;case 4:return[2]}})})},k.prototype.ping=function(){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.request("ping",{ping:1})]})})},k.prototype.sessionInfo=function(){return this.connectionInfo.session},Object.defineProperty(k.prototype,"version",{get:function(){return this.connectionInfo.server_version},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"buildVersion",{get:function(){return'"0.1.164"'},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"instanceId",{get:function(){return this.connectionInfo.sock_id},enumerable:!0,configurable:!0}),Object.defineProperty(k.prototype,"autoAnswerDelayTime",{get:function(){return this._config.autoAnswerDelayTime||400},enumerable:!0,configurable:!0}),k.prototype.agentSession=function(){return V.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l,d;return V.__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 An(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 Rn(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]}})})},k.prototype.invite=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.request("call_invite",t)]})})},k.prototype.call=function(n){return V.__awaiter(this,void 0,void 0,function(){var t;return V.__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]}})})},k.prototype.callRecordId=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.request("call_recordings",{id:t})]})})},k.prototype.eavesdrop=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.request("call_eavesdrop",t)]})})},k.prototype.agentSetOnline=function(t,n,r){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.request("cc_agent_online",{agent_id:t,channels:n,on_demand:r})]})})},k.prototype.agentSetWaiting=function(t,n){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.request("cc_agent_waiting",{agent_id:t,channel:n})]})})},k.prototype.agentSetPause=function(t,n){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.request("cc_agent_pause",{agent_id:t,payload:n})]})})},k.prototype.agentSetOffline=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.request("cc_agent_offline",{agent_id:t})]})})},k.prototype.inviteToUser=function(e){return this.request("call_user",e)},k.prototype.answer=function(n,r){return V.__awaiter(this,void 0,void 0,function(){var t;return V.__generator(this,function(e){return(t=this.callById(n))?[2,t.answer(r)]:[2]})})},k.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})})},k.prototype.useWebPhone=function(){return this._config.registerWebDevice||!1},k.prototype.callDestroyed=function(e){return 0<e.hangupAt&&!this.hasAgentTask(e.task)},k.prototype.conversationDestroyed=function(e){return 0<e.closedAt&&(!this.hasAgentTask(e.task)||!e.hasReporting)&&(e.hasReporting||!(e.lastAction===h.ChatActions.Close&&0<e.answeredAt))},k.prototype.reportingChannelTask=function(e){switch(e.channel){case Cn.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 Cn.Chat:if(e.agentChannelId){var i=this.conversationById(e.agentChannelId);if(i&&this.conversationDestroyed(i))return void this.destroyConversation(i)}}},k.prototype.registerCallClient=function(n){return V.__awaiter(this,void 0,void 0,function(){var t;return V.__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]}})})},k.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(Ln,h.CallActions.PeerStream,e))}),e.on("localStreams",function(e,t){e=n.callBySession(e);e&&!e.localStreams.length&&(e.setLocalStreams(t),n.eventHandler.emit(Ln,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)})},k.prototype.deviceConfig=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,this.request("user_default_device",{name:t})]})})},k.prototype.storeFile=function(l,d,_){return V.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return V.__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]}})})},k.prototype.fileUrlDownload=function(e){return this.basePath+"/api/storage/file/"+e+"/download?access_token="+this._config.token},k.prototype.fileUrlStream=function(e){return this.basePath+"/api/storage/file/"+e+"/stream?access_token="+this._config.token},k.prototype.handleError=function(e){if(e)switch(e.name){case Bn.NotFoundError:this.emit("error",new On(e.message));break;case Bn.NotAllowedError:this.emit("error",new Wn(e.message));break;default:this.emit("error",e)}},k.prototype.destroyConversation=function(e){this.conversationStore.delete(e.id),this.eventHandler.emit(Fn,h.ChatActions.Destroy,e)},k.prototype.onMessage=function(r){return V.__awaiter(this,void 0,void 0,function(){var t,n;return V.__generator(this,function(e){switch(e.label){case 0:return(this.log.debug("receive message: ",r),0<r.seq_reply)?(this.queueRequest.has(r.seq_reply)&&(t=this.queueRequest.get(r.seq_reply),this.queueRequest.delete(r.seq_reply),r.status===h.Response.STATUS_OK?t.resolve(r.data):(n=r.error)&&n.id===h.TypeErrors.RolePermission?t.reject(new xn(n.detail)):t.reject(r.error)),[3,15]):[3,1];case 1:switch(r.event){case"hello":return[3,2];case Ln:return[3,4];case Fn:return[3,6];case Jn:return[3,8];case"sip":return[3,9];case Nn:return[3,10];case"channel":return[3,11];case"error":return[3,12];case"notification":return[3,13]}return[3,14];case 2:return[4,this.connected(r.data)];case 3:return e.sent(),this.log.debug("opened session "+this.connectionInfo.sock_id+" for userId="+this.connectionInfo.session.user_id),[3,15];case 4:return[4,this.handleCallEvents(r.data.call)];case 5:return e.sent(),[3,15];case 6:return[4,this.handleChatEvents(r.data)];case 7:return e.sent(),[3,15];case 8:return this.handleUserStateEvent(r.data.state),[3,15];case 9:return this.eventHandler.emit("sip",r.data),[3,15];case 10:return this.handleAgentStatus(r.data),[3,15];case 11:return this.handleChannelEvents(r.data),[3,15];case 12:return this.lastError=r.data.error,[3,15];case 13:return this.handleNotification(r.data.notification),[3,15];case 14:this.log.error("event "+r.event+" not handler"),e.label=15;case 15:return[2]}})})},k.prototype.handleNotification=function(e){if(e.action===En.HideMember){if(this.agent&&this.agent._listOfflineMembers){var t=this.agent._listOfflineMembers;if(t.items)for(var n=0;n<t.items.length;n++)if(t.items[n].id===e.body.member_id){t.items.splice(n,1);break}}}else this.log.error('notification "'+e.action+'" not handled')},k.prototype.handleAgentStatus=function(e){this.agent&&e.agent_id===this.agent.agentId&&this.agent.setStatus(e),this.eventHandler.emit(Nn,e,this.agent)},k.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&&Vn(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)))},k.prototype.pingServer=function(){return V.__awaiter(this,void 0,void 0,function(){var t,n=this;return V.__generator(this,function(e){switch(e.label){case 0:return this.pingTimer&&this.connectionInfo.ping_interval?(t=setTimeout(function(){return V.__awaiter(n,void 0,void 0,function(){return V.__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]}})})},k.prototype.connected=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__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 qn(this.instanceId,this._config.debug))]:[2]}})})},k.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}},k.prototype.onNewCallSession=function(n){return V.__awaiter(this,void 0,void 0,function(){var t;return V.__generator(this,function(e){return(t=n.callId?this.callById(n.callId):this.callBySipId(n.id))&&(t.setSip(n),this.checkAutoAnswer(t)),[2]})})},k.prototype.checkAutoAnswer=function(e){e.autoAnswer&&e.answerDelay({video:e.params.video,screen:e.params.screen,disableStun:e.params.disableStun},this.autoAnswerDelayTime)},k.prototype.connectToSocket=function(){var n=this;return new Promise(function(e,t){try{n.socket=new jn(n._config.endpoint),n.socket.connect(n._config.token)}catch(e){return void t(e)}n.socket.on("message",n.onMessage.bind(n)),n.socket.on("close",function(e){n.pingTimer&&clearTimeout(n.pingTimer),n.log.error("socket close code: ",e),1e3!==e&&(n.emit("disconnected",e,n.lastError),t(new Error("close socket code: "+e))),n.eventHandler.off("*")}),n.socket.on("open",function(){e(null),n.emit("connected")})})},k.prototype.handleUserStateEvent=function(e){this.eventHandler.emit(Jn,e)},k.prototype.handleCallEvents=function(n){return V.__awaiter(this,void 0,void 0,function(){var t;return V.__generator(this,function(e){switch(n.timestamp=Date.now(),n.event){case h.CallActions.Ringing:t=new Pn(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(Ln,n.event,t),this.callDestroyed(t)&&this.destroyCall(t)),[2]})})},k.prototype.handleChatEvents=function(_){return V.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l,d;return V.__generator(this,function(e){switch(n=Date.now(),_.action){case h.ChatActions.UserInvite:r=_.data,(t=new kn(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(Fn,_.action,t),this.conversationDestroyed(t)&&this.destroyConversation(t)),[2]})})},k.prototype.hasAgentTask=function(e){return!(!this.agent||!e)&&this.agent.hasTask(e)},k.prototype.destroyCall=function(e){this.callStore.delete(e.id),this.eventHandler.emit(Ln,h.CallActions.Destroy,e)},k);function k(e){var t=Mn.call(this)||this;return t._config=e,t.reqSeq=0,t.queueRequest=new Map,t.log=new bn,t.eventHandler=new T.EventEmitter,t.callStore=new Map,t.conversationStore=new Map,t.pingTimer=null,t.basePath=""+(e=(e=(e=(e=e.storageEndpoint||e.endpoint).replace(/^ws/,"http")).endsWith("/")?e.slice(0,-1):e).endsWith("/ws")?e.slice(0,-3):e),t.lastError=null,t}function Vn(e){return e.channel===Cn.Task}zn=T.EventEmitter,V.__extends(Yn,zn);var zn,$n=Yn;function Yn(){return null!==zn&&zn.apply(this,arguments)||this}var Zn="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(function(c){var e=Zn&&Zn.__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})((er={exports:{}},er.exports));var er=er.exports,tr=((tr=er)&&tr.__esModule&&Object.prototype.hasOwnProperty.call(tr,"default")&&tr.default,er.$listeners,er.$addListener,er.EventEmitter),nr=(Object.defineProperty(rr.prototype,"id",{get:function(){return this.callId},enumerable:!0,configurable:!0}),rr.prototype.getLocalMedia=function(){return[]},rr.prototype.getPeerMedia=function(){return[]},rr.prototype.answer=function(e){var t=this;return new Promise(function(e){t.client.answer(t.id),e()})},rr);function rr(e,t){this.client=e,this.callId=t,this.incoming=!1,this.instanceId="fixme"}ir=tr,V.__extends(ar,ir),ar.prototype.callOption=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2,t]})})},ar.prototype.register=function(e){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2]})})},ar.prototype.unregister=function(){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return[2]})})},ar.prototype.call=function(t){return V.__awaiter(this,void 0,void 0,function(){return V.__generator(this,function(e){return t.destination&&this.exec(t.destination),[2]})})},ar.prototype.answer=function(e){this.exec(e,"answer")},ar.prototype.sipSessionByCallId=function(e){return new nr(this,e)},ar.prototype.sipSessionBySipId=function(e){return null},ar.prototype.open=function(e){this.exec(encodeURIComponent(JSON.stringify(V.__assign({token:e},this.config))),"open")},ar.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 ir,er=ar;function ar(e){var t=ir.call(this)||this;return t.config=e,t.type="external",t.schema="wtel://",t}h.AgentPauseCauseServiceApiAxiosParamCreator=W,h.AgentPauseCauseServiceApiFp=l,h.AgentPauseCauseServiceApiFactory=function(o,u,c){return{agentPauseCauseServiceCreateAgentPauseCause:function(e,t){return l(o).agentPauseCauseServiceCreateAgentPauseCause(e,t).then(function(e){return e(c,u)})},agentPauseCauseServiceDeleteAgentPauseCause:function(e,t){return l(o).agentPauseCauseServiceDeleteAgentPauseCause(e,t).then(function(e){return e(c,u)})},agentPauseCauseServicePatchAgentPauseCause:function(e,t,n){return l(o).agentPauseCauseServicePatchAgentPauseCause(e,t,n).then(function(e){return e(c,u)})},agentPauseCauseServiceReadAgentPauseCause:function(e,t){return l(o).agentPauseCauseServiceReadAgentPauseCause(e,t).then(function(e){return e(c,u)})},agentPauseCauseServiceSearchAgentPauseCause:function(e,t,n,r,i,a,s){return l(o).agentPauseCauseServiceSearchAgentPauseCause(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},agentPauseCauseServiceUpdateAgentPauseCause:function(e,t,n){return l(o).agentPauseCauseServiceUpdateAgentPauseCause(e,t,n).then(function(e){return e(c,u)})}}},h.AgentPauseCauseServiceApi=D,h.AgentServiceApiAxiosParamCreator=w,h.AgentServiceApiFp=q,h.AgentServiceApiFactory=function(y,S,m){return{agentServiceAgentSetState:function(e,t,n){return q(y).agentServiceAgentSetState(e,t,n).then(function(e){return e(m,S)})},agentServiceAgentStateHistory:function(e,t,n,r,i,a,s,o){return q(y).agentServiceAgentStateHistory(e,t,n,r,i,a,s,o).then(function(e){return e(m,S)})},agentServiceAgentTodayStatistics:function(e,t,n){return q(y).agentServiceAgentTodayStatistics(e,t,n).then(function(e){return e(m,S)})},agentServiceCreateAgent:function(e,t){return q(y).agentServiceCreateAgent(e,t).then(function(e){return e(m,S)})},agentServiceDeleteAgent:function(e,t,n){return q(y).agentServiceDeleteAgent(e,t,n).then(function(e){return e(m,S)})},agentServicePatchAgent:function(e,t,n){return q(y).agentServicePatchAgent(e,t,n).then(function(e){return e(m,S)})},agentServiceReadAgent:function(e,t,n){return q(y).agentServiceReadAgent(e,t,n).then(function(e){return e(m,S)})},agentServiceSearchAgent:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b){return q(y).agentServiceSearchAgent(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b).then(function(e){return e(m,S)})},agentServiceSearchAgentCallStatistics:function(e,t,n,r,i,a,s,o,u,c){return q(y).agentServiceSearchAgentCallStatistics(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(m,S)})},agentServiceSearchAgentInQueue:function(e,t,n,r,i,a,s){return q(y).agentServiceSearchAgentInQueue(e,t,n,r,i,a,s).then(function(e){return e(m,S)})},agentServiceSearchAgentInQueueStatistics:function(e,t,n){return q(y).agentServiceSearchAgentInQueueStatistics(e,t,n).then(function(e){return e(m,S)})},agentServiceSearchAgentInTeam:function(e,t,n,r,i,a){return q(y).agentServiceSearchAgentInTeam(e,t,n,r,i,a).then(function(e){return e(m,S)})},agentServiceSearchAgentStateHistory:function(e,t,n,r,i,a,s,o,u){return q(y).agentServiceSearchAgentStateHistory(e,t,n,r,i,a,s,o,u).then(function(e){return e(m,S)})},agentServiceSearchAgentStatusStatistic:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b){return q(y).agentServiceSearchAgentStatusStatistic(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b).then(function(e){return e(m,S)})},agentServiceSearchAgentStatusStatisticItem:function(e,t,n,r){return q(y).agentServiceSearchAgentStatusStatisticItem(e,t,n,r).then(function(e){return e(m,S)})},agentServiceSearchLookupUsersAgentNotExists:function(e,t,n,r,i){return q(y).agentServiceSearchLookupUsersAgentNotExists(e,t,n,r,i).then(function(e){return e(m,S)})},agentServiceSearchPauseCauseForAgent:function(e,t,n){return q(y).agentServiceSearchPauseCauseForAgent(e,t,n).then(function(e){return e(m,S)})},agentServiceUpdateAgent:function(e,t,n){return q(y).agentServiceUpdateAgent(e,t,n).then(function(e){return e(m,S)})},agentServiceUpdateAgentStatus:function(e,t,n){return q(y).agentServiceUpdateAgentStatus(e,t,n).then(function(e){return e(m,S)})}}},h.AgentServiceApi=G,h.AgentSkillServiceApiAxiosParamCreator=Q,h.AgentSkillServiceApiFp=d,h.AgentSkillServiceApiFactory=function(u,c,l){return{agentSkillServiceCreateAgentSkill:function(e,t,n){return d(u).agentSkillServiceCreateAgentSkill(e,t,n).then(function(e){return e(l,c)})},agentSkillServiceDeleteAgentSkill:function(e,t,n,r){return d(u).agentSkillServiceDeleteAgentSkill(e,t,n,r).then(function(e){return e(l,c)})},agentSkillServicePatchAgentSkill:function(e,t,n,r){return d(u).agentSkillServicePatchAgentSkill(e,t,n,r).then(function(e){return e(l,c)})},agentSkillServiceReadAgentSkill:function(e,t,n,r){return d(u).agentSkillServiceReadAgentSkill(e,t,n,r).then(function(e){return e(l,c)})},agentSkillServiceSearchAgentSkill:function(e,t,n,r,i,a,s,o){return d(u).agentSkillServiceSearchAgentSkill(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},agentSkillServiceSearchLookupAgentNotExistsSkill:function(e,t,n,r,i,a){return d(u).agentSkillServiceSearchLookupAgentNotExistsSkill(e,t,n,r,i,a).then(function(e){return e(l,c)})},agentSkillServiceUpdateAgentSkill:function(e,t,n,r){return d(u).agentSkillServiceUpdateAgentSkill(e,t,n,r).then(function(e){return e(l,c)})}}},h.AgentSkillServiceApi=H,h.AgentTeamServiceApiAxiosParamCreator=N,h.AgentTeamServiceApiFp=$,h.AgentTeamServiceApiFactory=function(c,l,d){return{agentTeamServiceCreateAgentTeam:function(e,t){return $(c).agentTeamServiceCreateAgentTeam(e,t).then(function(e){return e(d,l)})},agentTeamServiceDeleteAgentTeam:function(e,t,n){return $(c).agentTeamServiceDeleteAgentTeam(e,t,n).then(function(e){return e(d,l)})},agentTeamServiceReadAgentTeam:function(e,t,n){return $(c).agentTeamServiceReadAgentTeam(e,t,n).then(function(e){return e(d,l)})},agentTeamServiceSearchAgentTeam:function(e,t,n,r,i,a,s,o,u){return $(c).agentTeamServiceSearchAgentTeam(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},agentTeamServiceUpdateAgentTeam:function(e,t,n){return $(c).agentTeamServiceUpdateAgentTeam(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{bucketServiceCreateBucket:function(e,t){return se(o).bucketServiceCreateBucket(e,t).then(function(e){return e(c,u)})},bucketServiceDeleteBucket:function(e,t,n){return se(o).bucketServiceDeleteBucket(e,t,n).then(function(e){return e(c,u)})},bucketServiceReadBucket:function(e,t,n){return se(o).bucketServiceReadBucket(e,t,n).then(function(e){return e(c,u)})},bucketServiceSearchBucket:function(e,t,n,r,i,a,s){return se(o).bucketServiceSearchBucket(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},bucketServiceUpdateBucket:function(e,t,n){return se(o).bucketServiceUpdateBucket(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{calendarServiceCreateCalendar:function(e,t){return p(o).calendarServiceCreateCalendar(e,t).then(function(e){return e(c,u)})},calendarServiceDeleteCalendar:function(e,t,n){return p(o).calendarServiceDeleteCalendar(e,t,n).then(function(e){return e(c,u)})},calendarServiceReadCalendar:function(e,t,n){return p(o).calendarServiceReadCalendar(e,t,n).then(function(e){return e(c,u)})},calendarServiceSearchCalendar:function(e,t,n,r,i,a,s){return p(o).calendarServiceSearchCalendar(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},calendarServiceSearchTimezones:function(e,t,n,r){return p(o).calendarServiceSearchTimezones(e,t,n,r).then(function(e){return e(c,u)})},calendarServiceUpdateCalendar:function(e,t,n){return p(o).calendarServiceUpdateCalendar(e,t,n).then(function(e){return e(c,u)})}}},h.CalendarServiceApi=_e,h.CallServiceApiAxiosParamCreator=L,h.CallServiceApiFp=F,h.CallServiceApiFactory=function(Q,j,H){return{callServiceAggregateHistoryCall:function(e,t){return F(Q).callServiceAggregateHistoryCall(e,t).then(function(e){return e(H,j)})},callServiceBlindTransferCall:function(e,t,n){return F(Q).callServiceBlindTransferCall(e,t,n).then(function(e){return e(H,j)})},callServiceConfirmPush:function(e,t){return F(Q).callServiceConfirmPush(e,t).then(function(e){return e(H,j)})},callServiceCreateCall:function(e,t){return F(Q).callServiceCreateCall(e,t).then(function(e){return e(H,j)})},callServiceCreateCallAnnotation:function(e,t,n){return F(Q).callServiceCreateCallAnnotation(e,t,n).then(function(e){return e(H,j)})},callServiceDeleteCallAnnotation:function(e,t,n){return F(Q).callServiceDeleteCallAnnotation(e,t,n).then(function(e){return e(H,j)})},callServiceDtmfCall:function(e,t,n){return F(Q).callServiceDtmfCall(e,t,n).then(function(e){return e(H,j)})},callServiceEavesdropCall:function(e,t,n){return F(Q).callServiceEavesdropCall(e,t,n).then(function(e){return e(H,j)})},callServiceHangupCall:function(e,t,n){return F(Q).callServiceHangupCall(e,t,n).then(function(e){return e(H,j)})},callServiceHoldCall:function(e,t,n){return F(Q).callServiceHoldCall(e,t,n).then(function(e){return e(H,j)})},callServiceReadCall:function(e,t,n){return F(Q).callServiceReadCall(e,t,n).then(function(e){return e(H,j)})},callServiceSearchActiveCall:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A,P,k,T){return F(Q).callServiceSearchActiveCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A,P,k,T).then(function(e){return e(H,j)})},callServiceSearchHistoryCall:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A,P,k,T,K,O,I,U,W,X,D,E,x,G){return F(Q).callServiceSearchHistoryCall(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S,m,w,q,C,R,A,P,k,T,K,O,I,U,W,X,D,E,x,G).then(function(e){return e(H,j)})},callServiceUnHoldCall:function(e,t,n){return F(Q).callServiceUnHoldCall(e,t,n).then(function(e){return e(H,j)})},callServiceUpdateCallAnnotation:function(e,t,n,r){return F(Q).callServiceUpdateCallAnnotation(e,t,n,r).then(function(e){return e(H,j)})}}},h.CallServiceApi=ge,h.CognitiveProfileServiceApiAxiosParamCreator=fe,h.CognitiveProfileServiceApiFp=g,h.CognitiveProfileServiceApiFactory=function(c,l,d){return{createCognitiveProfile:function(e,t){return g(c).createCognitiveProfile(e,t).then(function(e){return e(d,l)})},deleteCognitiveProfile:function(e,t){return g(c).deleteCognitiveProfile(e,t).then(function(e){return e(d,l)})},patchCognitiveProfile:function(e,t,n){return g(c).patchCognitiveProfile(e,t,n).then(function(e){return e(d,l)})},readCognitiveProfile:function(e,t){return g(c).readCognitiveProfile(e,t).then(function(e){return e(d,l)})},searchCognitiveProfile:function(e,t,n,r,i,a,s,o,u){return g(c).searchCognitiveProfile(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateCognitiveProfile:function(e,t,n){return g(c).updateCognitiveProfile(e,t,n).then(function(e){return e(d,l)})}}},h.CognitiveProfileServiceApi=be,h.CommunicationTypeServiceApiAxiosParamCreator=Se,h.CommunicationTypeServiceApiFp=me,h.CommunicationTypeServiceApiFactory=function(o,u,c){return{communicationTypeServiceCreateCommunicationType:function(e,t){return me(o).communicationTypeServiceCreateCommunicationType(e,t).then(function(e){return e(c,u)})},communicationTypeServiceDeleteCommunicationType:function(e,t,n){return me(o).communicationTypeServiceDeleteCommunicationType(e,t,n).then(function(e){return e(c,u)})},communicationTypeServiceReadCommunicationType:function(e,t,n){return me(o).communicationTypeServiceReadCommunicationType(e,t,n).then(function(e){return e(c,u)})},communicationTypeServiceSearchCommunicationType:function(e,t,n,r,i,a,s){return me(o).communicationTypeServiceSearchCommunicationType(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},communicationTypeServiceUpdateCommunicationType:function(e,t,n){return me(o).communicationTypeServiceUpdateCommunicationType(e,t,n).then(function(e){return e(c,u)})}}},h.CommunicationTypeServiceApi=qe,h.EmailProfileServiceApiAxiosParamCreator=Re,h.EmailProfileServiceApiFp=c,h.EmailProfileServiceApiFactory=function(s,o,u){return{emailProfileServiceCreateEmailProfile:function(e,t){return c(s).emailProfileServiceCreateEmailProfile(e,t).then(function(e){return e(u,o)})},emailProfileServiceDeleteEmailProfile:function(e,t){return c(s).emailProfileServiceDeleteEmailProfile(e,t).then(function(e){return e(u,o)})},emailProfileServicePatchEmailProfile:function(e,t,n){return c(s).emailProfileServicePatchEmailProfile(e,t,n).then(function(e){return e(u,o)})},emailProfileServiceReadEmailProfile:function(e,t){return c(s).emailProfileServiceReadEmailProfile(e,t).then(function(e){return e(u,o)})},emailProfileServiceSearchEmailProfile:function(e,t,n,r,i,a){return c(s).emailProfileServiceSearchEmailProfile(e,t,n,r,i,a).then(function(e){return e(u,o)})},emailProfileServiceTestEmailProfile:function(e,t){return c(s).emailProfileServiceTestEmailProfile(e,t).then(function(e){return e(u,o)})},emailProfileServiceUpdateEmailProfile:function(e,t,n){return c(s).emailProfileServiceUpdateEmailProfile(e,t,n).then(function(e){return e(u,o)})}}},h.EmailProfileServiceApi=Pe,h.FileServiceApiAxiosParamCreator=Te,h.FileServiceApiFp=Ke,h.FileServiceApiFactory=function(n,r,i){return{deleteFiles:function(e,t){return Ke(n).deleteFiles(e,t).then(function(e){return e(i,r)})}}},h.FileServiceApi=Ie,h.FileTranscriptServiceApiAxiosParamCreator=We,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=Ee,h.ImportTemplateServiceApiAxiosParamCreator=Ge,h.ImportTemplateServiceApiFp=Qe,h.ImportTemplateServiceApiFactory=function(o,u,c){return{createImportTemplate:function(e,t){return Qe(o).createImportTemplate(e,t).then(function(e){return e(c,u)})},deleteImportTemplate:function(e,t){return Qe(o).deleteImportTemplate(e,t).then(function(e){return e(c,u)})},patchImportTemplate:function(e,t,n){return Qe(o).patchImportTemplate(e,t,n).then(function(e){return e(c,u)})},readImportTemplate:function(e,t){return Qe(o).readImportTemplate(e,t).then(function(e){return e(c,u)})},searchImportTemplate:function(e,t,n,r,i,a,s){return Qe(o).searchImportTemplate(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateImportTemplate:function(e,t,n){return Qe(o).updateImportTemplate(e,t,n).then(function(e){return e(c,u)})}}},h.ImportTemplateServiceApi=He,h.ListServiceApiAxiosParamCreator=Me,h.ListServiceApiFp=f,h.ListServiceApiFactory=function(l,d,_){return{listServiceCreateList:function(e,t){return f(l).listServiceCreateList(e,t).then(function(e){return e(_,d)})},listServiceCreateListCommunication:function(e,t,n){return f(l).listServiceCreateListCommunication(e,t,n).then(function(e){return e(_,d)})},listServiceDeleteList:function(e,t,n){return f(l).listServiceDeleteList(e,t,n).then(function(e){return e(_,d)})},listServiceDeleteListCommunication:function(e,t,n,r){return f(l).listServiceDeleteListCommunication(e,t,n,r).then(function(e){return e(_,d)})},listServiceReadList:function(e,t,n){return f(l).listServiceReadList(e,t,n).then(function(e){return e(_,d)})},listServiceReadListCommunication:function(e,t,n,r){return f(l).listServiceReadListCommunication(e,t,n,r).then(function(e){return e(_,d)})},listServiceSearchList:function(e,t,n,r,i,a,s){return f(l).listServiceSearchList(e,t,n,r,i,a,s).then(function(e){return e(_,d)})},listServiceSearchListCommunication:function(e,t,n,r,i,a,s,o,u,c){return f(l).listServiceSearchListCommunication(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},listServiceUpdateList:function(e,t,n){return f(l).listServiceUpdateList(e,t,n).then(function(e){return e(_,d)})},listServiceUpdateListCommunication:function(e,t,n,r){return f(l).listServiceUpdateListCommunication(e,t,n,r).then(function(e){return e(_,d)})}}},h.ListServiceApi=Fe,h.MediaFileServiceApiAxiosParamCreator=Ne,h.MediaFileServiceApiFp=Ve,h.MediaFileServiceApiFactory=function(o,u,c){return{deleteMediaFile:function(e,t,n){return Ve(o).deleteMediaFile(e,t,n).then(function(e){return e(c,u)})},readMediaFile:function(e,t,n){return Ve(o).readMediaFile(e,t,n).then(function(e){return e(c,u)})},searchMediaFile:function(e,t,n,r,i,a,s){return Ve(o).searchMediaFile(e,t,n,r,i,a,s).then(function(e){return e(c,u)})}}},h.MediaFileServiceApi=$e,h.MemberServiceApiAxiosParamCreator=C,h.MemberServiceApiFp=R,h.MemberServiceApiFactory=function(m,w,q){return{memberServiceAttemptCallback:function(e,t,n){return R(m).memberServiceAttemptCallback(e,t,n).then(function(e){return e(q,w)})},memberServiceAttemptResult:function(e,t,n,r,i){return R(m).memberServiceAttemptResult(e,t,n,r,i).then(function(e){return e(q,w)})},memberServiceAttemptsRenewalResult:function(e,t,n){return R(m).memberServiceAttemptsRenewalResult(e,t,n).then(function(e){return e(q,w)})},memberServiceCreateAttempt:function(e,t,n,r){return R(m).memberServiceCreateAttempt(e,t,n,r).then(function(e){return e(q,w)})},memberServiceCreateMember:function(e,t,n){return R(m).memberServiceCreateMember(e,t,n).then(function(e){return e(q,w)})},memberServiceCreateMemberBulk:function(e,t,n){return R(m).memberServiceCreateMemberBulk(e,t,n).then(function(e){return e(q,w)})},memberServiceDeleteMember:function(e,t,n,r){return R(m).memberServiceDeleteMember(e,t,n,r).then(function(e){return e(q,w)})},memberServiceDeleteMembers:function(e,t,n){return R(m).memberServiceDeleteMembers(e,t,n).then(function(e){return e(q,w)})},memberServicePatchMember:function(e,t,n,r){return R(m).memberServicePatchMember(e,t,n,r).then(function(e){return e(q,w)})},memberServiceReadMember:function(e,t,n,r){return R(m).memberServiceReadMember(e,t,n,r).then(function(e){return e(q,w)})},memberServiceResetMembers:function(e,t,n){return R(m).memberServiceResetMembers(e,t,n).then(function(e){return e(q,w)})},memberServiceSearchAttempts:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y){return R(m).memberServiceSearchAttempts(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y).then(function(e){return e(q,w)})},memberServiceSearchAttemptsHistory:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y){return R(m).memberServiceSearchAttemptsHistory(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y).then(function(e){return e(q,w)})},memberServiceSearchMemberAttempts:function(e,t,n,r){return R(m).memberServiceSearchMemberAttempts(e,t,n,r).then(function(e){return e(q,w)})},memberServiceSearchMemberInQueue:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S){return R(m).memberServiceSearchMemberInQueue(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S).then(function(e){return e(q,w)})},memberServiceSearchMembers:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S){return R(m).memberServiceSearchMembers(e,t,n,r,i,a,s,o,u,c,l,d,_,h,p,g,f,v,b,y,S).then(function(e){return e(q,w)})},memberServiceUpdateMember:function(e,t,n,r){return R(m).memberServiceUpdateMember(e,t,n,r).then(function(e){return e(q,w)})}}},h.MemberServiceApi=et,h.OutboundResourceGroupServiceApiAxiosParamCreator=tt,h.OutboundResourceGroupServiceApiFp=v,h.OutboundResourceGroupServiceApiFactory=function(u,c,l){return{outboundResourceGroupServiceCreateOutboundResourceGroup:function(e,t){return v(u).outboundResourceGroupServiceCreateOutboundResourceGroup(e,t).then(function(e){return e(l,c)})},outboundResourceGroupServiceCreateOutboundResourceInGroup:function(e,t,n){return v(u).outboundResourceGroupServiceCreateOutboundResourceInGroup(e,t,n).then(function(e){return e(l,c)})},outboundResourceGroupServiceDeleteOutboundResourceGroup:function(e,t,n){return v(u).outboundResourceGroupServiceDeleteOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},outboundResourceGroupServiceDeleteOutboundResourceInGroup:function(e,t,n,r){return v(u).outboundResourceGroupServiceDeleteOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})},outboundResourceGroupServiceReadOutboundResourceGroup:function(e,t,n){return v(u).outboundResourceGroupServiceReadOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},outboundResourceGroupServiceReadOutboundResourceInGroup:function(e,t,n,r){return v(u).outboundResourceGroupServiceReadOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})},outboundResourceGroupServiceSearchOutboundResourceGroup:function(e,t,n,r,i,a,s){return v(u).outboundResourceGroupServiceSearchOutboundResourceGroup(e,t,n,r,i,a,s).then(function(e){return e(l,c)})},outboundResourceGroupServiceSearchOutboundResourceInGroup:function(e,t,n,r,i,a,s,o){return v(u).outboundResourceGroupServiceSearchOutboundResourceInGroup(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},outboundResourceGroupServiceUpdateOutboundResourceGroup:function(e,t,n){return v(u).outboundResourceGroupServiceUpdateOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},outboundResourceGroupServiceUpdateOutboundResourceInGroup:function(e,t,n,r){return v(u).outboundResourceGroupServiceUpdateOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})}}},h.OutboundResourceGroupServiceApi=rt,h.OutboundResourceServiceApiAxiosParamCreator=at,h.OutboundResourceServiceApiFp=b,h.OutboundResourceServiceApiFactory=function(u,c,l){return{outboundResourceServiceCreateOutboundResource:function(e,t){return b(u).outboundResourceServiceCreateOutboundResource(e,t).then(function(e){return e(l,c)})},outboundResourceServiceCreateOutboundResourceDisplay:function(e,t,n){return b(u).outboundResourceServiceCreateOutboundResourceDisplay(e,t,n).then(function(e){return e(l,c)})},outboundResourceServiceDeleteOutboundResource:function(e,t,n){return b(u).outboundResourceServiceDeleteOutboundResource(e,t,n).then(function(e){return e(l,c)})},outboundResourceServiceDeleteOutboundResourceDisplay:function(e,t,n,r){return b(u).outboundResourceServiceDeleteOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})},outboundResourceServicePatchOutboundResource:function(e,t,n){return b(u).outboundResourceServicePatchOutboundResource(e,t,n).then(function(e){return e(l,c)})},outboundResourceServiceReadOutboundResource:function(e,t,n){return b(u).outboundResourceServiceReadOutboundResource(e,t,n).then(function(e){return e(l,c)})},outboundResourceServiceReadOutboundResourceDisplay:function(e,t,n,r){return b(u).outboundResourceServiceReadOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})},outboundResourceServiceSearchOutboundResource:function(e,t,n,r,i,a,s){return b(u).outboundResourceServiceSearchOutboundResource(e,t,n,r,i,a,s).then(function(e){return e(l,c)})},outboundResourceServiceSearchOutboundResourceDisplay:function(e,t,n,r,i,a,s,o){return b(u).outboundResourceServiceSearchOutboundResourceDisplay(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},outboundResourceServiceUpdateOutboundResource:function(e,t,n){return b(u).outboundResourceServiceUpdateOutboundResource(e,t,n).then(function(e){return e(l,c)})},outboundResourceServiceUpdateOutboundResourceDisplay:function(e,t,n,r){return b(u).outboundResourceServiceUpdateOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})}}},h.OutboundResourceServiceApi=ot,h.QueueBucketServiceApiAxiosParamCreator=ct,h.QueueBucketServiceApiFp=lt,h.QueueBucketServiceApiFactory=function(u,c,l){return{queueBucketServiceCreateQueueBucket:function(e,t,n){return lt(u).queueBucketServiceCreateQueueBucket(e,t,n).then(function(e){return e(l,c)})},queueBucketServiceDeleteQueueBucket:function(e,t,n){return lt(u).queueBucketServiceDeleteQueueBucket(e,t,n).then(function(e){return e(l,c)})},queueBucketServicePatchQueueBucket:function(e,t,n,r){return lt(u).queueBucketServicePatchQueueBucket(e,t,n,r).then(function(e){return e(l,c)})},queueBucketServiceReadQueueBucket:function(e,t,n){return lt(u).queueBucketServiceReadQueueBucket(e,t,n).then(function(e){return e(l,c)})},queueBucketServiceSearchQueueBucket:function(e,t,n,r,i,a,s,o){return lt(u).queueBucketServiceSearchQueueBucket(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},queueBucketServiceUpdateQueueBucket:function(e,t,n,r){return lt(u).queueBucketServiceUpdateQueueBucket(e,t,n,r).then(function(e){return e(l,c)})}}},h.QueueBucketServiceApi=_t,h.QueueHookServiceApiAxiosParamCreator=pt,h.QueueHookServiceApiFp=gt,h.QueueHookServiceApiFactory=function(l,d,_){return{queueHookServiceCreateQueueHook:function(e,t,n){return gt(l).queueHookServiceCreateQueueHook(e,t,n).then(function(e){return e(_,d)})},queueHookServiceDeleteQueueHook:function(e,t,n){return gt(l).queueHookServiceDeleteQueueHook(e,t,n).then(function(e){return e(_,d)})},queueHookServicePatchQueueHook:function(e,t,n,r){return gt(l).queueHookServicePatchQueueHook(e,t,n,r).then(function(e){return e(_,d)})},queueHookServiceReadQueueHook:function(e,t,n){return gt(l).queueHookServiceReadQueueHook(e,t,n).then(function(e){return e(_,d)})},queueHookServiceSearchQueueHook:function(e,t,n,r,i,a,s,o,u,c){return gt(l).queueHookServiceSearchQueueHook(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},queueHookServiceUpdateQueueHook:function(e,t,n,r){return gt(l).queueHookServiceUpdateQueueHook(e,t,n,r).then(function(e){return e(_,d)})}}},h.QueueHookServiceApi=vt,h.QueueResourcesServiceApiAxiosParamCreator=yt,h.QueueResourcesServiceApiFp=St,h.QueueResourcesServiceApiFactory=function(u,c,l){return{queueResourcesServiceCreateQueueResourceGroup:function(e,t,n){return St(u).queueResourcesServiceCreateQueueResourceGroup(e,t,n).then(function(e){return e(l,c)})},queueResourcesServiceDeleteQueueResourceGroup:function(e,t,n,r){return St(u).queueResourcesServiceDeleteQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})},queueResourcesServiceReadQueueResourceGroup:function(e,t,n,r){return St(u).queueResourcesServiceReadQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})},queueResourcesServiceSearchQueueResourceGroup:function(e,t,n,r,i,a,s,o){return St(u).queueResourcesServiceSearchQueueResourceGroup(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},queueResourcesServiceUpdateQueueResourceGroup:function(e,t,n,r){return St(u).queueResourcesServiceUpdateQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})}}},h.QueueResourcesServiceApi=wt,h.QueueServiceApiAxiosParamCreator=Ct,h.QueueServiceApiFp=y,h.QueueServiceApiFactory=function(_,h,p){return{queueServiceCreateQueue:function(e,t){return y(_).queueServiceCreateQueue(e,t).then(function(e){return e(p,h)})},queueServiceDeleteQueue:function(e,t,n){return y(_).queueServiceDeleteQueue(e,t,n).then(function(e){return e(p,h)})},queueServicePatchQueue:function(e,t,n){return y(_).queueServicePatchQueue(e,t,n).then(function(e){return e(p,h)})},queueServiceReadQueue:function(e,t,n){return y(_).queueServiceReadQueue(e,t,n).then(function(e){return e(p,h)})},queueServiceSearchQueue:function(e,t,n,r,i,a,s,o){return y(_).queueServiceSearchQueue(e,t,n,r,i,a,s,o).then(function(e){return e(p,h)})},queueServiceSearchQueueReportGeneral:function(e,t,n,r,i,a,s,o,u,c,l,d){return y(_).queueServiceSearchQueueReportGeneral(e,t,n,r,i,a,s,o,u,c,l,d).then(function(e){return e(p,h)})},queueServiceUpdateQueue:function(e,t,n){return y(_).queueServiceUpdateQueue(e,t,n).then(function(e){return e(p,h)})}}},h.QueueServiceApi=At,h.QueueSkillServiceApiAxiosParamCreator=kt,h.QueueSkillServiceApiFp=Tt,h.QueueSkillServiceApiFactory=function(p,g,f){return{queueSkillServiceCreateQueueSkill:function(e,t,n){return Tt(p).queueSkillServiceCreateQueueSkill(e,t,n).then(function(e){return e(f,g)})},queueSkillServiceDeleteQueueSkill:function(e,t,n){return Tt(p).queueSkillServiceDeleteQueueSkill(e,t,n).then(function(e){return e(f,g)})},queueSkillServicePatchQueueSkill:function(e,t,n,r){return Tt(p).queueSkillServicePatchQueueSkill(e,t,n,r).then(function(e){return e(f,g)})},queueSkillServiceReadQueueSkill:function(e,t,n){return Tt(p).queueSkillServiceReadQueueSkill(e,t,n).then(function(e){return e(f,g)})},queueSkillServiceSearchQueueSkill:function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){return Tt(p).queueSkillServiceSearchQueueSkill(e,t,n,r,i,a,s,o,u,c,l,d,_,h).then(function(e){return e(f,g)})},queueSkillServiceUpdateQueueSkill:function(e,t,n,r){return Tt(p).queueSkillServiceUpdateQueueSkill(e,t,n,r).then(function(e){return e(f,g)})}}},h.QueueSkillServiceApi=Ot,h.RegionServiceApiAxiosParamCreator=Ut,h.RegionServiceApiFp=Wt,h.RegionServiceApiFactory=function(l,d,_){return{regionServiceCreateRegion:function(e,t){return Wt(l).regionServiceCreateRegion(e,t).then(function(e){return e(_,d)})},regionServiceDeleteRegion:function(e,t){return Wt(l).regionServiceDeleteRegion(e,t).then(function(e){return e(_,d)})},regionServicePatchRegion:function(e,t,n){return Wt(l).regionServicePatchRegion(e,t,n).then(function(e){return e(_,d)})},regionServiceReadRegion:function(e,t){return Wt(l).regionServiceReadRegion(e,t).then(function(e){return e(_,d)})},regionServiceSearchRegion:function(e,t,n,r,i,a,s,o,u,c){return Wt(l).regionServiceSearchRegion(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},regionServiceUpdateRegion:function(e,t,n){return Wt(l).regionServiceUpdateRegion(e,t,n).then(function(e){return e(_,d)})}}},h.RegionServiceApi=Dt,h.RoutingChatPlanServiceApiAxiosParamCreator=xt,h.RoutingChatPlanServiceApiFp=Gt,h.RoutingChatPlanServiceApiFactory=function(c,l,d){return{routingChatPlanServiceCreateChatPlan:function(e,t){return Gt(c).routingChatPlanServiceCreateChatPlan(e,t).then(function(e){return e(d,l)})},routingChatPlanServiceDeleteChatPlan:function(e,t){return Gt(c).routingChatPlanServiceDeleteChatPlan(e,t).then(function(e){return e(d,l)})},routingChatPlanServicePatchChatPlan:function(e,t,n){return Gt(c).routingChatPlanServicePatchChatPlan(e,t,n).then(function(e){return e(d,l)})},routingChatPlanServiceReadChatPlan:function(e,t){return Gt(c).routingChatPlanServiceReadChatPlan(e,t).then(function(e){return e(d,l)})},routingChatPlanServiceSearchChatPlan:function(e,t,n,r,i,a,s,o,u){return Gt(c).routingChatPlanServiceSearchChatPlan(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},routingChatPlanServiceUpdateChatPlan:function(e,t,n){return Gt(c).routingChatPlanServiceUpdateChatPlan(e,t,n).then(function(e){return e(d,l)})}}},h.RoutingChatPlanServiceApi=jt,h.RoutingOutboundCallServiceApiAxiosParamCreator=Bt,h.RoutingOutboundCallServiceApiFp=S,h.RoutingOutboundCallServiceApiFactory=function(d,_,h){return{routingOutboundCallServiceCreateRoutingOutboundCall:function(e,t){return S(d).routingOutboundCallServiceCreateRoutingOutboundCall(e,t).then(function(e){return e(h,_)})},routingOutboundCallServiceDeleteRoutingOutboundCall:function(e,t,n){return S(d).routingOutboundCallServiceDeleteRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},routingOutboundCallServiceMovePositionRoutingOutboundCall:function(e,t,n,r){return S(d).routingOutboundCallServiceMovePositionRoutingOutboundCall(e,t,n,r).then(function(e){return e(h,_)})},routingOutboundCallServicePatchRoutingOutboundCall:function(e,t,n){return S(d).routingOutboundCallServicePatchRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},routingOutboundCallServiceReadRoutingOutboundCall:function(e,t,n){return S(d).routingOutboundCallServiceReadRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},routingOutboundCallServiceSearchRoutingOutboundCall:function(e,t,n,r,i,a,s,o,u,c,l){return S(d).routingOutboundCallServiceSearchRoutingOutboundCall(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(h,_)})},routingOutboundCallServiceUpdateRoutingOutboundCall:function(e,t,n){return S(d).routingOutboundCallServiceUpdateRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})}}},h.RoutingOutboundCallServiceApi=Lt,h.RoutingSchemaServiceApiAxiosParamCreator=Jt,h.RoutingSchemaServiceApiFp=m,h.RoutingSchemaServiceApiFactory=function(d,_,h){return{routingSchemaServiceCreateRoutingSchema:function(e,t){return m(d).routingSchemaServiceCreateRoutingSchema(e,t).then(function(e){return e(h,_)})},routingSchemaServiceDeleteRoutingSchema:function(e,t,n){return m(d).routingSchemaServiceDeleteRoutingSchema(e,t,n).then(function(e){return e(h,_)})},routingSchemaServicePatchRoutingSchema:function(e,t,n){return m(d).routingSchemaServicePatchRoutingSchema(e,t,n).then(function(e){return e(h,_)})},routingSchemaServiceReadRoutingSchema:function(e,t,n){return m(d).routingSchemaServiceReadRoutingSchema(e,t,n).then(function(e){return e(h,_)})},routingSchemaServiceSearchRoutingSchema:function(e,t,n,r,i,a,s,o,u,c,l){return m(d).routingSchemaServiceSearchRoutingSchema(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(h,_)})},routingSchemaServiceSearchRoutingSchemaTags:function(e,t,n,r,i,a,s){return m(d).routingSchemaServiceSearchRoutingSchemaTags(e,t,n,r,i,a,s).then(function(e){return e(h,_)})},routingSchemaServiceUpdateRoutingSchema:function(e,t,n){return m(d).routingSchemaServiceUpdateRoutingSchema(e,t,n).then(function(e){return e(h,_)})}}},h.RoutingSchemaServiceApi=Vt,h.RoutingVariableServiceApiAxiosParamCreator=$t,h.RoutingVariableServiceApiFp=Yt,h.RoutingVariableServiceApiFactory=function(i,a,s){return{routingVariableServiceCreateRoutingVariable:function(e,t){return Yt(i).routingVariableServiceCreateRoutingVariable(e,t).then(function(e){return e(s,a)})},routingVariableServiceDeleteRoutingVariable:function(e,t,n){return Yt(i).routingVariableServiceDeleteRoutingVariable(e,t,n).then(function(e){return e(s,a)})},routingVariableServiceReadRoutingVariable:function(e,t,n){return Yt(i).routingVariableServiceReadRoutingVariable(e,t,n).then(function(e){return e(s,a)})},routingVariableServiceSearchRoutingVariable:function(e,t,n,r){return Yt(i).routingVariableServiceSearchRoutingVariable(e,t,n,r).then(function(e){return e(s,a)})},routingVariableServiceUpdateRoutingVariable:function(e,t,n){return Yt(i).routingVariableServiceUpdateRoutingVariable(e,t,n).then(function(e){return e(s,a)})}}},h.RoutingVariableServiceApi=en,h.SkillServiceApiAxiosParamCreator=nn,h.SkillServiceApiFp=rn,h.SkillServiceApiFactory=function(o,u,c){return{skillServiceCreateSkill:function(e,t){return rn(o).skillServiceCreateSkill(e,t).then(function(e){return e(c,u)})},skillServiceDeleteSkill:function(e,t,n){return rn(o).skillServiceDeleteSkill(e,t,n).then(function(e){return e(c,u)})},skillServiceReadSkill:function(e,t,n){return rn(o).skillServiceReadSkill(e,t,n).then(function(e){return e(c,u)})},skillServiceSearchSkill:function(e,t,n,r,i,a,s){return rn(o).skillServiceSearchSkill(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},skillServiceUpdateSkill:function(e,t,n){return rn(o).skillServiceUpdateSkill(e,t,n).then(function(e){return e(c,u)})}}},h.SkillServiceApi=sn,h.TriggerServiceApiAxiosParamCreator=un,h.TriggerServiceApiFp=A,h.TriggerServiceApiFactory=function(c,l,d){return{triggerServiceCreateTrigger:function(e,t){return A(c).triggerServiceCreateTrigger(e,t).then(function(e){return e(d,l)})},triggerServiceCreateTriggerJob:function(e,t,n){return A(c).triggerServiceCreateTriggerJob(e,t,n).then(function(e){return e(d,l)})},triggerServiceDeleteTrigger:function(e,t){return A(c).triggerServiceDeleteTrigger(e,t).then(function(e){return e(d,l)})},triggerServicePatchTrigger:function(e,t,n){return A(c).triggerServicePatchTrigger(e,t,n).then(function(e){return e(d,l)})},triggerServiceReadTrigger:function(e,t){return A(c).triggerServiceReadTrigger(e,t).then(function(e){return e(d,l)})},triggerServiceSearchTrigger:function(e,t,n,r,i,a,s,o){return A(c).triggerServiceSearchTrigger(e,t,n,r,i,a,s,o).then(function(e){return e(d,l)})},triggerServiceSearchTriggerJob:function(e,t,n,r,i,a,s,o,u){return A(c).triggerServiceSearchTriggerJob(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},triggerServiceUpdateTrigger:function(e,t,n){return A(c).triggerServiceUpdateTrigger(e,t,n).then(function(e){return e(d,l)})}}},h.TriggerServiceApi=ln,h.UserHelperServiceApiAxiosParamCreator=_n,h.UserHelperServiceApiFp=hn,h.UserHelperServiceApiFactory=function(n,r,i){return{userHelperServiceDefaultDeviceConfig:function(e,t){return hn(n).userHelperServiceDefaultDeviceConfig(e,t).then(function(e){return e(i,r)})}}},h.UserHelperServiceApi=gn,h.Configuration=vn,h.Client=P,h.Call=Pn,h.Agent=An,h.Conversation=kn,h.DeviceNotFoundError=On,h.DeviceNotAllowPermissionError=Wn,h.RolePermissionError=xn,h.SipClient=$n,h.ExternalClient=er,h.SipPhone=qn,h.Log=bn,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,z,V,H,P,k){"use strict";H=H&&H.hasOwnProperty("default")?H.default:H;function e(e,t,n){void 0===n&&(n=H),this.basePath=t=void 0===t?L:t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}var I,L="https://dev.webitel.com/api".replace(/\/+$/,""),O=(I=Error,z.__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={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/call_center/pause_causes",!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteAgentPauseCause:function(u,c){return void 0===c&&(c={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),c.headers),[2,{url:V.format(t),options:r}]}})})},patchAgentPauseCause:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},readAgentPauseCause:function(u,c){return void 0===c&&(c={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),c.headers),[2,{url:V.format(t),options:r}]}})})},searchAgentPauseCause:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/call_center/pause_causes",!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),p.headers),[2,{url:V.format(t),options:r}]}})})},updateAgentPauseCause:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function l(c){return{createAgentPauseCause:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgentPauseCause:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchAgentPauseCause:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgentPauseCause:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentPauseCause:function(t,r,i,a,s,o,u){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentPauseCause:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}E=e,z.__extends(Q,E),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 E,x=Q;function Q(){return null!==E&&E.apply(this,arguments)||this}function q(K){var e=this;return{agentSetState:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),K&&(n=K.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},agentStateHistory:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),K&&(n=K.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),f.headers),[2,{url:V.format(t),options:r}]}})})},agentTodayStatistics:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),K&&(n=K.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},createAgent:function(c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/call_center/agents",!0),K&&(n=K.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteAgent:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),K&&(n=K.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},patchAgent:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),K&&(n=K.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},readAgent:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),K&&(n=K.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.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={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/call_center/agents",!0),K&&(n=K.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),S.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),S.headers),[2,{url:V.format(t),options:r}]}})})},searchAgentCallStatistics:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/call_center/agents/reports/call",!0),K&&(n=K.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),v.headers),[2,{url:V.format(t),options:r}]}})})},searchAgentInQueue:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),K&&(n=K.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),p.headers),[2,{url:V.format(t),options:r}]}})})},searchAgentInQueueStatistics:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),K&&(n=K.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},searchAgentInTeam:function(u,c,l,d,_,h){return void 0===h&&(h={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),K&&(n=K.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),h.headers),[2,{url:V.format(t),options:r}]}})})},searchAgentStateHistory:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/call_center/agents/states/history",!0),K&&(n=K.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),g.headers),[2,{url:V.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={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/call_center/agents/reports/status",!0),K&&(n=K.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),S.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),S.headers),[2,{url:V.format(t),options:r}]}})})},searchAgentStatusStatisticItem:function(u,c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),K&&(n=K.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),d.headers),[2,{url:V.format(t),options:r}]}})})},searchLookupUsersAgentNotExists:function(u,c,l,d,_){return void 0===_&&(_={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/call_center/lookups/agents/users",!0),K&&(n=K.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),_.headers),[2,{url:V.format(t),options:r}]}})})},searchPauseCauseForAgent:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),K&&(n=K.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},updateAgent:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),K&&(n=K.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},updateAgentStatus:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),K&&(n=K.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function A(m){return{agentSetState:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentStateHistory:function(t,r,i,a,s,o,u,c){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},agentTodayStatistics:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createAgent:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgent:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchAgent:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgent:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__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 z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentCallStatistics:function(t,r,i,a,s,o,u,c,l,d){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentInQueue:function(t,r,i,a,s,o,u){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentInQueueStatistics:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentInTeam:function(t,r,i,a,s,o){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentStateHistory:function(t,r,i,a,s,o,u,c,l){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__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 z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentStatusStatisticItem:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchLookupUsersAgentNotExists:function(t,r,i,a,s){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchPauseCauseForAgent:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgent:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentStatus:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}j=e,z.__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={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteAgentSkill:function(u,c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),d.headers),[2,{url:V.format(t),options:r}]}})})},patchAgentSkill:function(c,l,d,_){return void 0===_&&(_={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},readAgentSkill:function(u,c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),d.headers),[2,{url:V.format(t),options:r}]}})})},searchAgentSkill:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),f.headers),[2,{url:V.format(t),options:r}]}})})},searchLookupAgentNotExistsSkill:function(u,c,l,d,_,h){return void 0===h&&(h={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),h.headers),[2,{url:V.format(t),options:r}]}})})},updateAgentSkill:function(c,l,d,_){return void 0===_&&(_={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function d(l){return{createAgentSkill:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgentSkill:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchAgentSkill:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgentSkill:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentSkill:function(t,r,i,a,s,o,u,c){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchLookupAgentNotExistsSkill:function(t,r,i,a,s,o){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentSkill:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}B=e,z.__extends(J,B),J.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)})},J.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)})},J.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)})},J.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)})},J.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)})},J.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)})},J.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 B,M=J;function J(){return null!==B&&B.apply(this,arguments)||this}function N(v){var e=this;return{createAgentTeam:function(c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/call_center/teams",!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteAgentTeam:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},readAgentTeam:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},searchAgentTeam:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/call_center/teams",!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),g.headers),[2,{url:V.format(t),options:r}]}})})},updateAgentTeam:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function $(d){return{createAgentTeam:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,N(d).createAgentTeam(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteAgentTeam:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,N(d).deleteAgentTeam(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readAgentTeam:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,N(d).readAgentTeam(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchAgentTeam:function(t,r,i,a,s,o,u,c,l){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,N(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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateAgentTeam:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,N(d).updateAgentTeam(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Y=e,z.__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={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/storage/backend_profiles",!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteBackendProfile:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},patchBackendProfile:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},readBackendProfile:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},searchBackendProfile:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/storage/backend_profiles",!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),p.headers),[2,{url:V.format(t),options:r}]}})})},updateBackendProfile:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function _(c){return{createBackendProfile:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteBackendProfile:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchBackendProfile:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readBackendProfile:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchBackendProfile:function(t,r,i,a,s,o,u){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateBackendProfile:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ne=e,z.__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={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/call_center/buckets",!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteBucket:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},readBucket:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},searchBucket:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/call_center/buckets",!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),p.headers),[2,{url:V.format(t),options:r}]}})})},updateBucket:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function se(c){return{createBucket:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteBucket:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readBucket:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchBucket:function(t,r,i,a,s,o,u){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateBucket:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}oe=e,z.__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={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/calendars",!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteCalendar:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},readCalendar:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},searchCalendar:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/calendars",!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),p.headers),[2,{url:V.format(t),options:r}]}})})},searchTimezones:function(u,c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/calendars/timezones",!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),d.headers),[2,{url:V.format(t),options:r}]}})})},updateCalendar:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function p(c){return{createCalendar:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCalendar:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCalendar:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchCalendar:function(t,r,i,a,s,o,u){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchTimezones:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCalendar:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}de=e,z.__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 D(N){var e=this;return{aggregateHistoryCall:function(c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/calls/history/aggregate",!0),N&&(n=N.baseOptions),r=z.__assign(z.__assign({method:"POST"},n),l),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},blindTransferCall:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),N&&(n=N.baseOptions),r=z.__assign(z.__assign({method:"PATCH"},n),d),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},confirmPush:function(u,c){return void 0===c&&(c={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),N&&(n=N.baseOptions),r=z.__assign(z.__assign({method:"PATCH"},n),c),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.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=z.__assign(z.__assign(z.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),c.headers),[2,{url:V.format(t),options:r}]}})})},createCall:function(c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/calls",!0),N&&(n=N.baseOptions),r=z.__assign(z.__assign({method:"POST"},n),l),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},createCallAnnotation:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),N&&(n=N.baseOptions),r=z.__assign(z.__assign({method:"POST"},n),d),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteCallAnnotation:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),N&&(n=N.baseOptions),r=z.__assign(z.__assign({method:"DELETE"},n),l),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},dtmfCall:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),N&&(n=N.baseOptions),r=z.__assign(z.__assign({method:"PATCH"},n),d),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},eavesdropCall:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),N&&(n=N.baseOptions),r=z.__assign(z.__assign({method:"POST"},n),d),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},hangupCall:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),N&&(n=N.baseOptions),r=z.__assign(z.__assign({method:"DELETE"},n),d),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},holdCall:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),N&&(n=N.baseOptions),r=z.__assign(z.__assign({method:"PATCH"},n),d),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},readCall:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),N&&(n=N.baseOptions),r=z.__assign(z.__assign({method:"GET"},n),l),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.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,T,P,O,k,I,W,X,E,x,Q){return void 0===Q&&(Q={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/calls/active",!0),N&&(n=N.baseOptions),r=z.__assign(z.__assign({method:"GET"},n),Q),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 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!==T&&(a.number=T),P&&(a.direction=P),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),E&&(a.supervisor_id=E),x&&(a.state=x),t.query=z.__assign(z.__assign(z.__assign({},t.query),a),Q.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),Q.headers),[2,{url:V.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,T,P,O,k,I,W,X,E,x,Q,j,U,G,B,M,L,D,F,J,H){return void 0===H&&(H={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/calls/history",!0),N&&(n=N.baseOptions),r=z.__assign(z.__assign({method:"GET"},n),H),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 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!==T&&(a.number=T),void 0!==P&&(a.direction=P),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),E&&(a.id=E),x&&(a.transfer_from=x),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),F&&(a.owner_id=F),J&&(a.grantee_id=J),t.query=z.__assign(z.__assign(z.__assign({},t.query),a),H.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),H.headers),[2,{url:V.format(t),options:r}]}})})},unHoldCall:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),N&&(n=N.baseOptions),r=z.__assign(z.__assign({method:"PATCH"},n),d),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},updateCallAnnotation:function(c,l,d,_){return void 0===_&&(_={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),N&&(n=N.baseOptions),r=z.__assign(z.__assign({method:"PUT"},n),_),i={},a={},N&&N.apiKey)?"function"!=typeof N.apiKey?[3,2]:[4,N.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,N.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=z.__assign(z.__assign(z.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function F(M){return{aggregateHistoryCall:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,D(M).aggregateHistoryCall(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},blindTransferCall:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,D(M).blindTransferCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},confirmPush:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,D(M).confirmPush(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createCall:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,D(M).createCall(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createCallAnnotation:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,D(M).createCallAnnotation(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCallAnnotation:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,D(M).deleteCallAnnotation(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},dtmfCall:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,D(M).dtmfCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},eavesdropCall:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,D(M).eavesdropCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},hangupCall:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,D(M).hangupCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},holdCall:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,D(M).holdCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCall:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,D(M).readCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__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,T,P,O,k){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,D(M).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,T,P,O,k)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__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,T,P,O,k,I,W,X,E,x,Q,j,U,G,B){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,D(M).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,T,P,O,k,I,W,X,E,x,Q,j,U,G,B)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},unHoldCall:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,D(M).unHoldCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCallAnnotation:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,D(M).updateCallAnnotation(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}pe=e,z.__extends(n,pe),n.prototype.aggregateHistoryCall=function(e,t){var n=this;return F(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 F(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 F(this.configuration).confirmPush(e,t).then(function(e){return e(n.axios,n.basePath)})},n.prototype.createCall=function(e,t){var n=this;return F(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 F(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 F(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 F(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 F(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 F(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 F(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 F(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,T,P){var O=this;return F(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,T,P).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,T,P,O,k,I,W,X,x,Q,j,U,G){var E=this;return F(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,T,P,O,k,I,W,X,x,Q,j,U,G).then(function(e){return e(E.axios,E.basePath)})},n.prototype.unHoldCall=function(e,t,n){var r=this;return F(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 F(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={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/storage/cognitive_profiles",!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteCognitiveProfile:function(u,c){return void 0===c&&(c={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),c.headers),[2,{url:V.format(t),options:r}]}})})},patchCognitiveProfile:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},readCognitiveProfile:function(u,c){return void 0===c&&(c={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),c.headers),[2,{url:V.format(t),options:r}]}})})},searchCognitiveProfile:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/storage/cognitive_profiles",!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),g.headers),[2,{url:V.format(t),options:r}]}})})},updateCognitiveProfile:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function f(d){return{createCognitiveProfile:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCognitiveProfile:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchCognitiveProfile:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCognitiveProfile:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchCognitiveProfile:function(t,r,i,a,s,o,u,c,l){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCognitiveProfile:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ve=e,z.__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={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/call_center/communication_type",!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteCommunicationType:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},readCommunicationType:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},searchCommunicationType:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/call_center/communication_type",!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),p.headers),[2,{url:V.format(t),options:r}]}})})},updateCommunicationType:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function me(c){return{createCommunicationType:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteCommunicationType:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readCommunicationType:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchCommunicationType:function(t,r,i,a,s,o,u){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateCommunicationType:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}qe=e,z.__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={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/email/profile",!0),p&&(n=p.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteEmailProfile:function(u,c){return void 0===c&&(c={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),p&&(n=p.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),c.headers),[2,{url:V.format(t),options:r}]}})})},patchEmailProfile:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),p&&(n=p.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},readEmailProfile:function(u,c){return void 0===c&&(c={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),p&&(n=p.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),c.headers),[2,{url:V.format(t),options:r}]}})})},searchEmailProfile:function(u,c,l,d,_,h){return void 0===h&&(h={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/email/profile",!0),p&&(n=p.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),h.headers),[2,{url:V.format(t),options:r}]}})})},testEmailProfile:function(u,c){return void 0===c&&(c={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling testEmailProfile.");return(t="/email/profile/{id}/test".replace("{id}",encodeURIComponent(String(u))),t=V.parse(t,!0),p&&(n=p.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),c.headers),[2,{url:V.format(t),options:r}]}})})},updateEmailProfile:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),p&&(n=p.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function c(u){return{createEmailProfile:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteEmailProfile:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchEmailProfile:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readEmailProfile:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchEmailProfile:function(t,r,i,a,s,o){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},testEmailProfile:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Re(u).testEmailProfile(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateEmailProfile:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Se=e,z.__extends(Te,Se),Te.prototype.createEmailProfile=function(e,t){var n=this;return c(this.configuration).createEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},Te.prototype.deleteEmailProfile=function(e,t){var n=this;return c(this.configuration).deleteEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},Te.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)})},Te.prototype.readEmailProfile=function(e,t){var n=this;return c(this.configuration).readEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},Te.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)})},Te.prototype.testEmailProfile=function(e,t){var n=this;return c(this.configuration).testEmailProfile(e,t).then(function(e){return e(n.axios,n.basePath)})},Te.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=Te;function Te(){return null!==Se&&Se.apply(this,arguments)||this}function Pe(d){var e=this;return{deleteFiles:function(c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/storage/file",!0),d&&(n=d.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function Oe(i){return{deleteFiles:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Pe(i).deleteFiles(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}ke=e,z.__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={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/storage/transcript_file",!0),_&&(n=_.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteFileTranscript:function(c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/storage/transcript_file",!0),_&&(n=_.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},getFileTranscriptPhrases:function(u,c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),_&&(n=_.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),d.headers),[2,{url:V.format(t),options:r}]}})})}}}function Ee(s){return{createFileTranscript:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteFileTranscript:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},getFileTranscriptPhrases:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}xe=e,z.__extends(je,xe),je.prototype.createFileTranscript=function(e,t){var n=this;return Ee(this.configuration).createFileTranscript(e,t).then(function(e){return e(n.axios,n.basePath)})},je.prototype.deleteFileTranscript=function(e,t){var n=this;return Ee(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 Ee(this.configuration).getFileTranscriptPhrases(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var xe,Qe=je;function je(){return null!==xe&&xe.apply(this,arguments)||this}function Ue(f){var e=this;return{createImportTemplate:function(c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/storage/import_templates",!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteImportTemplate:function(u,c){return void 0===c&&(c={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),c.headers),[2,{url:V.format(t),options:r}]}})})},patchImportTemplate:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},readImportTemplate:function(u,c){return void 0===c&&(c={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),c.headers),[2,{url:V.format(t),options:r}]}})})},searchImportTemplate:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/storage/import_templates",!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),p.headers),[2,{url:V.format(t),options:r}]}})})},updateImportTemplate:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function Ge(c){return{createImportTemplate:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteImportTemplate:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchImportTemplate:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readImportTemplate:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchImportTemplate:function(t,r,i,a,s,o,u){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateImportTemplate:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Be=e,z.__extends(He,Be),He.prototype.createImportTemplate=function(e,t){var n=this;return Ge(this.configuration).createImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},He.prototype.deleteImportTemplate=function(e,t){var n=this;return Ge(this.configuration).deleteImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},He.prototype.patchImportTemplate=function(e,t,n){var r=this;return Ge(this.configuration).patchImportTemplate(e,t,n).then(function(e){return e(r.axios,r.basePath)})},He.prototype.readImportTemplate=function(e,t){var n=this;return Ge(this.configuration).readImportTemplate(e,t).then(function(e){return e(n.axios,n.basePath)})},He.prototype.searchImportTemplate=function(e,t,n,r,i,a,s){var o=this;return Ge(this.configuration).searchImportTemplate(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},He.prototype.updateImportTemplate=function(e,t,n){var r=this;return Ge(this.configuration).updateImportTemplate(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Be,Me=He;function He(){return null!==Be&&Be.apply(this,arguments)||this}function Le(y){var e=this;return{createList:function(c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/call_center/list",!0),y&&(n=y.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},createListCommunication:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),y&&(n=y.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteList:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),y&&(n=y.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},deleteListCommunication:function(u,c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),y&&(n=y.baseOptions),r=z.__assign(z.__assign({method:"DELETE"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),d.headers),[2,{url:V.format(t),options:r}]}})})},readList:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),y&&(n=y.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},readListCommunication:function(u,c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),y&&(n=y.baseOptions),r=z.__assign(z.__assign({method:"GET"},n),d),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),d.headers),[2,{url:V.format(t),options:r}]}})})},searchList:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/call_center/list",!0),y&&(n=y.baseOptions),r=z.__assign(z.__assign({method:"GET"},n),p),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),t.query=z.__assign(z.__assign(z.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),p.headers),[2,{url:V.format(t),options:r}]}})})},searchListCommunication:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),y&&(n=y.baseOptions),r=z.__assign(z.__assign({method:"GET"},n),v),i={},a={},y&&y.apiKey)?"function"!=typeof y.apiKey?[3,2]:[4,y.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,y.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),p&&(a.id=p),void 0!==f&&(a["expire_at.from"]=f),void 0!==g&&(a["expire_at.to"]=g),t.query=z.__assign(z.__assign(z.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),v.headers),[2,{url:V.format(t),options:r}]}})})},updateList:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),y&&(n=y.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},updateListCommunication:function(c,l,d,_){return void 0===_&&(_={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),y&&(n=y.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function g(_){return{createList:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Le(_).createList(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createListCommunication:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Le(_).createListCommunication(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteList:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Le(_).deleteList(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteListCommunication:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Le(_).deleteListCommunication(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readList:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Le(_).readList(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readListCommunication:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Le(_).readListCommunication(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchList:function(t,r,i,a,s,o,u){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Le(_).searchList(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchListCommunication:function(t,r,i,a,s,o,u,c,l,d){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Le(_).searchListCommunication(t,r,i,a,s,o,u,c,l,d)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateList:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Le(_).updateList(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateListCommunication:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Le(_).updateListCommunication(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}De=e,z.__extends(Je,De),Je.prototype.createList=function(e,t){var n=this;return g(this.configuration).createList(e,t).then(function(e){return e(n.axios,n.basePath)})},Je.prototype.createListCommunication=function(e,t,n){var r=this;return g(this.configuration).createListCommunication(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Je.prototype.deleteList=function(e,t,n){var r=this;return g(this.configuration).deleteList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Je.prototype.deleteListCommunication=function(e,t,n,r){var i=this;return g(this.configuration).deleteListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Je.prototype.readList=function(e,t,n){var r=this;return g(this.configuration).readList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Je.prototype.readListCommunication=function(e,t,n,r){var i=this;return g(this.configuration).readListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Je.prototype.searchList=function(e,t,n,r,i,a,s){var o=this;return g(this.configuration).searchList(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Je.prototype.searchListCommunication=function(e,t,n,r,i,a,s,o,u,c){var l=this;return g(this.configuration).searchListCommunication(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},Je.prototype.updateList=function(e,t,n){var r=this;return g(this.configuration).updateList(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Je.prototype.updateListCommunication=function(e,t,n,r){var i=this;return g(this.configuration).updateListCommunication(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var De,Fe=Je;function Je(){return null!==De&&De.apply(this,arguments)||this}function Ne(f){var e=this;return{deleteMediaFile:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},readMediaFile:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},searchMediaFile:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/storage/media",!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),p.headers),[2,{url:V.format(t),options:r}]}})})}}}function ze(c){return{deleteMediaFile:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readMediaFile:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchMediaFile:function(t,r,i,a,s,o,u){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Ve=e,z.__extends(Ye,Ve),Ye.prototype.deleteMediaFile=function(e,t,n){var r=this;return ze(this.configuration).deleteMediaFile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ye.prototype.readMediaFile=function(e,t,n){var r=this;return ze(this.configuration).readMediaFile(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ye.prototype.searchMediaFile=function(e,t,n,r,i,a,s){var o=this;return ze(this.configuration).searchMediaFile(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})};var Ve,$e=Ye;function Ye(){return null!==Ve&&Ve.apply(this,arguments)||this}function C(P){var e=this;return{attemptCallback:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),P&&(n=P.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},attemptResult:function(c,l,d,_,h){return void 0===h&&(h={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),P&&(n=P.baseOptions),r=z.__assign(z.__assign({method:"PATCH"},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 i["Content-Type"]="application/json",t.query=z.__assign(z.__assign(z.__assign({},t.query),a),h.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),h.headers),u="string"!=typeof _||"application/json"===r.headers["Content-Type"],r.data=u?JSON.stringify(void 0!==_?_:{}):_||"",[2,{url:V.format(t),options:r}]}})})},attemptsRenewalResult:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),P&&(n=P.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},createAttempt:function(c,l,d,_){return void 0===_&&(_={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),P&&(n=P.baseOptions),r=z.__assign(z.__assign({method:"POST"},n),_),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=z.__assign(z.__assign(z.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},createMember:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),P&&(n=P.baseOptions),r=z.__assign(z.__assign({method:"POST"},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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},createMemberBulk:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),P&&(n=P.baseOptions),r=z.__assign(z.__assign({method:"POST"},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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteMember:function(u,c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),P&&(n=P.baseOptions),r=z.__assign(z.__assign({method:"DELETE"},n),d),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),d.headers),[2,{url:V.format(t),options:r}]}})})},deleteMembers:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),P&&(n=P.baseOptions),r=z.__assign(z.__assign({method:"DELETE"},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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},patchMember:function(c,l,d,_){return void 0===_&&(_={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),P&&(n=P.baseOptions),r=z.__assign(z.__assign({method:"PATCH"},n),_),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=z.__assign(z.__assign(z.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},readMember:function(u,c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),P&&(n=P.baseOptions),r=z.__assign(z.__assign({method:"GET"},n),d),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),d.headers),[2,{url:V.format(t),options:r}]}})})},resetMembers:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),P&&(n=P.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.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={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/call_center/queues/attempts/active",!0),P&&(n=P.baseOptions),r=z.__assign(z.__assign({method:"GET"},n),K),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),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=z.__assign(z.__assign(z.__assign({},t.query),a),K.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),K.headers),[2,{url:V.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={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/call_center/queues/attempts/history",!0),P&&(n=P.baseOptions),r=z.__assign(z.__assign({method:"GET"},n),K),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),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=z.__assign(z.__assign(z.__assign({},t.query),a),K.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),K.headers),[2,{url:V.format(t),options:r}]}})})},searchMemberAttempts:function(u,c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),P&&(n=P.baseOptions),r=z.__assign(z.__assign({method:"GET"},n),d),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==l&&(a.domain_id=l),t.query=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),d.headers),[2,{url:V.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,T){return void 0===T&&(T={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),P&&(n=P.baseOptions),r=z.__assign(z.__assign({method:"GET"},n),T),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),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=z.__assign(z.__assign(z.__assign({},t.query),a),T.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),T.headers),[2,{url:V.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,T){return void 0===T&&(T={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/call_center/members",!0),P&&(n=P.baseOptions),r=z.__assign(z.__assign({method:"GET"},n),T),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),p&&(a.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=z.__assign(z.__assign(z.__assign({},t.query),a),T.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),T.headers),[2,{url:V.format(t),options:r}]}})})},updateMember:function(c,l,d,_){return void 0===_&&(_={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),P&&(n=P.baseOptions),r=z.__assign(z.__assign({method:"PUT"},n),_),i={},a={},P&&P.apiKey)?"function"!=typeof P.apiKey?[3,2]:[4,P.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,P.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=z.__assign(z.__assign(z.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function R(A){return{attemptCallback:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},attemptResult:function(t,r,i,a,s){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},attemptsRenewalResult:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createAttempt:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createMember:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createMemberBulk:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteMember:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteMembers:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchMember:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readMember:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},resetMembers:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__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 z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__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 z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchMemberAttempts:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__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 z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__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 z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateMember:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Ze=e,z.__extends(r,Ze),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 Ze,et=r;function r(){return null!==Ze&&Ze.apply(this,arguments)||this}function tt(g){var e=this;return{createOutboundResourceGroup:function(c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/call_center/resource_group",!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},createOutboundResourceInGroup:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteOutboundResourceGroup:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},deleteOutboundResourceInGroup:function(u,c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),d.headers),[2,{url:V.format(t),options:r}]}})})},readOutboundResourceGroup:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},readOutboundResourceInGroup:function(u,c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),d.headers),[2,{url:V.format(t),options:r}]}})})},searchOutboundResourceGroup:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/call_center/resource_group",!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),p.headers),[2,{url:V.format(t),options:r}]}})})},searchOutboundResourceInGroup:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),f.headers),[2,{url:V.format(t),options:r}]}})})},updateOutboundResourceGroup:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},updateOutboundResourceInGroup:function(c,l,d,_){return void 0===_&&(_={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function v(l){return{createOutboundResourceGroup:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).createOutboundResourceGroup(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createOutboundResourceInGroup:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).createOutboundResourceInGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResourceGroup:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).deleteOutboundResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResourceInGroup:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).deleteOutboundResourceInGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResourceGroup:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).readOutboundResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResourceInGroup:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).readOutboundResourceInGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResourceGroup:function(t,r,i,a,s,o,u){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).searchOutboundResourceGroup(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResourceInGroup:function(t,r,i,a,s,o,u,c){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).searchOutboundResourceInGroup(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResourceGroup:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).updateOutboundResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResourceInGroup:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,tt(l).updateOutboundResourceInGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}nt=e,z.__extends(it,nt),it.prototype.createOutboundResourceGroup=function(e,t){var n=this;return v(this.configuration).createOutboundResourceGroup(e,t).then(function(e){return e(n.axios,n.basePath)})},it.prototype.createOutboundResourceInGroup=function(e,t,n){var r=this;return v(this.configuration).createOutboundResourceInGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},it.prototype.deleteOutboundResourceGroup=function(e,t,n){var r=this;return v(this.configuration).deleteOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},it.prototype.deleteOutboundResourceInGroup=function(e,t,n,r){var i=this;return v(this.configuration).deleteOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},it.prototype.readOutboundResourceGroup=function(e,t,n){var r=this;return v(this.configuration).readOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},it.prototype.readOutboundResourceInGroup=function(e,t,n,r){var i=this;return v(this.configuration).readOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},it.prototype.searchOutboundResourceGroup=function(e,t,n,r,i,a,s){var o=this;return v(this.configuration).searchOutboundResourceGroup(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},it.prototype.searchOutboundResourceInGroup=function(e,t,n,r,i,a,s,o){var u=this;return v(this.configuration).searchOutboundResourceInGroup(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},it.prototype.updateOutboundResourceGroup=function(e,t,n){var r=this;return v(this.configuration).updateOutboundResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},it.prototype.updateOutboundResourceInGroup=function(e,t,n,r){var i=this;return v(this.configuration).updateOutboundResourceInGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var nt,rt=it;function it(){return null!==nt&&nt.apply(this,arguments)||this}function at(g){var e=this;return{createOutboundResource:function(c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/call_center/resources",!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},createOutboundResourceDisplay:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteOutboundResource:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},deleteOutboundResourceDisplay:function(u,c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),d.headers),[2,{url:V.format(t),options:r}]}})})},patchOutboundResource:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},readOutboundResource:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},readOutboundResourceDisplay:function(u,c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),d.headers),[2,{url:V.format(t),options:r}]}})})},searchOutboundResource:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/call_center/resources",!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),p.headers),[2,{url:V.format(t),options:r}]}})})},searchOutboundResourceDisplay:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),f.headers),[2,{url:V.format(t),options:r}]}})})},updateOutboundResource:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},updateOutboundResourceDisplay:function(c,l,d,_){return void 0===_&&(_={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function y(l){return{createOutboundResource:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).createOutboundResource(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createOutboundResourceDisplay:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).createOutboundResourceDisplay(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResource:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).deleteOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteOutboundResourceDisplay:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).deleteOutboundResourceDisplay(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchOutboundResource:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).patchOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResource:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).readOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readOutboundResourceDisplay:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).readOutboundResourceDisplay(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResource:function(t,r,i,a,s,o,u){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).searchOutboundResource(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchOutboundResourceDisplay:function(t,r,i,a,s,o,u,c){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).searchOutboundResourceDisplay(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResource:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).updateOutboundResource(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateOutboundResourceDisplay:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,at(l).updateOutboundResourceDisplay(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}st=e,z.__extends(ut,st),ut.prototype.createOutboundResource=function(e,t){var n=this;return y(this.configuration).createOutboundResource(e,t).then(function(e){return e(n.axios,n.basePath)})},ut.prototype.createOutboundResourceDisplay=function(e,t,n){var r=this;return y(this.configuration).createOutboundResourceDisplay(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ut.prototype.deleteOutboundResource=function(e,t,n){var r=this;return y(this.configuration).deleteOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ut.prototype.deleteOutboundResourceDisplay=function(e,t,n,r){var i=this;return y(this.configuration).deleteOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},ut.prototype.patchOutboundResource=function(e,t,n){var r=this;return y(this.configuration).patchOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ut.prototype.readOutboundResource=function(e,t,n){var r=this;return y(this.configuration).readOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ut.prototype.readOutboundResourceDisplay=function(e,t,n,r){var i=this;return y(this.configuration).readOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},ut.prototype.searchOutboundResource=function(e,t,n,r,i,a,s){var o=this;return y(this.configuration).searchOutboundResource(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},ut.prototype.searchOutboundResourceDisplay=function(e,t,n,r,i,a,s,o){var u=this;return y(this.configuration).searchOutboundResourceDisplay(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},ut.prototype.updateOutboundResource=function(e,t,n){var r=this;return y(this.configuration).updateOutboundResource(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ut.prototype.updateOutboundResourceDisplay=function(e,t,n,r){var i=this;return y(this.configuration).updateOutboundResourceDisplay(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var st,ot=ut;function ut(){return null!==st&&st.apply(this,arguments)||this}function ct(g){var e=this;return{createQueueBucket:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteQueueBucket:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},patchQueueBucket:function(c,l,d,_){return void 0===_&&(_={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},readQueueBucket:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},searchQueueBucket:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),f.headers),[2,{url:V.format(t),options:r}]}})})},updateQueueBucket:function(c,l,d,_){return void 0===_&&(_={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function lt(l){return{createQueueBucket:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,ct(l).createQueueBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueBucket:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,ct(l).deleteQueueBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueueBucket:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,ct(l).patchQueueBucket(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueBucket:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,ct(l).readQueueBucket(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueBucket:function(t,r,i,a,s,o,u,c){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,ct(l).searchQueueBucket(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueBucket:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,ct(l).updateQueueBucket(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}dt=e,z.__extends(ht,dt),ht.prototype.createQueueBucket=function(e,t,n){var r=this;return lt(this.configuration).createQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ht.prototype.deleteQueueBucket=function(e,t,n){var r=this;return lt(this.configuration).deleteQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ht.prototype.patchQueueBucket=function(e,t,n,r){var i=this;return lt(this.configuration).patchQueueBucket(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},ht.prototype.readQueueBucket=function(e,t,n){var r=this;return lt(this.configuration).readQueueBucket(e,t,n).then(function(e){return e(r.axios,r.basePath)})},ht.prototype.searchQueueBucket=function(e,t,n,r,i,a,s,o){var u=this;return lt(this.configuration).searchQueueBucket(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},ht.prototype.updateQueueBucket=function(e,t,n,r){var i=this;return lt(this.configuration).updateQueueBucket(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var dt,_t=ht;function ht(){return null!==dt&&dt.apply(this,arguments)||this}function pt(y){var e=this;return{createQueueHook:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),y&&(n=y.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteQueueHook:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),y&&(n=y.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},patchQueueHook:function(c,l,d,_){return void 0===_&&(_={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),y&&(n=y.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},readQueueHook:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),y&&(n=y.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},searchQueueHook:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),y&&(n=y.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),v.headers),[2,{url:V.format(t),options:r}]}})})},updateQueueHook:function(c,l,d,_){return void 0===_&&(_={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),y&&(n=y.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function ft(_){return{createQueueHook:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,pt(_).createQueueHook(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueHook:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,pt(_).deleteQueueHook(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueueHook:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,pt(_).patchQueueHook(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueHook:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,pt(_).readQueueHook(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueHook:function(t,r,i,a,s,o,u,c,l,d){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,pt(_).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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueHook:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,pt(_).updateQueueHook(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}gt=e,z.__extends(yt,gt),yt.prototype.createQueueHook=function(e,t,n){var r=this;return ft(this.configuration).createQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},yt.prototype.deleteQueueHook=function(e,t,n){var r=this;return ft(this.configuration).deleteQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},yt.prototype.patchQueueHook=function(e,t,n,r){var i=this;return ft(this.configuration).patchQueueHook(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},yt.prototype.readQueueHook=function(e,t,n){var r=this;return ft(this.configuration).readQueueHook(e,t,n).then(function(e){return e(r.axios,r.basePath)})},yt.prototype.searchQueueHook=function(e,t,n,r,i,a,s,o,u,c){var l=this;return ft(this.configuration).searchQueueHook(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},yt.prototype.updateQueueHook=function(e,t,n,r){var i=this;return ft(this.configuration).updateQueueHook(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var gt,vt=yt;function yt(){return null!==gt&>.apply(this,arguments)||this}function bt(g){var e=this;return{createQueueResourceGroup:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteQueueResourceGroup:function(u,c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),d.headers),[2,{url:V.format(t),options:r}]}})})},readQueueResourceGroup:function(u,c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),d.headers),[2,{url:V.format(t),options:r}]}})})},searchQueueResourceGroup:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),f.headers),[2,{url:V.format(t),options:r}]}})})},updateQueueResourceGroup:function(c,l,d,_){return void 0===_&&(_={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),g&&(n=g.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function wt(l){return{createQueueResourceGroup:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,bt(l).createQueueResourceGroup(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueResourceGroup:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,bt(l).deleteQueueResourceGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueResourceGroup:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,bt(l).readQueueResourceGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueueResourceGroup:function(t,r,i,a,s,o,u,c){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,bt(l).searchQueueResourceGroup(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueResourceGroup:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,bt(l).updateQueueResourceGroup(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}mt=e,z.__extends(At,mt),At.prototype.createQueueResourceGroup=function(e,t,n){var r=this;return wt(this.configuration).createQueueResourceGroup(e,t,n).then(function(e){return e(r.axios,r.basePath)})},At.prototype.deleteQueueResourceGroup=function(e,t,n,r){var i=this;return wt(this.configuration).deleteQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},At.prototype.readQueueResourceGroup=function(e,t,n,r){var i=this;return wt(this.configuration).readQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},At.prototype.searchQueueResourceGroup=function(e,t,n,r,i,a,s,o){var u=this;return wt(this.configuration).searchQueueResourceGroup(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},At.prototype.updateQueueResourceGroup=function(e,t,n,r){var i=this;return wt(this.configuration).updateQueueResourceGroup(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var mt,qt=At;function At(){return null!==mt&&mt.apply(this,arguments)||this}function Ct(w){var e=this;return{createQueue:function(c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/call_center/queues",!0),w&&(n=w.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteQueue:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),w&&(n=w.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},patchQueue:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),w&&(n=w.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},readQueue:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),w&&(n=w.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},searchQueue:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/call_center/queues",!0),w&&(n=w.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),f.headers),[2,{url:V.format(t),options:r}]}})})},searchQueueReportGeneral:function(u,c,l,d,_,h,p,f,g,v,y,b){return void 0===b&&(b={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/call_center/queues/reports/general",!0),w&&(n=w.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),b.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),b.headers),[2,{url:V.format(t),options:r}]}})})},updateQueue:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),w&&(n=w.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function b(p){return{createQueue:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Ct(p).createQueue(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueue:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Ct(p).deleteQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueue:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Ct(p).patchQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueue:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Ct(p).readQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchQueue:function(t,r,i,a,s,o,u,c){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Ct(p).searchQueue(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__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 z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Ct(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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueue:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Ct(p).updateQueue(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Rt=e,z.__extends(Kt,Rt),Kt.prototype.createQueue=function(e,t){var n=this;return b(this.configuration).createQueue(e,t).then(function(e){return e(n.axios,n.basePath)})},Kt.prototype.deleteQueue=function(e,t,n){var r=this;return b(this.configuration).deleteQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Kt.prototype.patchQueue=function(e,t,n){var r=this;return b(this.configuration).patchQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Kt.prototype.readQueue=function(e,t,n){var r=this;return b(this.configuration).readQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Kt.prototype.searchQueue=function(e,t,n,r,i,a,s,o){var u=this;return b(this.configuration).searchQueue(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},Kt.prototype.searchQueueReportGeneral=function(e,t,n,r,i,a,s,o,u,c,l,d){var _=this;return b(this.configuration).searchQueueReportGeneral(e,t,n,r,i,a,s,o,u,c,l,d).then(function(e){return e(_.axios,_.basePath)})},Kt.prototype.updateQueue=function(e,t,n){var r=this;return b(this.configuration).updateQueue(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Rt,St=Kt;function Kt(){return null!==Rt&&Rt.apply(this,arguments)||this}function Tt(q){var e=this;return{createQueueSkill:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),q&&(n=q.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteQueueSkill:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),q&&(n=q.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},patchQueueSkill:function(c,l,d,_){return void 0===_&&(_={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),q&&(n=q.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},readQueueSkill:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),q&&(n=q.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},searchQueueSkill:function(u,c,l,d,_,h,p,f,g,v,y,b,w,m){return void 0===m&&(m={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),q&&(n=q.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),m.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),m.headers),[2,{url:V.format(t),options:r}]}})})},updateQueueSkill:function(c,l,d,_){return void 0===_&&(_={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),q&&(n=q.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function Pt(g){return{createQueueSkill:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Tt(g).createQueueSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteQueueSkill:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Tt(g).deleteQueueSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchQueueSkill:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Tt(g).patchQueueSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readQueueSkill:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Tt(g).readQueueSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__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 z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Tt(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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateQueueSkill:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Tt(g).updateQueueSkill(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Ot=e,z.__extends(It,Ot),It.prototype.createQueueSkill=function(e,t,n){var r=this;return Pt(this.configuration).createQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},It.prototype.deleteQueueSkill=function(e,t,n){var r=this;return Pt(this.configuration).deleteQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},It.prototype.patchQueueSkill=function(e,t,n,r){var i=this;return Pt(this.configuration).patchQueueSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},It.prototype.readQueueSkill=function(e,t,n){var r=this;return Pt(this.configuration).readQueueSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},It.prototype.searchQueueSkill=function(e,t,n,r,i,a,s,o,u,c,l,d,_,h){var p=this;return Pt(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)})},It.prototype.updateQueueSkill=function(e,t,n,r){var i=this;return Pt(this.configuration).updateQueueSkill(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})};var Ot,kt=It;function It(){return null!==Ot&&Ot.apply(this,arguments)||this}function Wt(y){var e=this;return{createRegion:function(c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/regions",!0),y&&(n=y.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteRegion:function(u,c){return void 0===c&&(c={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),y&&(n=y.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),c.headers),[2,{url:V.format(t),options:r}]}})})},patchRegion:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),y&&(n=y.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},readRegion:function(u,c){return void 0===c&&(c={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),y&&(n=y.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),c.headers),[2,{url:V.format(t),options:r}]}})})},searchRegion:function(u,c,l,d,_,h,p,f,g,v){return void 0===v&&(v={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/regions",!0),y&&(n=y.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),v.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),v.headers),[2,{url:V.format(t),options:r}]}})})},updateRegion:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),y&&(n=y.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function Xt(_){return{createRegion:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(_).createRegion(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRegion:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(_).deleteRegion(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchRegion:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(_).patchRegion(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRegion:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(_).readRegion(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRegion:function(t,r,i,a,s,o,u,c,l,d){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(_).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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRegion:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Wt(_).updateRegion(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Et=e,z.__extends(Qt,Et),Qt.prototype.createRegion=function(e,t){var n=this;return Xt(this.configuration).createRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},Qt.prototype.deleteRegion=function(e,t){var n=this;return Xt(this.configuration).deleteRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},Qt.prototype.patchRegion=function(e,t,n){var r=this;return Xt(this.configuration).patchRegion(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Qt.prototype.readRegion=function(e,t){var n=this;return Xt(this.configuration).readRegion(e,t).then(function(e){return e(n.axios,n.basePath)})},Qt.prototype.searchRegion=function(e,t,n,r,i,a,s,o,u,c){var l=this;return Xt(this.configuration).searchRegion(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(l.axios,l.basePath)})},Qt.prototype.updateRegion=function(e,t,n){var r=this;return Xt(this.configuration).updateRegion(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Et,xt=Qt;function Qt(){return null!==Et&&Et.apply(this,arguments)||this}function jt(v){var e=this;return{createChatPlan:function(c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/routing/outbound/chat",!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteChatPlan:function(u,c){return void 0===c&&(c={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),c.headers),[2,{url:V.format(t),options:r}]}})})},patchChatPlan:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},readChatPlan:function(u,c){return void 0===c&&(c={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),c.headers),[2,{url:V.format(t),options:r}]}})})},searchChatPlan:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/routing/outbound/chat",!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),g.headers),[2,{url:V.format(t),options:r}]}})})},updateChatPlan:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function Ut(d){return{createChatPlan:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,jt(d).createChatPlan(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteChatPlan:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,jt(d).deleteChatPlan(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchChatPlan:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,jt(d).patchChatPlan(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readChatPlan:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,jt(d).readChatPlan(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchChatPlan:function(t,r,i,a,s,o,u,c,l){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,jt(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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateChatPlan:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,jt(d).updateChatPlan(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Gt=e,z.__extends(Mt,Gt),Mt.prototype.createChatPlan=function(e,t){var n=this;return Ut(this.configuration).createChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},Mt.prototype.deleteChatPlan=function(e,t){var n=this;return Ut(this.configuration).deleteChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},Mt.prototype.patchChatPlan=function(e,t,n){var r=this;return Ut(this.configuration).patchChatPlan(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Mt.prototype.readChatPlan=function(e,t){var n=this;return Ut(this.configuration).readChatPlan(e,t).then(function(e){return e(n.axios,n.basePath)})},Mt.prototype.searchChatPlan=function(e,t,n,r,i,a,s,o,u){var c=this;return Ut(this.configuration).searchChatPlan(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},Mt.prototype.updateChatPlan=function(e,t,n){var r=this;return Ut(this.configuration).updateChatPlan(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Gt,Bt=Mt;function Mt(){return null!==Gt&&Gt.apply(this,arguments)||this}function Ht(b){var e=this;return{createRoutingOutboundCall:function(c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/routing/outbound/calls",!0),b&&(n=b.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteRoutingOutboundCall:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),b&&(n=b.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},movePositionRoutingOutboundCall:function(c,l,d,_){return void 0===_&&(_={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),b&&(n=b.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),_.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},patchRoutingOutboundCall:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),b&&(n=b.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},readRoutingOutboundCall:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),b&&(n=b.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},searchRoutingOutboundCall:function(u,c,l,d,_,h,p,f,g,v,y){return void 0===y&&(y={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/routing/outbound/calls",!0),b&&(n=b.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),y.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),y.headers),[2,{url:V.format(t),options:r}]}})})},updateRoutingOutboundCall:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),b&&(n=b.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function w(h){return{createRoutingOutboundCall:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Ht(h).createRoutingOutboundCall(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRoutingOutboundCall:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Ht(h).deleteRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},movePositionRoutingOutboundCall:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Ht(h).movePositionRoutingOutboundCall(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchRoutingOutboundCall:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Ht(h).patchRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRoutingOutboundCall:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Ht(h).readRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRoutingOutboundCall:function(t,r,i,a,s,o,u,c,l,d,_){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Ht(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=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRoutingOutboundCall:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Ht(h).updateRoutingOutboundCall(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Lt=e,z.__extends(Ft,Lt),Ft.prototype.createRoutingOutboundCall=function(e,t){var n=this;return w(this.configuration).createRoutingOutboundCall(e,t).then(function(e){return e(n.axios,n.basePath)})},Ft.prototype.deleteRoutingOutboundCall=function(e,t,n){var r=this;return w(this.configuration).deleteRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ft.prototype.movePositionRoutingOutboundCall=function(e,t,n,r){var i=this;return w(this.configuration).movePositionRoutingOutboundCall(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},Ft.prototype.patchRoutingOutboundCall=function(e,t,n){var r=this;return w(this.configuration).patchRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ft.prototype.readRoutingOutboundCall=function(e,t,n){var r=this;return w(this.configuration).readRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Ft.prototype.searchRoutingOutboundCall=function(e,t,n,r,i,a,s,o,u,c,l){var d=this;return w(this.configuration).searchRoutingOutboundCall(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(d.axios,d.basePath)})},Ft.prototype.updateRoutingOutboundCall=function(e,t,n){var r=this;return w(this.configuration).updateRoutingOutboundCall(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Lt,Dt=Ft;function Ft(){return null!==Lt&&Lt.apply(this,arguments)||this}function Jt(b){var e=this;return{createRoutingSchema:function(c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/routing/schema",!0),b&&(n=b.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteRoutingSchema:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),b&&(n=b.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},patchRoutingSchema:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),b&&(n=b.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},readRoutingSchema:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),b&&(n=b.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},searchRoutingSchema:function(u,c,l,d,_,h,p,f,g,v,y){return void 0===y&&(y={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/routing/schema",!0),b&&(n=b.baseOptions),r=z.__assign(z.__assign({method:"GET"},n),y),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.id=h),void 0!==p&&(a.name=p),f&&(a.type=f),void 0!==g&&(a.editor=g),v&&(a.tags=v),t.query=z.__assign(z.__assign(z.__assign({},t.query),a),y.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),y.headers),[2,{url:V.format(t),options:r}]}})})},searchRoutingSchemaTags:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/routing/schema/tags",!0),b&&(n=b.baseOptions),r=z.__assign(z.__assign({method:"GET"},n),p),i={},a={},b&&b.apiKey)?"function"!=typeof b.apiKey?[3,2]:[4,b.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,b.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==u&&(a.page=u),void 0!==c&&(a.size=c),void 0!==l&&(a.q=l),void 0!==d&&(a.sort=d),_&&(a.fields=_),h&&(a.type=h),t.query=z.__assign(z.__assign(z.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),p.headers),[2,{url:V.format(t),options:r}]}})})},updateRoutingSchema:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),b&&(n=b.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function m(h){return{createRoutingSchema:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(h).createRoutingSchema(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRoutingSchema:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(h).deleteRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchRoutingSchema:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(h).patchRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRoutingSchema:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(h).readRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRoutingSchema:function(t,r,i,a,s,o,u,c,l,d,_){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(h).searchRoutingSchema(t,r,i,a,s,o,u,c,l,d,_)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRoutingSchemaTags:function(t,r,i,a,s,o,u){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(h).searchRoutingSchemaTags(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRoutingSchema:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,Jt(h).updateRoutingSchema(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Nt=e,z.__extends(Vt,Nt),Vt.prototype.createRoutingSchema=function(e,t){var n=this;return m(this.configuration).createRoutingSchema(e,t).then(function(e){return e(n.axios,n.basePath)})},Vt.prototype.deleteRoutingSchema=function(e,t,n){var r=this;return m(this.configuration).deleteRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Vt.prototype.patchRoutingSchema=function(e,t,n){var r=this;return m(this.configuration).patchRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Vt.prototype.readRoutingSchema=function(e,t,n){var r=this;return m(this.configuration).readRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})},Vt.prototype.searchRoutingSchema=function(e,t,n,r,i,a,s,o,u,c,l){var d=this;return m(this.configuration).searchRoutingSchema(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(d.axios,d.basePath)})},Vt.prototype.searchRoutingSchemaTags=function(e,t,n,r,i,a,s){var o=this;return m(this.configuration).searchRoutingSchemaTags(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},Vt.prototype.updateRoutingSchema=function(e,t,n){var r=this;return m(this.configuration).updateRoutingSchema(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Nt,zt=Vt;function Vt(){return null!==Nt&&Nt.apply(this,arguments)||this}function $t(_){var e=this;return{createRoutingVariable:function(c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/routing/variables",!0),_&&(n=_.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteRoutingVariable:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),_&&(n=_.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},readRoutingVariable:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),_&&(n=_.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},searchRoutingVariable:function(u,c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/routing/variables",!0),_&&(n=_.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),d.headers),[2,{url:V.format(t),options:r}]}})})},updateRoutingVariable:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),_&&(n=_.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function Yt(s){return{createRoutingVariable:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,$t(s).createRoutingVariable(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteRoutingVariable:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,$t(s).deleteRoutingVariable(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readRoutingVariable:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,$t(s).readRoutingVariable(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchRoutingVariable:function(t,r,i,a){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,$t(s).searchRoutingVariable(t,r,i,a)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateRoutingVariable:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,$t(s).updateRoutingVariable(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}Zt=e,z.__extends(tn,Zt),tn.prototype.createRoutingVariable=function(e,t){var n=this;return Yt(this.configuration).createRoutingVariable(e,t).then(function(e){return e(n.axios,n.basePath)})},tn.prototype.deleteRoutingVariable=function(e,t,n){var r=this;return Yt(this.configuration).deleteRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},tn.prototype.readRoutingVariable=function(e,t,n){var r=this;return Yt(this.configuration).readRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})},tn.prototype.searchRoutingVariable=function(e,t,n,r){var i=this;return Yt(this.configuration).searchRoutingVariable(e,t,n,r).then(function(e){return e(i.axios,i.basePath)})},tn.prototype.updateRoutingVariable=function(e,t,n){var r=this;return Yt(this.configuration).updateRoutingVariable(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var Zt,en=tn;function tn(){return null!==Zt&&Zt.apply(this,arguments)||this}function nn(f){var e=this;return{createSkill:function(c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse("/call_center/skills",!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteSkill:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},readSkill:function(u,c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),l.headers),[2,{url:V.format(t),options:r}]}})})},searchSkill:function(u,c,l,d,_,h,p){return void 0===p&&(p={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/call_center/skills",!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),p.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),p.headers),[2,{url:V.format(t),options:r}]}})})},updateSkill:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__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=V.parse(t,!0),f&&(n=f.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function rn(c){return{createSkill:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,nn(c).createSkill(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteSkill:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,nn(c).deleteSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readSkill:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,nn(c).readSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchSkill:function(t,r,i,a,s,o,u){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,nn(c).searchSkill(t,r,i,a,s,o,u)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateSkill:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,nn(c).updateSkill(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}an=e,z.__extends(on,an),on.prototype.createSkill=function(e,t){var n=this;return rn(this.configuration).createSkill(e,t).then(function(e){return e(n.axios,n.basePath)})},on.prototype.deleteSkill=function(e,t,n){var r=this;return rn(this.configuration).deleteSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},on.prototype.readSkill=function(e,t,n){var r=this;return rn(this.configuration).readSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})},on.prototype.searchSkill=function(e,t,n,r,i,a,s){var o=this;return rn(this.configuration).searchSkill(e,t,n,r,i,a,s).then(function(e){return e(o.axios,o.basePath)})},on.prototype.updateSkill=function(e,t,n){var r=this;return rn(this.configuration).updateSkill(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var an,sn=on;function on(){return null!==an&&an.apply(this,arguments)||this}function un(v){var e=this;return{createTrigger:function(c,l){return void 0===l&&(l={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("body","Required parameter body was null or undefined when calling createTrigger.");return(t=V.parse("/trigger",!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),l.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},createTriggerJob:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("triggerId","Required parameter triggerId was null or undefined when calling createTriggerJob.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling createTriggerJob.");return(t="/trigger/{trigger_id}/job".replace("{trigger_id}",encodeURIComponent(String(c))),t=V.parse(t,!0),v&&(n=v.baseOptions),r=z.__assign(z.__assign({method:"POST"},n),d),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return i["Content-Type"]="application/json",t.query=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},deleteTrigger:function(u,c){return void 0===c&&(c={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling deleteTrigger.");return(t="/trigger/{id}".replace("{id}",encodeURIComponent(String(u))),t=V.parse(t,!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),c.headers),[2,{url:V.format(t),options:r}]}})})},patchTrigger:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling patchTrigger.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling patchTrigger.");return(t="/trigger/{id}".replace("{id}",encodeURIComponent(String(c))),t=V.parse(t,!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})},readTrigger:function(u,c){return void 0===c&&(c={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("id","Required parameter id was null or undefined when calling readTrigger.");return(t="/trigger/{id}".replace("{id}",encodeURIComponent(String(u))),t=V.parse(t,!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),c.headers),[2,{url:V.format(t),options:r}]}})})},searchTrigger:function(u,c,l,d,_,h,p,f){return void 0===f&&(f={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:return(t=V.parse("/trigger",!0),v&&(n=v.baseOptions),r=z.__assign(z.__assign({method:"GET"},n),f),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.schema_id=p),t.query=z.__assign(z.__assign(z.__assign({},t.query),a),f.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),f.headers),[2,{url:V.format(t),options:r}]}})})},searchTriggerJob:function(u,c,l,d,_,h,p,f,g){return void 0===g&&(g={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__generator(this,function(e){switch(e.label){case 0:if(null==u)throw new O("triggerId","Required parameter triggerId was null or undefined when calling searchTriggerJob.");return(t="/trigger/{trigger_id}/job".replace("{trigger_id}",encodeURIComponent(String(u))),t=V.parse(t,!0),v&&(n=v.baseOptions),r=z.__assign(z.__assign({method:"GET"},n),g),i={},a={},v&&v.apiKey)?"function"!=typeof v.apiKey?[3,2]:[4,v.apiKey("X-Webitel-Access")]:[3,5];case 1:return s=e.sent(),[3,4];case 2:return[4,v.apiKey];case 3:s=e.sent(),e.label=4;case 4:o=s,i["X-Webitel-Access"]=o,e.label=5;case 5:return void 0!==c&&(a.page=c),void 0!==l&&(a.size=l),void 0!==d&&(a.q=d),void 0!==_&&(a.sort=_),h&&(a.fields=h),void 0!==p&&(a["created_at.from"]=p),void 0!==f&&(a["created_at.to"]=f),t.query=z.__assign(z.__assign(z.__assign({},t.query),a),g.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),g.headers),[2,{url:V.format(t),options:r}]}})})},updateTrigger:function(c,l,d){return void 0===d&&(d={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o,u;return z.__generator(this,function(e){switch(e.label){case 0:if(null==c)throw new O("id","Required parameter id was null or undefined when calling updateTrigger.");if(null==l)throw new O("body","Required parameter body was null or undefined when calling updateTrigger.");return(t="/trigger/{id}".replace("{id}",encodeURIComponent(String(c))),t=V.parse(t,!0),v&&(n=v.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),d.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__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:V.format(t),options:r}]}})})}}}function S(d){return{createTrigger:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,un(d).createTrigger(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},createTriggerJob:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,un(d).createTriggerJob(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},deleteTrigger:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,un(d).deleteTrigger(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},patchTrigger:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,un(d).patchTrigger(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},readTrigger:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,un(d).readTrigger(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchTrigger:function(t,r,i,a,s,o,u,c){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,un(d).searchTrigger(t,r,i,a,s,o,u,c)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},searchTriggerJob:function(t,r,i,a,s,o,u,c,l){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,un(d).searchTriggerJob(t,r,i,a,s,o,u,c,l)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})},updateTrigger:function(t,r,i){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,un(d).updateTrigger(t,r,i)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}cn=e,z.__extends(dn,cn),dn.prototype.createTrigger=function(e,t){var n=this;return S(this.configuration).createTrigger(e,t).then(function(e){return e(n.axios,n.basePath)})},dn.prototype.createTriggerJob=function(e,t,n){var r=this;return S(this.configuration).createTriggerJob(e,t,n).then(function(e){return e(r.axios,r.basePath)})},dn.prototype.deleteTrigger=function(e,t){var n=this;return S(this.configuration).deleteTrigger(e,t).then(function(e){return e(n.axios,n.basePath)})},dn.prototype.patchTrigger=function(e,t,n){var r=this;return S(this.configuration).patchTrigger(e,t,n).then(function(e){return e(r.axios,r.basePath)})},dn.prototype.readTrigger=function(e,t){var n=this;return S(this.configuration).readTrigger(e,t).then(function(e){return e(n.axios,n.basePath)})},dn.prototype.searchTrigger=function(e,t,n,r,i,a,s,o){var u=this;return S(this.configuration).searchTrigger(e,t,n,r,i,a,s,o).then(function(e){return e(u.axios,u.basePath)})},dn.prototype.searchTriggerJob=function(e,t,n,r,i,a,s,o,u){var c=this;return S(this.configuration).searchTriggerJob(e,t,n,r,i,a,s,o,u).then(function(e){return e(c.axios,c.basePath)})},dn.prototype.updateTrigger=function(e,t,n){var r=this;return S(this.configuration).updateTrigger(e,t,n).then(function(e){return e(r.axios,r.basePath)})};var cn,ln=dn;function dn(){return null!==cn&&cn.apply(this,arguments)||this}function _n(l){var e=this;return{defaultDeviceConfig:function(u,c){return void 0===c&&(c={}),z.__awaiter(e,void 0,void 0,function(){var t,n,r,i,a,s,o;return z.__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=V.parse(t,!0),l&&(n=l.baseOptions),r=z.__assign(z.__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=z.__assign(z.__assign(z.__assign({},t.query),a),c.query),delete t.search,o=n&&n.headers?n.headers:{},r.headers=z.__assign(z.__assign(z.__assign({},i),o),c.headers),[2,{url:V.format(t),options:r}]}})})}}}function hn(i){return{defaultDeviceConfig:function(t,r){return z.__awaiter(this,void 0,void 0,function(){var n;return z.__generator(this,function(e){switch(e.label){case 0:return[4,_n(i).defaultDeviceConfig(t,r)];case 1:return n=e.sent(),[2,function(e,t){void 0===e&&(e=H),void 0===t&&(t=L);t=z.__assign(z.__assign({},n.options),{url:t+n.url});return e.request(t)}]}})})}}}pn=e,z.__extends(gn,pn),gn.prototype.defaultDeviceConfig=function(e,t){var n=this;return hn(this.configuration).defaultDeviceConfig(e,t).then(function(e){return e(n.axios,n.basePath)})};var pn,fn=gn;function gn(){return null!==pn&&pn.apply(this,arguments)||this}function vn(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.EngineRoutingSchemaType||(h.EngineRoutingSchemaType={})).Default="default",K.Voice="voice",K.Chat="chat",K.Processing="processing",K.Service="service",(K=h.EngineTriggerJobState||(h.EngineTriggerJobState={})).Idle="idle",K.Active="active",K.Done="done",K.Error="error",(K=h.EngineTriggerType||(h.EngineTriggerType={})).DefaultTriggerType="default_trigger_type",K.Cron="cron",(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",bn.prototype.debug=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("debug",e,t)},bn.prototype.info=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("info",e,t)},bn.prototype.warn=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("warn",e,t)},bn.prototype.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];this.emitLogMessage("error",e,t)},bn.prototype.emitLogMessage=function(e,t,n){0<n.length?console[e].apply(console,z.__spreadArrays([t],n)):console[e](t)};var yn=bn;function bn(){}Object.defineProperty(mn.prototype,"id",{get:function(){return this.session.id},enumerable:!0,configurable:!0}),mn.prototype.getLocalMedia=function(){if(this.session.connection){var e=this.session.connection.getLocalStreams();if(e.length)return e}return[]},mn.prototype.getPeerMedia=function(){if(this.session.connection){var e=this.session.connection.getRemoteStreams();if(e.length)return e}return[]},mn.prototype.answer=function(e){var t=this;return new Promise(function(){t.session.answer(e)})};var wn=mn;function mn(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")}qn=P.EventEmitter,z.__extends(a,qn),a.prototype.callOption=function(n){return void 0===n&&(n={}),z.__awaiter(this,void 0,void 0,function(){var t;return z.__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 z.__awaiter(this,void 0,void 0,function(){var t,n;return z.__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 z.__awaiter(this,void 0,void 0,function(){var t,n;return z.__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,z.__assign(z.__assign({},n),t))];case 2:return e.sent(),[2]}})})},a.prototype.register=function(n){return z.__awaiter(this,void 0,void 0,function(){var t,i=this;return z.__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 wn(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 z.__awaiter(i,void 0,void 0,function(){return z.__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 z.__awaiter(this,void 0,void 0,function(){return z.__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 z.__awaiter(this,void 0,void 0,function(){var t=this;return z.__generator(this,function(e){return[2,new Promise(function(n,r){return z.__awaiter(t,void 0,void 0,function(){var t;return z.__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 z.__awaiter(this,void 0,void 0,function(){var t,n;return z.__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 z.__awaiter(this,void 0,void 0,function(){var t=this;return z.__generator(this,function(e){return[2,new Promise(function(n,r){return z.__awaiter(t,void 0,void 0,function(){var t;return z.__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 z.__awaiter(this,void 0,void 0,function(){return z.__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 qn,An=a;function a(e,t){var n=qn.call(this)||this;return n.instanceId=e,n.type="webrtc",n.sessionCache=new Map,t?k.debug.enable("*"):k.debug.disable(),n.log=new yn,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=Cn=Cn||{}).Call="call",K.Chat="chat",K.Task="task",Object.defineProperty(i.prototype,"queue",{get:function(){return{id:this.distribute.queue_id,name:this.distribute.queue_name}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"duration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"hasForm",{get:function(){return this.distribute.has_form||!1},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"channel",{get:function(){return this.distribute.channel},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"allowAccept",{get:function(){return this.channel===Cn.Task&&0===this.bridgedAt&&0===this.closedAt},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"allowDecline",{get:function(){return this.allowAccept},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"allowClose",{get:function(){return this.channel===Cn.Task&&0===this.closedAt&&0<this.bridgedAt},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"memberId",{get:function(){return this.distribute.member_id},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"queueId",{get:function(){return this.distribute.queue_id},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"hasReporting",{get:function(){return this.distribute.has_reporting},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"allowReporting",{get:function(){return this.hasReporting&&0<this.bridgedAt},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"agentChannelId",{get:function(){return this.distribute.agent_channel_id},enumerable:!0,configurable:!0}),i.prototype.setState=function(e){this.state=e},i.prototype.setAnswered=function(e){this.answeredAt=e,this.lastStatusChange=Date.now()},i.prototype.setOffering=function(e){this.offeringAt=e.timestamp},i.prototype.setBridged=function(e){this.bridgedAt=e.timestamp,this.lastStatusChange=Date.now(),e.form&&(this.form=e.form)},i.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},i.prototype.setClosed=function(e){this.stopAt=e,this.state=h.JobState.Closed},i.prototype.setTransferred=function(e){this.distribute=e,this.history.push(e)},i.prototype.setMissed=function(){this.state=h.JobState.Missed},Object.defineProperty(i.prototype,"processingTimeoutAt",{get:function(){return this._processing&&this._processing.timeout?this._processing.timeout:null},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"processingSec",{get:function(){return this._processing&&this._processing.sec?this._processing.sec:null},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"attempt",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(i.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(i.prototype,"isMember",{get:function(){return!!this.memberId},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"displayNumber",{get:function(){return this.communication.destination},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"displayName",{get:function(){return this.distribute.member_name||null},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"display",{get:function(){return this.displayName+" ("+this.displayNumber+")"},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"renewalSec",{get:function(){return this._processing&&this._processing.renewal_sec?this._processing.renewal_sec:null},enumerable:!0,configurable:!0}),i.prototype.accept=function(){return z.__awaiter(this,void 0,void 0,function(){return z.__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})]})})},i.prototype.close=function(){return z.__awaiter(this,void 0,void 0,function(){return z.__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})]})})},i.prototype.decline=function(){return z.__awaiter(this,void 0,void 0,function(){return z.__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})]})})},i.prototype.reporting=function(n){return z.__awaiter(this,void 0,void 0,function(){var t;return z.__generator(this,function(e){switch(e.label){case 0:return[4,this.client.request("cc_reporting",z.__assign({attempt_id:this.id},n))];case 1:return t=e.sent(),this.reportedAt=Date.now(),[2,t]}})})},i.prototype.renew=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.client.request("cc_renewal",{attempt_id:this.id,renewal_sec:t||this.processingSec})]})})},i.prototype.formAction=function(t,n){return z.__awaiter(this,void 0,void 0,function(){return z.__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 Cn,Rn=i;function i(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(s.prototype,"agentId",{get:function(){return this.info.agent_id},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"onDemand",{get:function(){return this.info.on_demand},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"status",{get:function(){return this.info.status},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"statusPayload",{get:function(){return this.info.status_payload},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"isAdmin",{get:function(){return this.info.is_admin},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"isSupervisor",{get:function(){return this.info.is_supervisor},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"team",{get:function(){return this.info.team},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"supervisor",{get:function(){return this.info.supervisor},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"auditor",{get:function(){return this.info.auditor},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"channels",{get:function(){return[this._channel]},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"channel",{get:function(){return this._channel},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"stateDuration",{get:function(){return Math.round((Date.now()-this.lastStatusChange)/1e3)},enumerable:!0,configurable:!0}),s.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 Rn(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},s.prototype.online=function(t,n){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.client.agentSetOnline(this.agentId,t,n)]})})},s.prototype.waiting=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.client.agentSetWaiting(this.agentId,t)]})})},s.prototype.pause=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.client.agentSetPause(this.agentId,t)]})})},s.prototype.offline=function(){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.client.agentSetOffline(this.agentId)]})})},s.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()},s.prototype.directMember=function(t,n){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.client.request("cc_member_direct",{agent_id:this.agentId,member_id:t,communication_id:n})]})})},s.prototype.offlineMembers=function(n,r,i){return z.__awaiter(this,void 0,void 0,function(){var t;return z.__generator(this,function(e){switch(e.label){case 0:return[4,(t=this).client.request("cc_fetch_offline_members",{agent_id:this.agentId,page:r,q:n,per_page:i})];case 1:return t._listOfflineMembers=e.sent(),[2,this._listOfflineMembers]}})})},s.prototype.hasTask=function(e){return this.task.has(e.id)},s.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},s.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 Sn=s;function s(e,t){this.client=e,this.info=t,this.task=new Map,this._channel=t.channels[0],this._listOfflineMembers=null,this.lastStatusChange=Date.now()-1e3*this.info.status_duration}(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";o.prototype.setState=function(e){this.state=e.event},o.prototype.setSip=function(e){e&&!this.sip&&(this.sip=e,this.localStreams=e.getLocalMedia(),this.peerStreams=e.getPeerMedia())},Object.defineProperty(o.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(o.prototype,"allowDtmf",{get:function(){return 0<this.answeredAt&&this.allowHangup},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"allowHangup",{get:function(){return 0===this.hangupAt},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"allowHold",{get:function(){return 0===this.hangupAt&&("active"===this.state||"bridge"===this.state)},enumerable:!0,configurable:!0}),Object.defineProperty(o.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(o.prototype,"allowUnHold",{get:function(){return 0===this.hangupAt&&"hold"===this.state},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"memberCommunication",{get:function(){return this.task?this.task.communication:null},enumerable:!0,configurable:!0}),o.prototype.getMember=function(e){return z.__awaiter(this,void 0,void 0,function(){return z.__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(o.prototype,"isMember",{get:function(){return!(!this.task||!this.task.isMember)},enumerable:!0,configurable:!0}),o.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)},o.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)},o.prototype.setHold=function(e){this.setState(e)},o.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},o.prototype.setPeerStreams=function(e){this.peerStreams=e||[]},o.prototype.setLocalStreams=function(e){this.localStreams=e||[]},o.prototype.setVoice=function(){this.voice=!0},o.prototype.setSilence=function(){this.voice=!1},o.prototype.setExecute=function(e){this.applications.push(e.application)},o.prototype.addDigit=function(e){this.digits.push(e.digit)},o.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(o.prototype,"allowReporting",{get:function(){return 0<this.answeredAt&&this.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"hasReporting",{get:function(){return!!this.task&&this.task.hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"display",{get:function(){return this.displayNumber+" ("+this.displayName+")"},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"muted",{get:function(){return this._muted},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isHold",{get:function(){return this.state===h.CallActions.Hold},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"allowInboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"allowOutboundVideo",{get:function(){return this.params&&this.params.video||!1},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"active",{get:function(){return 0===this.hangupAt},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"displayNumber",{get:function(){return"inbound"===this.direction?this.from.number:this.to?this.to.number:this.destination},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"displayName",{get:function(){return"inbound"===this.direction?this.from.name:this.to?this.to.name:this.destination},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"autoAnswer",{get:function(){return this.queue&&"offline"===this.queue.queue_type||this.params&&!0===this.params.autoAnswer},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"attempt",{get:function(){return this.task},enumerable:!0,configurable:!0}),o.prototype.answer=function(n){return z.__awaiter(this,void 0,void 0,function(){var t;return z.__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]}})})},o.prototype.answerDelay=function(t,e){var n=this;this.autoAnswered||(this.autoAnswered=!0,setTimeout(function(){return z.__awaiter(n,void 0,void 0,function(){return z.__generator(this,function(e){switch(e.label){case 0:return[4,this.answer(t)];case 1:return e.sent(),[2]}})})},e))},o.prototype.hangup=function(n){return z.__awaiter(this,void 0,void 0,function(){var t;return z.__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})]})})},o.prototype.eavesdrop=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return t.id=this.id,[2,this.client.request("call_eavesdrop",t)]})})},o.prototype.toggleHold=function(){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return this.state===h.CallActions.Hold?[2,this.unHold()]:[2,this.hold()]})})},o.prototype.hold=function(){return z.__awaiter(this,void 0,void 0,function(){return z.__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})]})})},o.prototype.unHold=function(){return z.__awaiter(this,void 0,void 0,function(){return z.__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})]})})},o.prototype.sendDTMF=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.client.request("call_dtmf",{id:this.id,app_id:this.appId,dtmf:t})]})})},o.prototype.blindTransfer=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.client.request("call_blind_transfer",{id:this.id,app_id:this.appId,destination:t})]})})},o.prototype.mute=function(n){return void 0===n&&(n=!1),z.__awaiter(this,void 0,void 0,function(){var t;return z.__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]}})})},o.prototype.bridgeTo=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__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})]})})},o.prototype.reporting=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){if(this.task)return[2,this.task.reporting(t)];throw new Error("this call not in queue")})})},o.prototype.renew=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){if(this.task)return[2,this.task.renew(t)];throw new Error("this conversation not in queue")})})},o.prototype.callToUser=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__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 Kn=o;function o(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",u.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)})},u.prototype.setAnswered=function(e,t,n){this.state=h.ConversationState.Active,this.answeredAt=t,this.channelId=e,this.member=Pn(n),this.inviteId=null},u.prototype.setClosed=function(e){this.state=h.ConversationState.Closed,this.closedAt=e},u.prototype.setDecline=function(e){this.setClosed(e.timestamp),this._cause=e.cause||null},u.prototype.setLeave=function(e){this.setClosed(e.timestamp)},Object.defineProperty(u.prototype,"id",{get:function(){return this.channelId||this.inviteId||this.conversationId},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"cause",{get:function(){return this._cause},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"messages",{get:function(){return this.getMessages()},enumerable:!0,configurable:!0}),u.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})},u.prototype.next=function(){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){throw new Error("TODO")})})},u.prototype.pagination=function(e,t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){throw new Error("TODO")})})},u.prototype.newMessage=function(e){this._messages.push(e)},Object.defineProperty(u.prototype,"allowDecline",{get:function(){return!!this.inviteId},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"allowJoin",{get:function(){return!!this.inviteId},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"allowLeave",{get:function(){return!(!this.channelId||0!==this.closedAt&&this.hasReporting)},enumerable:!0,configurable:!0}),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._hasReporting},enumerable:!0,configurable:!0}),Object.defineProperty(u.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(u.prototype,"attempt",{get:function(){return this.task},enumerable:!0,configurable:!0}),u.prototype.decline=function(n){return z.__awaiter(this,void 0,void 0,function(){var t;return z.__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")})})},u.prototype.join=function(){return z.__awaiter(this,void 0,void 0,function(){return z.__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")})})},u.prototype.close=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__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")})})},u.prototype.leave=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__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")})})},u.prototype.sendText=function(r){return z.__awaiter(this,void 0,void 0,function(){var t,n;return z.__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]}})})},u.prototype.sendFile=function(n,r){return z.__awaiter(this,void 0,void 0,function(){var t;return z.__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})]}})})},u.prototype.send=function(t,n){return z.__awaiter(this,void 0,void 0,function(){return z.__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")})})},u.prototype.addToChat=function(t,n){return z.__awaiter(this,void 0,void 0,function(){return z.__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})]})})},u.prototype.startChat=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.client.request("start_chat",{user_id:t})]})})},u.prototype.updateChannel=function(){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.client.request("update_channel_chat",{channel_id:this.channelId})]})})},u.prototype.reporting=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){if(this.task)return[2,this.task.reporting(t)];throw new Error("this conversation not in queue")})})},u.prototype.renew=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){if(this.task)return[2,this.task.renew(t)];throw new Error("this conversation not in queue")})})},u.prototype.transferToPlan=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.client.request("blind_transfer_chat",{conversation_id:this.conversationId,channel_id:this.channelId,plan_id:t})]})})},u.prototype.transferToUser=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.client.request("transfer_user_chat",{conversation_id:this.conversationId,channel_id:this.channelId,user_id:t})]})})},u.prototype.sendMessageTextChunk=function(e){return this.client.request("send_text_chat",{channel_id:this.channelId,conversation_id:this.conversationId,text:e})},u.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 Tn=u;function u(e,t,n,r,i,a){for(var s in this.client=e,this.conversationId=t,this.title=n,this.channelId=null,this.createdAt=Date.now(),this.answeredAt=0,this.updatedAt=0,this.invitedAt=0,this.closedAt=0,this.task=null,this.data=null,this.queue=null,this.members=(r||[]).map(Pn),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.queue={id:+a.cc_queue_id||null,name:a.cc_queue_name||""},this.task=this.client.agent.task.get(+a.cc_attempt_id)||null)}function Pn(e){return e.messenger=e.type,e}(h.TypeErrors||(h.TypeErrors={})).RolePermission="api.context.permissions.app_error";On=Error,z.__extends(In,On),In.id="device_not_found";var On,kn=In;function In(e){e=On.call(this,e)||this;return e.id=In.id,e}Wn=Error,z.__extends(En,Wn),En.id="device_not_allow";var Wn,Xn=En;function En(e){e=Wn.call(this,e)||this;return e.id=En.id,e}xn=Error,z.__extends(Un,xn),Un.id="api.context.permissions.app_error";var xn,Qn,jn=Un;function Un(e){e=xn.call(this,e)||this;return e.id=Un.id,e}(Qn=Qn||{}).HideMember="hide_member";Gn=P.EventEmitter,z.__extends(Mn,Gn),Mn.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()}},Mn.prototype.send=function(e){return this.socket.send(JSON.stringify(e)),null},Mn.prototype.close=function(e){this.socket.close(e||1e3),delete this.socket},Mn.prototype.onOpen=function(){this.emit("open")},Mn.prototype.onClose=function(e){this.emit("close",e),this.off("*")},Mn.prototype.onMessage=function(e){"\0\0\0\0"!==e&&(e=JSON.parse(e),this.emit("message",e))};var Gn,Bn=Mn;function Mn(e){var t=Gn.call(this)||this;return t.host=e,t}var Hn,Ln,Dn="call",Fn="chat",Jn="user_state",Nn="agent_status",K=((K=Hn=Hn||{}).NotFoundError="NotFoundError",K.NotAllowedError="NotAllowedError",(K=h.Response||(h.Response={})).STATUS_FAIL="FAIL",K.STATUS_OK="OK",Ln=P.EventEmitter,z.__extends(T,Ln),T.prototype.connect=function(){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){switch(e.label){case 0:return[4,this.connectToSocket()];case 1:return e.sent(),[2]}})})},T.prototype.disconnect=function(){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return this.socket.close(),[2]})})},T.prototype.subscribeCall=function(s,o){return z.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a;return z.__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(Dn,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 Kn(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 Rn(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]}})})},T.prototype.subscribeChat=function(s,o){return z.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a;return z.__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(Fn,s),t&&t.items)for(n=0,r=t.items;n<r.length;n++){if(i=r[n],a=i.messages.reverse(),(a=new Tn(this,i.id,i.title,i.members,a,i.variables)).createdAt=i.created_at,a.closedAt=i.closed_at,i.task&&(a.task=new Rn(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]}})})},T.prototype.subscribeUsersStatus=function(n,r){return z.__awaiter(this,void 0,void 0,function(){var t;return z.__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]}})})},T.prototype.subscribeAgentsStatus=function(n,r){return z.__awaiter(this,void 0,void 0,function(){var t;return z.__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(Nn,n),[2,t]}})})},T.prototype.subscribeTask=function(e){this.eventHandler.on("task",e)},T.prototype.subscribeJob=function(e){this.eventHandler.on("job",e)},T.prototype.unSubscribe=function(t,e,n){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.request("un_subscribe_"+t,n)]})})},T.prototype.destroy=function(){return z.__awaiter(this,void 0,void 0,function(){return z.__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]}})})},T.prototype.allCall=function(){return Array.from(this.callStore.values())},T.prototype.allConversations=function(){return Array.from(this.conversationStore.values())},T.prototype.allTask=function(){return this.agent?Array.from(this.agent.task.values()):[]},T.prototype.allJob=function(){return this.allTask().filter(zn)},T.prototype.callById=function(e){if(this.callStore.has(e))return this.callStore.get(e)},T.prototype.conversationById=function(e){if(this.conversationStore.has(e))return this.conversationStore.get(e)},T.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}},T.prototype.reportingTask=function(t,n){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.request("cc_reporting",z.__assign({attempt_id:t},n))]})})},T.prototype.agentActiveTasks=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.request("cc_agent_tasks",{agent_id:t})]})})},T.prototype.auth=function(){return z.__awaiter(this,void 0,void 0,function(){var t;return z.__generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,4]),[4,this.request("authentication_challenge",{token:this._config.token})];case 1:return[2,e.sent()];case 2:return t=e.sent(),this.handleError(t),[4,this.disconnect()];case 3:throw e.sent(),t;case 4:return[2]}})})},T.prototype.ping=function(){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.request("ping",{ping:1})]})})},T.prototype.sessionInfo=function(){return this.connectionInfo.session},Object.defineProperty(T.prototype,"version",{get:function(){return this.connectionInfo.server_version},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"buildVersion",{get:function(){return'"0.1.166"'},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"instanceId",{get:function(){return this.connectionInfo.sock_id},enumerable:!0,configurable:!0}),Object.defineProperty(T.prototype,"autoAnswerDelayTime",{get:function(){return this._config.autoAnswerDelayTime||400},enumerable:!0,configurable:!0}),T.prototype.agentSession=function(){return z.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l,d;return z.__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 Sn(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 Rn(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]}})})},T.prototype.invite=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.request("call_invite",t)]})})},T.prototype.call=function(n){return z.__awaiter(this,void 0,void 0,function(){var t;return z.__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]}})})},T.prototype.callRecordId=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.request("call_recordings",{id:t})]})})},T.prototype.eavesdrop=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.request("call_eavesdrop",t)]})})},T.prototype.agentSetOnline=function(t,n,r){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.request("cc_agent_online",{agent_id:t,channels:n,on_demand:r})]})})},T.prototype.agentSetWaiting=function(t,n){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.request("cc_agent_waiting",{agent_id:t,channel:n})]})})},T.prototype.agentSetPause=function(t,n){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.request("cc_agent_pause",{agent_id:t,payload:n})]})})},T.prototype.agentSetOffline=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.request("cc_agent_offline",{agent_id:t})]})})},T.prototype.inviteToUser=function(e){return this.request("call_user",e)},T.prototype.answer=function(n,r){return z.__awaiter(this,void 0,void 0,function(){var t;return z.__generator(this,function(e){return(t=this.callById(n))?[2,t.answer(r)]:[2]})})},T.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})})},T.prototype.useWebPhone=function(){return this._config.registerWebDevice||!1},T.prototype.callDestroyed=function(e){return 0<e.hangupAt&&!this.hasAgentTask(e.task)},T.prototype.conversationDestroyed=function(e){return 0<e.closedAt&&(!this.hasAgentTask(e.task)||!e.hasReporting)&&(e.hasReporting||!(e.lastAction===h.ChatActions.Close&&0<e.answeredAt))},T.prototype.reportingChannelTask=function(e){switch(e.channel){case Cn.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 Cn.Chat:if(e.agentChannelId){var i=this.conversationById(e.agentChannelId);if(i&&this.conversationDestroyed(i))return void this.destroyConversation(i)}}},T.prototype.registerCallClient=function(n){return z.__awaiter(this,void 0,void 0,function(){var t;return z.__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]}})})},T.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(Dn,h.CallActions.PeerStream,e))}),e.on("localStreams",function(e,t){e=n.callBySession(e);e&&!e.localStreams.length&&(e.setLocalStreams(t),n.eventHandler.emit(Dn,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)})},T.prototype.deviceConfig=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,this.request("user_default_device",{name:t})]})})},T.prototype.storeFile=function(l,d,_){return z.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c;return z.__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,H.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]}})})},T.prototype.fileUrlDownload=function(e){return this.basePath+"/api/storage/file/"+e+"/download?access_token="+this._config.token},T.prototype.fileUrlStream=function(e){return this.basePath+"/api/storage/file/"+e+"/stream?access_token="+this._config.token},T.prototype.handleError=function(e){if(e)switch(e.name){case Hn.NotFoundError:this.emit("error",new kn(e.message));break;case Hn.NotAllowedError:this.emit("error",new Xn(e.message));break;default:this.emit("error",e)}},T.prototype.destroyConversation=function(e){this.conversationStore.delete(e.id),this.eventHandler.emit(Fn,h.ChatActions.Destroy,e)},T.prototype.onMessage=function(r){return z.__awaiter(this,void 0,void 0,function(){var t,n;return z.__generator(this,function(e){switch(e.label){case 0:return(this.log.debug("receive message: ",r),0<r.seq_reply)?(this.queueRequest.has(r.seq_reply)&&(t=this.queueRequest.get(r.seq_reply),this.queueRequest.delete(r.seq_reply),r.status===h.Response.STATUS_OK?t.resolve(r.data):(n=r.error)&&n.id===h.TypeErrors.RolePermission?t.reject(new jn(n.detail)):t.reject(r.error)),[3,15]):[3,1];case 1:switch(r.event){case"hello":return[3,2];case Dn:return[3,4];case Fn:return[3,6];case Jn:return[3,8];case"sip":return[3,9];case Nn:return[3,10];case"channel":return[3,11];case"error":return[3,12];case"notification":return[3,13]}return[3,14];case 2:return[4,this.connected(r.data)];case 3:return e.sent(),this.log.debug("opened session "+this.connectionInfo.sock_id+" for userId="+this.connectionInfo.session.user_id),[3,15];case 4:return[4,this.handleCallEvents(r.data.call)];case 5:return e.sent(),[3,15];case 6:return[4,this.handleChatEvents(r.data)];case 7:return e.sent(),[3,15];case 8:return this.handleUserStateEvent(r.data.state),[3,15];case 9:return this.eventHandler.emit("sip",r.data),[3,15];case 10:return this.handleAgentStatus(r.data),[3,15];case 11:return this.handleChannelEvents(r.data),[3,15];case 12:return this.lastError=r.data.error,[3,15];case 13:return this.handleNotification(r.data.notification),[3,15];case 14:this.log.error("event "+r.event+" not handler"),e.label=15;case 15:return[2]}})})},T.prototype.handleNotification=function(e){if(e.action===Qn.HideMember){if(this.agent&&this.agent._listOfflineMembers){var t=this.agent._listOfflineMembers;if(t.items)for(var n=0;n<t.items.length;n++)if(t.items[n].id===e.body.member_id){t.items.splice(n,1);break}}}else this.log.error('notification "'+e.action+'" not handled')},T.prototype.handleAgentStatus=function(e){this.agent&&e.agent_id===this.agent.agentId&&this.agent.setStatus(e),this.eventHandler.emit(Nn,e,this.agent)},T.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&&zn(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)))},T.prototype.pingServer=function(){return z.__awaiter(this,void 0,void 0,function(){var t,n=this;return z.__generator(this,function(e){switch(e.label){case 0:return this.pingTimer&&this.connectionInfo.ping_interval?(t=setTimeout(function(){return z.__awaiter(n,void 0,void 0,function(){return z.__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]}})})},T.prototype.connected=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__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 An(this.instanceId,this._config.debug))]:[2]}})})},T.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}},T.prototype.onNewCallSession=function(n){return z.__awaiter(this,void 0,void 0,function(){var t;return z.__generator(this,function(e){return(t=n.callId?this.callById(n.callId):this.callBySipId(n.id))&&(t.setSip(n),this.checkAutoAnswer(t)),[2]})})},T.prototype.checkAutoAnswer=function(e){e.autoAnswer&&e.answerDelay({video:e.params.video,screen:e.params.screen,disableStun:e.params.disableStun},this.autoAnswerDelayTime)},T.prototype.connectToSocket=function(){var n=this;return new Promise(function(e,t){try{n.socket=new Bn(n._config.endpoint),n.socket.connect(n._config.token)}catch(e){return void t(e)}n.socket.on("message",n.onMessage.bind(n)),n.socket.on("close",function(e){n.pingTimer&&clearTimeout(n.pingTimer),n.log.error("socket close code: ",e),1e3!==e&&(n.emit("disconnected",e,n.lastError),t(new Error("close socket code: "+e))),n.eventHandler.off("*")}),n.socket.on("open",function(){e(null),n.emit("connected")})})},T.prototype.handleUserStateEvent=function(e){this.eventHandler.emit(Jn,e)},T.prototype.handleCallEvents=function(n){return z.__awaiter(this,void 0,void 0,function(){var t;return z.__generator(this,function(e){switch(n.timestamp=Date.now(),n.event){case h.CallActions.Ringing:t=new Kn(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(Dn,n.event,t),this.callDestroyed(t)&&this.destroyCall(t)),[2]})})},T.prototype.handleChatEvents=function(_){return z.__awaiter(this,void 0,void 0,function(){var t,n,r,i,a,s,o,u,c,l,d;return z.__generator(this,function(e){switch(n=Date.now(),_.action){case h.ChatActions.UserInvite:r=_.data,(t=new Tn(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(Fn,_.action,t),this.conversationDestroyed(t)&&this.destroyConversation(t)),[2]})})},T.prototype.hasAgentTask=function(e){return!(!this.agent||!e)&&this.agent.hasTask(e)},T.prototype.destroyCall=function(e){this.callStore.delete(e.id),this.eventHandler.emit(Dn,h.CallActions.Destroy,e)},T);function T(e){var t=Ln.call(this)||this;return t._config=e,t.reqSeq=0,t.queueRequest=new Map,t.log=new yn,t.eventHandler=new P.EventEmitter,t.callStore=new Map,t.conversationStore=new Map,t.pingTimer=null,t.basePath=""+(e=(e=(e=(e=e.storageEndpoint||e.endpoint).replace(/^ws/,"http")).endsWith("/")?e.slice(0,-1):e).endsWith("/ws")?e.slice(0,-3):e),t.lastError=null,t}function zn(e){return e.channel===Cn.Task}Vn=P.EventEmitter,z.__extends(Yn,Vn);var Vn,$n=Yn;function Yn(){return null!==Vn&&Vn.apply(this,arguments)||this}var Zn="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(function(c){var e=Zn&&Zn.__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})((er={exports:{}},er.exports));var er=er.exports,tr=((tr=er)&&tr.__esModule&&Object.prototype.hasOwnProperty.call(tr,"default")&&tr.default,er.$listeners,er.$addListener,er.EventEmitter),nr=(Object.defineProperty(rr.prototype,"id",{get:function(){return this.callId},enumerable:!0,configurable:!0}),rr.prototype.getLocalMedia=function(){return[]},rr.prototype.getPeerMedia=function(){return[]},rr.prototype.answer=function(e){var t=this;return new Promise(function(e){t.client.answer(t.id),e()})},rr);function rr(e,t){this.client=e,this.callId=t,this.incoming=!1,this.instanceId="fixme"}ir=tr,z.__extends(ar,ir),ar.prototype.callOption=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2,t]})})},ar.prototype.register=function(e){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2]})})},ar.prototype.unregister=function(){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return[2]})})},ar.prototype.call=function(t){return z.__awaiter(this,void 0,void 0,function(){return z.__generator(this,function(e){return t.destination&&this.exec(t.destination),[2]})})},ar.prototype.answer=function(e){this.exec(e,"answer")},ar.prototype.sipSessionByCallId=function(e){return new nr(this,e)},ar.prototype.sipSessionBySipId=function(e){return null},ar.prototype.open=function(e){this.exec(encodeURIComponent(JSON.stringify(z.__assign({token:e},this.config))),"open")},ar.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 ir,er=ar;function ar(e){var t=ir.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=x,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=M,h.AgentTeamServiceApiAxiosParamCreator=N,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=D,h.CallServiceApiFp=F,h.CallServiceApiFactory=function(G,B,M){return{aggregateHistoryCall:function(e,t){return F(G).aggregateHistoryCall(e,t).then(function(e){return e(M,B)})},blindTransferCall:function(e,t,n){return F(G).blindTransferCall(e,t,n).then(function(e){return e(M,B)})},confirmPush:function(e,t){return F(G).confirmPush(e,t).then(function(e){return e(M,B)})},createCall:function(e,t){return F(G).createCall(e,t).then(function(e){return e(M,B)})},createCallAnnotation:function(e,t,n){return F(G).createCallAnnotation(e,t,n).then(function(e){return e(M,B)})},deleteCallAnnotation:function(e,t,n){return F(G).deleteCallAnnotation(e,t,n).then(function(e){return e(M,B)})},dtmfCall:function(e,t,n){return F(G).dtmfCall(e,t,n).then(function(e){return e(M,B)})},eavesdropCall:function(e,t,n){return F(G).eavesdropCall(e,t,n).then(function(e){return e(M,B)})},hangupCall:function(e,t,n){return F(G).hangupCall(e,t,n).then(function(e){return e(M,B)})},holdCall:function(e,t,n){return F(G).holdCall(e,t,n).then(function(e){return e(M,B)})},readCall:function(e,t,n){return F(G).readCall(e,t,n).then(function(e){return e(M,B)})},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,T,P){return F(G).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,T,P).then(function(e){return e(M,B)})},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,T,P,O,k,I,W,X,E,x,Q,j,U){return F(G).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,T,P,O,k,I,W,X,E,x,Q,j,U).then(function(e){return e(M,B)})},unHoldCall:function(e,t,n){return F(G).unHoldCall(e,t,n).then(function(e){return e(M,B)})},updateCallAnnotation:function(e,t,n,r){return F(G).updateCallAnnotation(e,t,n,r).then(function(e){return e(M,B)})}}},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)})},testEmailProfile:function(e,t){return c(s).testEmailProfile(e,t).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=Pe,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=Ee,h.FileTranscriptServiceApiFactory=function(i,a,s){return{createFileTranscript:function(e,t){return Ee(i).createFileTranscript(e,t).then(function(e){return e(s,a)})},deleteFileTranscript:function(e,t){return Ee(i).deleteFileTranscript(e,t).then(function(e){return e(s,a)})},getFileTranscriptPhrases:function(e,t,n,r){return Ee(i).getFileTranscriptPhrases(e,t,n,r).then(function(e){return e(s,a)})}}},h.FileTranscriptServiceApi=Qe,h.ImportTemplateServiceApiAxiosParamCreator=Ue,h.ImportTemplateServiceApiFp=Ge,h.ImportTemplateServiceApiFactory=function(o,u,c){return{createImportTemplate:function(e,t){return Ge(o).createImportTemplate(e,t).then(function(e){return e(c,u)})},deleteImportTemplate:function(e,t){return Ge(o).deleteImportTemplate(e,t).then(function(e){return e(c,u)})},patchImportTemplate:function(e,t,n){return Ge(o).patchImportTemplate(e,t,n).then(function(e){return e(c,u)})},readImportTemplate:function(e,t){return Ge(o).readImportTemplate(e,t).then(function(e){return e(c,u)})},searchImportTemplate:function(e,t,n,r,i,a,s){return Ge(o).searchImportTemplate(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateImportTemplate:function(e,t,n){return Ge(o).updateImportTemplate(e,t,n).then(function(e){return e(c,u)})}}},h.ImportTemplateServiceApi=Me,h.ListServiceApiAxiosParamCreator=Le,h.ListServiceApiFp=g,h.ListServiceApiFactory=function(l,d,_){return{createList:function(e,t){return g(l).createList(e,t).then(function(e){return e(_,d)})},createListCommunication:function(e,t,n){return g(l).createListCommunication(e,t,n).then(function(e){return e(_,d)})},deleteList:function(e,t,n){return g(l).deleteList(e,t,n).then(function(e){return e(_,d)})},deleteListCommunication:function(e,t,n,r){return g(l).deleteListCommunication(e,t,n,r).then(function(e){return e(_,d)})},readList:function(e,t,n){return g(l).readList(e,t,n).then(function(e){return e(_,d)})},readListCommunication:function(e,t,n,r){return g(l).readListCommunication(e,t,n,r).then(function(e){return e(_,d)})},searchList:function(e,t,n,r,i,a,s){return g(l).searchList(e,t,n,r,i,a,s).then(function(e){return e(_,d)})},searchListCommunication:function(e,t,n,r,i,a,s,o,u,c){return g(l).searchListCommunication(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},updateList:function(e,t,n){return g(l).updateList(e,t,n).then(function(e){return e(_,d)})},updateListCommunication:function(e,t,n,r){return g(l).updateListCommunication(e,t,n,r).then(function(e){return e(_,d)})}}},h.ListServiceApi=Fe,h.MediaFileServiceApiAxiosParamCreator=Ne,h.MediaFileServiceApiFp=ze,h.MediaFileServiceApiFactory=function(o,u,c){return{deleteMediaFile:function(e,t,n){return ze(o).deleteMediaFile(e,t,n).then(function(e){return e(c,u)})},readMediaFile:function(e,t,n){return ze(o).readMediaFile(e,t,n).then(function(e){return e(c,u)})},searchMediaFile:function(e,t,n,r,i,a,s){return ze(o).searchMediaFile(e,t,n,r,i,a,s).then(function(e){return e(c,u)})}}},h.MediaFileServiceApi=$e,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=et,h.OutboundResourceGroupServiceApiAxiosParamCreator=tt,h.OutboundResourceGroupServiceApiFp=v,h.OutboundResourceGroupServiceApiFactory=function(u,c,l){return{createOutboundResourceGroup:function(e,t){return v(u).createOutboundResourceGroup(e,t).then(function(e){return e(l,c)})},createOutboundResourceInGroup:function(e,t,n){return v(u).createOutboundResourceInGroup(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceGroup:function(e,t,n){return v(u).deleteOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceInGroup:function(e,t,n,r){return v(u).deleteOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})},readOutboundResourceGroup:function(e,t,n){return v(u).readOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},readOutboundResourceInGroup:function(e,t,n,r){return v(u).readOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})},searchOutboundResourceGroup:function(e,t,n,r,i,a,s){return v(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 v(u).searchOutboundResourceInGroup(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateOutboundResourceGroup:function(e,t,n){return v(u).updateOutboundResourceGroup(e,t,n).then(function(e){return e(l,c)})},updateOutboundResourceInGroup:function(e,t,n,r){return v(u).updateOutboundResourceInGroup(e,t,n,r).then(function(e){return e(l,c)})}}},h.OutboundResourceGroupServiceApi=rt,h.OutboundResourceServiceApiAxiosParamCreator=at,h.OutboundResourceServiceApiFp=y,h.OutboundResourceServiceApiFactory=function(u,c,l){return{createOutboundResource:function(e,t){return y(u).createOutboundResource(e,t).then(function(e){return e(l,c)})},createOutboundResourceDisplay:function(e,t,n){return y(u).createOutboundResourceDisplay(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResource:function(e,t,n){return y(u).deleteOutboundResource(e,t,n).then(function(e){return e(l,c)})},deleteOutboundResourceDisplay:function(e,t,n,r){return y(u).deleteOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})},patchOutboundResource:function(e,t,n){return y(u).patchOutboundResource(e,t,n).then(function(e){return e(l,c)})},readOutboundResource:function(e,t,n){return y(u).readOutboundResource(e,t,n).then(function(e){return e(l,c)})},readOutboundResourceDisplay:function(e,t,n,r){return y(u).readOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})},searchOutboundResource:function(e,t,n,r,i,a,s){return y(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 y(u).searchOutboundResourceDisplay(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateOutboundResource:function(e,t,n){return y(u).updateOutboundResource(e,t,n).then(function(e){return e(l,c)})},updateOutboundResourceDisplay:function(e,t,n,r){return y(u).updateOutboundResourceDisplay(e,t,n,r).then(function(e){return e(l,c)})}}},h.OutboundResourceServiceApi=ot,h.QueueBucketServiceApiAxiosParamCreator=ct,h.QueueBucketServiceApiFp=lt,h.QueueBucketServiceApiFactory=function(u,c,l){return{createQueueBucket:function(e,t,n){return lt(u).createQueueBucket(e,t,n).then(function(e){return e(l,c)})},deleteQueueBucket:function(e,t,n){return lt(u).deleteQueueBucket(e,t,n).then(function(e){return e(l,c)})},patchQueueBucket:function(e,t,n,r){return lt(u).patchQueueBucket(e,t,n,r).then(function(e){return e(l,c)})},readQueueBucket:function(e,t,n){return lt(u).readQueueBucket(e,t,n).then(function(e){return e(l,c)})},searchQueueBucket:function(e,t,n,r,i,a,s,o){return lt(u).searchQueueBucket(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateQueueBucket:function(e,t,n,r){return lt(u).updateQueueBucket(e,t,n,r).then(function(e){return e(l,c)})}}},h.QueueBucketServiceApi=_t,h.QueueHookServiceApiAxiosParamCreator=pt,h.QueueHookServiceApiFp=ft,h.QueueHookServiceApiFactory=function(l,d,_){return{createQueueHook:function(e,t,n){return ft(l).createQueueHook(e,t,n).then(function(e){return e(_,d)})},deleteQueueHook:function(e,t,n){return ft(l).deleteQueueHook(e,t,n).then(function(e){return e(_,d)})},patchQueueHook:function(e,t,n,r){return ft(l).patchQueueHook(e,t,n,r).then(function(e){return e(_,d)})},readQueueHook:function(e,t,n){return ft(l).readQueueHook(e,t,n).then(function(e){return e(_,d)})},searchQueueHook:function(e,t,n,r,i,a,s,o,u,c){return ft(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 ft(l).updateQueueHook(e,t,n,r).then(function(e){return e(_,d)})}}},h.QueueHookServiceApi=vt,h.QueueResourcesServiceApiAxiosParamCreator=bt,h.QueueResourcesServiceApiFp=wt,h.QueueResourcesServiceApiFactory=function(u,c,l){return{createQueueResourceGroup:function(e,t,n){return wt(u).createQueueResourceGroup(e,t,n).then(function(e){return e(l,c)})},deleteQueueResourceGroup:function(e,t,n,r){return wt(u).deleteQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})},readQueueResourceGroup:function(e,t,n,r){return wt(u).readQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})},searchQueueResourceGroup:function(e,t,n,r,i,a,s,o){return wt(u).searchQueueResourceGroup(e,t,n,r,i,a,s,o).then(function(e){return e(l,c)})},updateQueueResourceGroup:function(e,t,n,r){return wt(u).updateQueueResourceGroup(e,t,n,r).then(function(e){return e(l,c)})}}},h.QueueResourcesServiceApi=qt,h.QueueServiceApiAxiosParamCreator=Ct,h.QueueServiceApiFp=b,h.QueueServiceApiFactory=function(_,h,p){return{createQueue:function(e,t){return b(_).createQueue(e,t).then(function(e){return e(p,h)})},deleteQueue:function(e,t,n){return b(_).deleteQueue(e,t,n).then(function(e){return e(p,h)})},patchQueue:function(e,t,n){return b(_).patchQueue(e,t,n).then(function(e){return e(p,h)})},readQueue:function(e,t,n){return b(_).readQueue(e,t,n).then(function(e){return e(p,h)})},searchQueue:function(e,t,n,r,i,a,s,o){return b(_).searchQueue(e,t,n,r,i,a,s,o).then(function(e){return e(p,h)})},searchQueueReportGeneral:function(e,t,n,r,i,a,s,o,u,c,l,d){return b(_).searchQueueReportGeneral(e,t,n,r,i,a,s,o,u,c,l,d).then(function(e){return e(p,h)})},updateQueue:function(e,t,n){return b(_).updateQueue(e,t,n).then(function(e){return e(p,h)})}}},h.QueueServiceApi=St,h.QueueSkillServiceApiAxiosParamCreator=Tt,h.QueueSkillServiceApiFp=Pt,h.QueueSkillServiceApiFactory=function(p,f,g){return{createQueueSkill:function(e,t,n){return Pt(p).createQueueSkill(e,t,n).then(function(e){return e(g,f)})},deleteQueueSkill:function(e,t,n){return Pt(p).deleteQueueSkill(e,t,n).then(function(e){return e(g,f)})},patchQueueSkill:function(e,t,n,r){return Pt(p).patchQueueSkill(e,t,n,r).then(function(e){return e(g,f)})},readQueueSkill:function(e,t,n){return Pt(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 Pt(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 Pt(p).updateQueueSkill(e,t,n,r).then(function(e){return e(g,f)})}}},h.QueueSkillServiceApi=kt,h.RegionServiceApiAxiosParamCreator=Wt,h.RegionServiceApiFp=Xt,h.RegionServiceApiFactory=function(l,d,_){return{createRegion:function(e,t){return Xt(l).createRegion(e,t).then(function(e){return e(_,d)})},deleteRegion:function(e,t){return Xt(l).deleteRegion(e,t).then(function(e){return e(_,d)})},patchRegion:function(e,t,n){return Xt(l).patchRegion(e,t,n).then(function(e){return e(_,d)})},readRegion:function(e,t){return Xt(l).readRegion(e,t).then(function(e){return e(_,d)})},searchRegion:function(e,t,n,r,i,a,s,o,u,c){return Xt(l).searchRegion(e,t,n,r,i,a,s,o,u,c).then(function(e){return e(_,d)})},updateRegion:function(e,t,n){return Xt(l).updateRegion(e,t,n).then(function(e){return e(_,d)})}}},h.RegionServiceApi=xt,h.RoutingChatPlanServiceApiAxiosParamCreator=jt,h.RoutingChatPlanServiceApiFp=Ut,h.RoutingChatPlanServiceApiFactory=function(c,l,d){return{createChatPlan:function(e,t){return Ut(c).createChatPlan(e,t).then(function(e){return e(d,l)})},deleteChatPlan:function(e,t){return Ut(c).deleteChatPlan(e,t).then(function(e){return e(d,l)})},patchChatPlan:function(e,t,n){return Ut(c).patchChatPlan(e,t,n).then(function(e){return e(d,l)})},readChatPlan:function(e,t){return Ut(c).readChatPlan(e,t).then(function(e){return e(d,l)})},searchChatPlan:function(e,t,n,r,i,a,s,o,u){return Ut(c).searchChatPlan(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateChatPlan:function(e,t,n){return Ut(c).updateChatPlan(e,t,n).then(function(e){return e(d,l)})}}},h.RoutingChatPlanServiceApi=Bt,h.RoutingOutboundCallServiceApiAxiosParamCreator=Ht,h.RoutingOutboundCallServiceApiFp=w,h.RoutingOutboundCallServiceApiFactory=function(d,_,h){return{createRoutingOutboundCall:function(e,t){return w(d).createRoutingOutboundCall(e,t).then(function(e){return e(h,_)})},deleteRoutingOutboundCall:function(e,t,n){return w(d).deleteRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},movePositionRoutingOutboundCall:function(e,t,n,r){return w(d).movePositionRoutingOutboundCall(e,t,n,r).then(function(e){return e(h,_)})},patchRoutingOutboundCall:function(e,t,n){return w(d).patchRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})},readRoutingOutboundCall:function(e,t,n){return w(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 w(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 w(d).updateRoutingOutboundCall(e,t,n).then(function(e){return e(h,_)})}}},h.RoutingOutboundCallServiceApi=Dt,h.RoutingSchemaServiceApiAxiosParamCreator=Jt,h.RoutingSchemaServiceApiFp=m,h.RoutingSchemaServiceApiFactory=function(d,_,h){return{createRoutingSchema:function(e,t){return m(d).createRoutingSchema(e,t).then(function(e){return e(h,_)})},deleteRoutingSchema:function(e,t,n){return m(d).deleteRoutingSchema(e,t,n).then(function(e){return e(h,_)})},patchRoutingSchema:function(e,t,n){return m(d).patchRoutingSchema(e,t,n).then(function(e){return e(h,_)})},readRoutingSchema:function(e,t,n){return m(d).readRoutingSchema(e,t,n).then(function(e){return e(h,_)})},searchRoutingSchema:function(e,t,n,r,i,a,s,o,u,c,l){return m(d).searchRoutingSchema(e,t,n,r,i,a,s,o,u,c,l).then(function(e){return e(h,_)})},searchRoutingSchemaTags:function(e,t,n,r,i,a,s){return m(d).searchRoutingSchemaTags(e,t,n,r,i,a,s).then(function(e){return e(h,_)})},updateRoutingSchema:function(e,t,n){return m(d).updateRoutingSchema(e,t,n).then(function(e){return e(h,_)})}}},h.RoutingSchemaServiceApi=zt,h.RoutingVariableServiceApiAxiosParamCreator=$t,h.RoutingVariableServiceApiFp=Yt,h.RoutingVariableServiceApiFactory=function(i,a,s){return{createRoutingVariable:function(e,t){return Yt(i).createRoutingVariable(e,t).then(function(e){return e(s,a)})},deleteRoutingVariable:function(e,t,n){return Yt(i).deleteRoutingVariable(e,t,n).then(function(e){return e(s,a)})},readRoutingVariable:function(e,t,n){return Yt(i).readRoutingVariable(e,t,n).then(function(e){return e(s,a)})},searchRoutingVariable:function(e,t,n,r){return Yt(i).searchRoutingVariable(e,t,n,r).then(function(e){return e(s,a)})},updateRoutingVariable:function(e,t,n){return Yt(i).updateRoutingVariable(e,t,n).then(function(e){return e(s,a)})}}},h.RoutingVariableServiceApi=en,h.SkillServiceApiAxiosParamCreator=nn,h.SkillServiceApiFp=rn,h.SkillServiceApiFactory=function(o,u,c){return{createSkill:function(e,t){return rn(o).createSkill(e,t).then(function(e){return e(c,u)})},deleteSkill:function(e,t,n){return rn(o).deleteSkill(e,t,n).then(function(e){return e(c,u)})},readSkill:function(e,t,n){return rn(o).readSkill(e,t,n).then(function(e){return e(c,u)})},searchSkill:function(e,t,n,r,i,a,s){return rn(o).searchSkill(e,t,n,r,i,a,s).then(function(e){return e(c,u)})},updateSkill:function(e,t,n){return rn(o).updateSkill(e,t,n).then(function(e){return e(c,u)})}}},h.SkillServiceApi=sn,h.TriggerServiceApiAxiosParamCreator=un,h.TriggerServiceApiFp=S,h.TriggerServiceApiFactory=function(c,l,d){return{createTrigger:function(e,t){return S(c).createTrigger(e,t).then(function(e){return e(d,l)})},createTriggerJob:function(e,t,n){return S(c).createTriggerJob(e,t,n).then(function(e){return e(d,l)})},deleteTrigger:function(e,t){return S(c).deleteTrigger(e,t).then(function(e){return e(d,l)})},patchTrigger:function(e,t,n){return S(c).patchTrigger(e,t,n).then(function(e){return e(d,l)})},readTrigger:function(e,t){return S(c).readTrigger(e,t).then(function(e){return e(d,l)})},searchTrigger:function(e,t,n,r,i,a,s,o){return S(c).searchTrigger(e,t,n,r,i,a,s,o).then(function(e){return e(d,l)})},searchTriggerJob:function(e,t,n,r,i,a,s,o,u){return S(c).searchTriggerJob(e,t,n,r,i,a,s,o,u).then(function(e){return e(d,l)})},updateTrigger:function(e,t,n){return S(c).updateTrigger(e,t,n).then(function(e){return e(d,l)})}}},h.TriggerServiceApi=ln,h.UserHelperServiceApiAxiosParamCreator=_n,h.UserHelperServiceApiFp=hn,h.UserHelperServiceApiFactory=function(n,r,i){return{defaultDeviceConfig:function(e,t){return hn(n).defaultDeviceConfig(e,t).then(function(e){return e(i,r)})}}},h.UserHelperServiceApi=fn,h.Configuration=vn,h.Client=K,h.Call=Kn,h.Agent=Sn,h.Conversation=Tn,h.DeviceNotFoundError=kn,h.DeviceNotAllowPermissionError=Xn,h.RolePermissionError=jn,h.SipClient=$n,h.ExternalClient=er,h.SipPhone=An,h.Log=yn,Object.defineProperty(h,"__esModule",{value:!0})});
|
|
2
2
|
//# sourceMappingURL=index.umd.min.js.map
|