/**************************************************************
	DO NOT MODIFY THIS FILE
	File is create automatically by
	Hivext WSDL2JS XSL Transformation Utility
**************************************************************/

HNamespace.Define("Users", {

	RegistrationService : HClass.Define("Users.RegistrationService", { extend : HWebService.Provider, props : {

		construct : function() {},

		ConstructClient : function() {
			var oClient = new this.RegistrationPortType;
			oClient.oServiceBind = new this.RegistrationBinding;
			return oClient;
		},

		RegistrationPort : HClass.Define("RegistrationPort", { extend : HRest.Client, props : {
			sNamespace : "http://api.hivext.ru/1.0/users/registration/cross/",
			sLocation : "http://api.hivext.ru/1.0/users/registration/cross/",
			construct : function() {}
		}}),

		RegistrationBinding : HClass.Define("RegistrationBinding", { extend : RegistrationPort, props : {
			aOperationLocation : {
				Activate : "activate",
				CreateAccount : "createaccount",
				CheckEmailExist : "checkemailexist",
				CheckEmailRegistration : "checkemailregistration",
				ResendInvitation : "resendinvitation"
			},

			construct : function() {}

		}}),

		RegistrationPortType : HClass.Define("RegistrationPortType", { props : {
			oServiceBind : null,

			construct : function() {},

			ActivateInput : {
				appid : "string",
				key : "string",
				redirect : "string"
			},

			ActivateOutput : {
				result : "int",
				error : "string"
			},

			CreateAccountInput : {
				appid : "string",
				email : "string",
				password : "string",
				name : "string",
				checkEmail : "boolean",
				welcome : "string"
			},

			CreateAccountOutput : {
				result : "int",
				error : "string"
			},

			CheckEmailExistInput : {
				appid : "string",
				email : "string"
			},

			CheckEmailExistOutput : {
				result : "int",
				error : "string"
			},

			CheckEmailRegistrationInput : {
				appid : "string",
				email : "string"
			},

			CheckEmailRegistrationOutput : {
				result : "int",
				error : "string"
			},

			ResendInvitationInput : {
				appid : "string",
				email : "string",
				welcome : "string"
			},

			ResendInvitationOutput : {
				result : "int",
				error : "string"
			},

			Activate : function() {
				var oServiceBind = this.oServiceBind;			
				if(!oServiceBind) { throw Error("Method name : Activate : binding not found"); }
				var sUrl = oServiceBind.ConstructUrl("Activate");
				var fnCallback = HWebService.Client.FindCallback(arguments);

				// Construct request.
				sUrl += "?" + oServiceBind.ConstructRequest(arguments, this.ActivateInput);	

				// Send request.
				var ActivateOutput = this.ActivateOutput;
				(new HNet.ScriptRequest()).Get(sUrl, function(oResponse) {
					if(fnCallback) fnCallback(oResponse);
				});
			},

			CreateAccount : function() {
				var oServiceBind = this.oServiceBind;
				if(!oServiceBind) { throw Error("Method name : CreateAccount : binding not found"); }
				var sUrl = oServiceBind.ConstructUrl("CreateAccount");
				var fnCallback = HWebService.Client.FindCallback(arguments);

				// Construct request.
				sUrl += "?" + oServiceBind.ConstructRequest(arguments, this.CreateAccountInput);

				// Send request.
				var CreateAccountOutput = this.CreateAccountOutput;
				(new HNet.ScriptRequest()).Get(sUrl, function(oResponse) {
					if(fnCallback) fnCallback(oResponse);
				});
			},

			CheckEmailExist : function() {
				var oServiceBind = this.oServiceBind;
				if(!oServiceBind) { throw Error("Method name : CheckEmailExist : binding not found"); }
				var sUrl = oServiceBind.ConstructUrl("CheckEmailExist");
				var fnCallback = HWebService.Client.FindCallback(arguments);

				// Construct request.
				sUrl += "?" + oServiceBind.ConstructRequest(arguments, this.CheckEmailExistInput);

				// Send request.
				var CheckEmailExistOutput = this.CheckEmailExistOutput;
				(new HNet.ScriptRequest()).Get(sUrl, function(oResponse) {
					if(fnCallback) fnCallback(oResponse);
				});
			},

			CheckEmailRegistration : function() {
				var oServiceBind = this.oServiceBind;
				if(!oServiceBind) { throw Error("Method name : CheckEmailRegistration : binding not found"); }
				var sUrl = oServiceBind.ConstructUrl("CheckEmailRegistration");
				var fnCallback = HWebService.Client.FindCallback(arguments);

				// Construct request.
				sUrl += "?" + oServiceBind.ConstructRequest(arguments, this.CheckEmailRegistrationInput);

				// Send request.
				var CheckEmailRegistrationOutput = this.CheckEmailRegistrationOutput;
				(new HNet.ScriptRequest()).Get(sUrl, function(oResponse) {
					if(fnCallback) fnCallback(oResponse);
				});
			},

			ResendInvitation : function() {
				var oServiceBind = this.oServiceBind;
				if(!oServiceBind) { throw Error("Method name : ResendInvitation : binding not found"); }
				var sUrl = oServiceBind.ConstructUrl("ResendInvitation");
				var fnCallback = HWebService.Client.FindCallback(arguments);

				// Construct request.
				sUrl += "?" + oServiceBind.ConstructRequest(arguments, this.ResendInvitationInput);

				// Send request.
				var ResendInvitationOutput = this.ResendInvitationOutput;
				(new HNet.ScriptRequest()).Get(sUrl, function(oResponse) {
					if(fnCallback) fnCallback(oResponse);
				});
			}

		}})

	}})

});

// !!! STATIC LINK !!!
Users.Registration = (new Users.RegistrationService).ConstructClient();
// !!! STATIC LINK !!!
