# # Copyright (C) 2007 Mobio Networks, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # class Registration < Mobio::WebServices::WsdlDriver def self.create_passphrase end def self.get_handsets(loginId, password) res = self.driver.getHandsets :loginId => loginId, :password => password res.out end def self.get_security_question(loginId) res = self.driver.getSecurityQuestion :loginId => loginId res.out end #can throw SOAP::FaultError if login / password is invalid def self.get_user_info(loginId, password) res = self.driver.getUserInfo :loginId => loginId, :password => password res.out end def self.is_login_id_available(loginId) res = self.driver.isLoginIdAvailable :loginId => loginId res.out end def self.list_affiliations res = self.driver.listAffiliations "" res.out end def self.register_handset(loginId,password,handset) res = self.driver.registerHandset :userLogin => loginId,:userPassword => password,:handset => handset true end def self.register_user(args={}) regIn= RegisterIn.new args.each do |key, value| if regIn.respond_to?(key) regIn.send "#{key}=", value end end res = self.driver.registerUser :registerIn => regIn end def self.unregister_handset(login,password,handsetId) res = self.driver.unregisterHandset :userLogin => login,:userPassword=>password,:handsetId=>handsetId res.out end def self.update_login_info(arg) res = self.driver.updateLoginInfo :loginUpdate => arg end def self.update_user_info(user) res = self.driver.updateUserInfo :userInfo => user res.out end class RegisterIn attr_accessor :givenName, :familyName, :carrier, :communicationViaEmail, :communicationViaSMS, :dateOfBirthMonth, :dateOfBirthYear, :dateOfBirthDate, :emailAddress, :gender, :primaryRefCode, :secondaryRefCode, :phoneModel, :phoneNumber, :zipCode, :loginId, :registrationID, :mor, :password def initialize() @registrationID = '' @givenName = '' @familyName = '' @carrier = '' @communicationViaEmail = false @communicationViaSMS = true @dateOfBirthMonth = '' @dateOfBirthYear = '' @dateOfBirthDate = '' @emailAddress = '' @gender = '' @primaryRefCode = '' @secondaryRefCode = '' @phoneModel = '' @phoneNumber = '' @zipCode = '' @loginId = '' @password = '' @mor = false end end end