/** @license ms-rest-js * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt and ThirdPartyNotices.txt in the project root for license information. */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.msRest={})}(this,function(N){"use strict";function r(e){return e.toLowerCase()}var d=(e.prototype.set=function(e,t){this._headersMap[r(e)]={name:e,value:t.toString()}},e.prototype.get=function(e){var t=this._headersMap[r(e)];return t?t.value:void 0},e.prototype.contains=function(e){return!!this._headersMap[r(e)]},e.prototype.remove=function(e){var t=this.contains(e);return delete this._headersMap[r(e)],t},e.prototype.rawHeaders=function(){var e={};for(var t in this._headersMap){var r=this._headersMap[t];e[r.name.toLowerCase()]=r.value}return e},e.prototype.headersArray=function(){var e=[];for(var t in this._headersMap)e.push(this._headersMap[t]);return e},e.prototype.headerNames=function(){for(var e=[],t=this.headersArray(),r=0;r>>((3&t)<<3)&255;return n}}}(t={exports:{}},t.exports),t.exports),n=[],o=0;o<256;++o)n[o]=(o+256).toString(16).substr(1);var l=function(e,t){var r=t||0;return[n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]]].join("")};var i=function(e,t,r){var n=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||u)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var i=0;i<16;++i)t[n+i]=o[i];return t||l(o)},c={msRestVersion:"1.11.2",HTTP:"http:",HTTPS:"https:",HTTP_PROXY:"HTTP_PROXY",HTTPS_PROXY:"HTTPS_PROXY",HttpConstants:{HttpVerbs:{PUT:"PUT",GET:"GET",DELETE:"DELETE",POST:"POST",MERGE:"MERGE",HEAD:"HEAD",PATCH:"PATCH"},StatusCodes:{TooManyRequests:429}},HeaderConstants:{AUTHORIZATION:"authorization",AUTHORIZATION_SCHEME:"Bearer",RETRY_AFTER:"Retry-After",USER_AGENT:"User-Agent"}},f="undefined"!=typeof process&&!!process.version&&!!process.versions&&!!process.versions.node;function v(e){var t={};return t.body=e.bodyAsText,t.headers=e.headers,t.status=e.status,t}function g(e){var t=e.clone();return t.headers&&t.headers.remove("authorization"),t}function p(e){return new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$","ig").test(e)}function y(){return i()}function h(t,r){return new Promise(function(e){return setTimeout(function(){return e(r)},t)})}var m=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function b(e){return m.test(e)}function w(e,t,r){return e&&t?e.split(t).join(r||""):e}var E=(R.prototype.validateConstraints=function(e,r,n){function t(e,t){throw new Error('"'+n+'" with value "'+r+'" should satisfy the constraint "'+e+'": '+t+".")}if(e.constraints&&null!=r){var o=e.constraints,i=o.ExclusiveMaximum,a=o.ExclusiveMinimum,s=o.InclusiveMaximum,u=o.InclusiveMinimum,l=o.MaxItems,c=o.MaxLength,f=o.MinItems,p=o.MinLength,h=o.MultipleOf,d=o.Pattern,y=o.UniqueItems;null!=i&&i<=r&&t("ExclusiveMaximum",i),null!=a&&r<=a&&t("ExclusiveMinimum",a),null!=s&&sl&&t("MaxItems",l),null!=c&&r.length>c&&t("MaxLength",c),null!=f&&r.lengtha[0]&&t[1]'+ee.serializeToString(r)}function re(e){for(var t=[],r=0,n=Object.keys(e);r> Request: "+JSON.stringify(t.request,void 0,2)),e.logger(">> Response status code: "+t.status);var r=t.bodyAsText;return e.logger(">> Body: "+r),Promise.resolve(t)}(t,e)})},Ct);function Ct(e,t,r){void 0===r&&(r=console.log);var n=At.call(this,e,t)||this;return n.logger=r,n}var Dt=c.HeaderConstants,It=(Ut.prototype.signRequest=function(e){return e.headers||(e.headers=new d),e.headers.set(Dt.AUTHORIZATION,this.authorizationScheme+" "+this.token),Promise.resolve(e)},Ut);function Ut(e,t){if(void 0===t&&(t="Bearer"),this.authorizationScheme="Bearer",!e)throw new Error("token cannot be null or undefined.");this.token=e,this.authorizationScheme=t}var Ht=c.HeaderConstants,kt=(Mt.prototype.signRequest=function(e){var t=this.userName+":"+this.password,r=this.authorizationScheme+" "+btoa(t);return e.headers||(e.headers=new d),e.headers.set(Ht.AUTHORIZATION,r),Promise.resolve(e)},Mt);function Mt(e,t,r){if(void 0===r&&(r="Basic"),this.authorizationScheme="Basic",null==e||"string"!=typeof e.valueOf())throw new Error("userName cannot be null or undefined and must be of type string.");if(null==t||"string"!=typeof t.valueOf())throw new Error("password cannot be null or undefined and must be of type string.");this.userName=e,this.password=t,this.authorizationScheme=r}var zt=(jt.prototype.signRequest=function(e){if(!e)return Promise.reject(new Error('webResource cannot be null or undefined and must be of type "object".'));if(this.inHeader)for(var t in e.headers||(e.headers=new d),this.inHeader)e.headers.set(t,this.inHeader[t]);if(this.inQuery){if(!e.url)return Promise.reject(new Error("url cannot be null in the request object."));for(var r in e.url.indexOf("?")<0&&(e.url+="?"),this.inQuery)e.url.endsWith("?")||(e.url+="&"),e.url+=r+"="+this.inQuery[r]}return Promise.resolve(e)},jt);function jt(e){if(!e||e&&!e.inHeader&&!e.inQuery)throw new Error('options cannot be null or undefined. Either "inHeader" or "inQuery" property of the options object needs to be provided.');this.inHeader=e.inHeader,this.inQuery=e.inQuery}var Lt,Bt=(S(Ft,Lt=zt),Ft);function Ft(e){if(!e||e&&"string"!=typeof e)throw new Error("topicKey cannot be null or undefined and must be of type string.");var t={inHeader:{"aeg-sas-key":e}};return Lt.call(this,t)||this}var $t,Qt=(S(Vt,$t=zt),Vt);function Vt(e){if(!e||e&&"string"!=typeof e)throw new Error("domainKey cannot be null or undefined and must be of type string.");var t={inHeader:{"aeg-sas-key":e}};return $t.call(this,t)||this}N.WebResource=q,N.DefaultHttpClient=L,N.HttpHeaders=d,N.RestError=M,N.ServiceClient=_t,N.flattenResponse=Nt,N.Constants=c,N.logPolicy=function(r){return void 0===r&&(r=console.log),{create:function(e,t){return new qt(e,t,r)}}},N.BaseRequestPolicy=ne,N.RequestPolicyOptions=ie,N.generateClientRequestIdPolicy=be,N.exponentialRetryPolicy=de,N.systemErrorRetryPolicy=rt,N.throttlingRetryPolicy=gt,N.getDefaultProxySettings=ht,N.proxyPolicy=dt,N.redirectPolicy=$e,N.signingPolicy=Ke,N.userAgentPolicy=Se,N.getDefaultUserAgentValue=Pe,N.deserializationPolicy=se,N.deserializeResponseBody=he,N.MapperType=A,N.Serializer=E,N.serializeObject=function e(t){if(null!=t){if(t instanceof Uint8Array)return t=s(t);if(t instanceof Date)return t.toISOString();if(Array.isArray(t)){for(var r=[],n=0;n