function WsmanStackCreateService(){var p={_ObjectID:"WSMAN"};p.NextMessageId=1;p.Address="/wsman";p.xmlParser=require("amt-xml");if(arguments.length==1&&typeof(arguments[0]=="object")){var e=arguments[0].transport;if(e){p.comm=new e(arguments[0])}}else{var e=arguments[0];if(e){p.comm=new e(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6])}}p.PerformAjax=function q(t,r,v,u,s){if(s==null){s=""}p.comm.PerformAjax('"+t,function(w,x,y){if(x!=200){r(p,null,{Header:{HttpError:x}},x,y);return}var z=p.xmlParser.ParseWsman(w);if(!z||z==null){r(p,null,{Header:{HttpError:x}},601,y)}else{r(p,z.Header.ResourceURI,z,200,y)}},v,u)};p.CancelAllQueries=function d(r){p.comm.CancelAllQueries(r)};p.GetNameFromUrl=function(r){var s=r.lastIndexOf("/");return(s==-1)?r:r.substring(s+1)};p.ExecSubscribe=function n(z,t,C,r,B,y,A,w,D,x){var u="",v="",w="";if(D!=null&&x!=null){u='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken'+D+''+x+"";v=''}if(w!=null){w=""+w+""}if(t=="PushWithAck"){t="dmtf.org/wbem/wsman/1/wsman/PushWithAck"}else{if(t=="Push"){t="xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Push"}}var s="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe"+p.Address+""+z+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+c(A)+u+''+C+""+w+""+v+"";p.PerformAjax(s+"",r,B,y,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:m="http://x.com"')};p.ExecUnSubscribe=function o(u,r,w,t,v){var s="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe"+p.Address+""+u+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+c(v)+"
";p.PerformAjax(s+"",r,w,t,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')};p.ExecPut=function m(v,u,r,x,t,w){var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put"+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60.000S"+c(w)+""+b(v,u);p.PerformAjax(s+"",r,x,t)};p.ExecCreate=function f(x,w,r,z,v,y){var u=p.GetNameFromUrl(x);var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create"+p.Address+""+x+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(y)+"';for(var t in w){s+=""+w[t]+""}p.PerformAjax(s+"",r,z,v)};p.ExecDelete=function g(v,u,r,w,t){var s="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete"+p.Address+""+v+""+(p.NextMessageId++)+"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+c(u)+"'+r+"",s,x,u)};p.ExecEnum=function h(t,r,u,s){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate"+p.Address+""+t+""+(p.NextMessageId++)+'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S',r,u,s)};p.ExecPull=function l(u,s,r,v,t){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull"+p.Address+""+u+""+(p.NextMessageId++)+'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S'+s+"99999999",r,v,t)};function b(w,u){if(!w||u==null){return""}var s=p.GetNameFromUrl(w);var v="';for(var t in u){if(!u.hasOwnProperty(t)||t.indexOf("__")===0||t.indexOf("@")===0){continue}if(u[t]==null||typeof u[t]==="function"){continue}if(typeof u[t]==="object"&&u[t]["ReferenceParameters"]){v+=""+u[t].Address+""+u[t]["ReferenceParameters"]["ResourceURI"]+"";var x=u[t]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(x)){for(var r=0;r"+x[r]["Value"]+""}}else{v+=""+x.Value+""}v+=""}else{if(Array.isArray(u[t])){for(var r=0;r"+u[t][r].toString()+""}}else{v+=""+u[t].toString()+""}}}v+="";return v}function a(r){if(!r){return""}var t=" ";for(var s in r){if(!r.hasOwnProperty(s)||s.indexOf("@")!==0){continue}t+=s.substring(1)+'="'+r[s]+'" '}return t}function c(v){if((v==null)||(v=="null")){return""}if(typeof v=="string"){return v}if(v.InstanceID){return''+v.InstanceID+""}var t="";for(var s in v){if(!v.hasOwnProperty(s)){continue}t+='';if(v[s]["ReferenceParameters"]){t+="";t+=""+v[s]["Address"]+""+v[s]["ReferenceParameters"]["ResourceURI"]+"";var u=v[s]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(u)){for(var r=0;r"+u[r]["Value"]+""}}else{t+=""+u.Value+""}t+=""}else{t+=v[s]}t+=""}t+="";return t}return p}module.exports=WsmanStackCreateService;