Class: Kaltura::KalturaUserService

Inherits:
KalturaServiceBase show all
Defined in:
lib/kaltura_client.rb

Overview

Manage partner users on Kaltura’s side

The userId in kaltura is the unique Id in the partner's system, and the [partnerId,Id] couple are unique key in kaltura's DB

Instance Attribute Summary

Attributes inherited from KalturaServiceBase

#client

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ KalturaUserService

Returns a new instance of KalturaUserService.



13748
13749
13750
# File 'lib/kaltura_client.rb', line 13748

def initialize(client)
	super(client)
end

Instance Method Details

#add(user) ⇒ Object

Adds a new user to an existing account in the Kaltura database. Input param $id is the unique identifier in the partner’s system.



13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
# File 'lib/kaltura_client.rb', line 13755

def add(user)
	kparams = {}
	# The new user
	client.add_param(kparams, 'user', user);
	client.queue_service_action_call('user', 'add', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#add_from_bulk_upload(file_data, bulk_upload_data = KalturaNotImplemented, bulk_upload_user_data = KalturaNotImplemented) ⇒ Object



13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
# File 'lib/kaltura_client.rb', line 13991

def add_from_bulk_upload(file_data, bulk_upload_data=KalturaNotImplemented, bulk_upload_user_data=KalturaNotImplemented)
	kparams = {}
	client.add_param(kparams, 'fileData', file_data);
	client.add_param(kparams, 'bulkUploadData', bulk_upload_data);
	client.add_param(kparams, 'bulkUploadUserData', bulk_upload_user_data);
	client.queue_service_action_call('user', 'addFromBulkUpload', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#check_login_data_exists(filter) ⇒ Object

Action which checks whther user login



14005
14006
14007
14008
14009
14010
14011
14012
14013
# File 'lib/kaltura_client.rb', line 14005

def (filter)
	kparams = {}
	client.add_param(kparams, 'filter', filter);
	client.queue_service_action_call('user', 'checkLoginDataExists', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#delete(user_id) ⇒ Object

Deletes a user from a partner account.



13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
# File 'lib/kaltura_client.rb', line 13811

def delete(user_id)
	kparams = {}
	# The user's unique identifier in the partner's system
	client.add_param(kparams, 'userId', user_id);
	client.queue_service_action_call('user', 'delete', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#disable_login(user_id = KalturaNotImplemented, login_id = KalturaNotImplemented) ⇒ Object

Disables a user’s ability to log into a partner account using an email address and a password. You may use either a userId or a loginId parameter for this action.



13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
# File 'lib/kaltura_client.rb', line 13965

def (user_id=KalturaNotImplemented, =KalturaNotImplemented)
	kparams = {}
	# The user's unique identifier in the partner's system
	client.add_param(kparams, 'userId', user_id);
	# The user's email address that identifies the user for login
	client.add_param(kparams, 'loginId', );
	client.queue_service_action_call('user', 'disableLogin', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#enable_login(user_id, login_id, password = KalturaNotImplemented) ⇒ Object

Enables a user to log into a partner account using an email address and a password



13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
# File 'lib/kaltura_client.rb', line 13947

def (user_id, , password=KalturaNotImplemented)
	kparams = {}
	# The user's unique identifier in the partner's system
	client.add_param(kparams, 'userId', user_id);
	# The user's email address that identifies the user for login
	client.add_param(kparams, 'loginId', );
	# The user's password
	client.add_param(kparams, 'password', password);
	client.queue_service_action_call('user', 'enableLogin', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#get(user_id = KalturaNotImplemented) ⇒ Object

Retrieves a user object for a specified user ID.



13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
# File 'lib/kaltura_client.rb', line 13784

def get(user_id=KalturaNotImplemented)
	kparams = {}
	# The user's unique identifier in the partner's system
	client.add_param(kparams, 'userId', user_id);
	client.queue_service_action_call('user', 'get', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#get_by_login_id(login_id) ⇒ Object

Retrieves a user object for a user’s login ID and partner ID. A login ID is the email address used by a user to log into the system.



13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
# File 'lib/kaltura_client.rb', line 13798

def ()
	kparams = {}
	# The user's email address that identifies the user for login
	client.add_param(kparams, 'loginId', );
	client.queue_service_action_call('user', 'getByLoginId', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#index(id, should_update = true) ⇒ Object

Index an entry by id.



13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
# File 'lib/kaltura_client.rb', line 13980

def index(id, should_update=true)
	kparams = {}
	client.add_param(kparams, 'id', id);
	client.add_param(kparams, 'shouldUpdate', should_update);
	client.queue_service_action_call('user', 'index', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ Object

Lists user objects that are associated with an account. Blocked users are listed unless you use a filter to exclude them. Deleted users are not listed unless you use a filter to include them.



13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
# File 'lib/kaltura_client.rb', line 13826

def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)
	kparams = {}
	# A filter used to exclude specific types of users
	client.add_param(kparams, 'filter', filter);
	# A limit for the number of records to display on a page
	client.add_param(kparams, 'pager', pager);
	client.queue_service_action_call('user', 'list', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#login(partner_id, user_id, password, expiry = 86400, privileges = '*') ⇒ Object

Logs a user into a partner account with a partner ID, a partner user ID (puser), and a user password.



13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
# File 'lib/kaltura_client.rb', line 13854

def (partner_id, user_id, password, expiry=86400, privileges='*')
	kparams = {}
	# The identifier of the partner account
	client.add_param(kparams, 'partnerId', partner_id);
	# The user's unique identifier in the partner's system
	client.add_param(kparams, 'userId', user_id);
	# The user's password
	client.add_param(kparams, 'password', password);
	# The requested time (in seconds) before the generated KS expires (By default, a KS expires after 24 hours).
	client.add_param(kparams, 'expiry', expiry);
	# Special privileges
	client.add_param(kparams, 'privileges', privileges);
	client.queue_service_action_call('user', 'login', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#login_by_login_id(login_id, password, partner_id = KalturaNotImplemented, expiry = 86400, privileges = '*') ⇒ Object

Logs a user into a partner account with a user login ID and a user password.



13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
# File 'lib/kaltura_client.rb', line 13875

def (, password, partner_id=KalturaNotImplemented, expiry=86400, privileges='*')
	kparams = {}
	# The user's email address that identifies the user for login
	client.add_param(kparams, 'loginId', );
	# The user's password
	client.add_param(kparams, 'password', password);
	# The identifier of the partner account
	client.add_param(kparams, 'partnerId', partner_id);
	# The requested time (in seconds) before the generated KS expires (By default, a KS expires after 24 hours).
	client.add_param(kparams, 'expiry', expiry);
	# Special privileges
	client.add_param(kparams, 'privileges', privileges);
	client.queue_service_action_call('user', 'loginByLoginId', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#notify_ban(user_id) ⇒ Object

Notifies that a user is banned from an account.



13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
# File 'lib/kaltura_client.rb', line 13841

def notify_ban(user_id)
	kparams = {}
	# The user's unique identifier in the partner's system
	client.add_param(kparams, 'userId', user_id);
	client.queue_service_action_call('user', 'notifyBan', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#reset_password(email) ⇒ Object

Reset user’s password and send the user an email to generate a new one.



13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
# File 'lib/kaltura_client.rb', line 13919

def reset_password(email)
	kparams = {}
	# The user's email address (login email)
	client.add_param(kparams, 'email', email);
	client.queue_service_action_call('user', 'resetPassword', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#set_initial_password(hash_key, new_password) ⇒ Object

Set initial users password



13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
# File 'lib/kaltura_client.rb', line 13932

def set_initial_password(hash_key, new_password)
	kparams = {}
	# The hash key used to identify the user (retrieved by email)
	client.add_param(kparams, 'hashKey', hash_key);
	# The new password to set for the user
	client.add_param(kparams, 'newPassword', new_password);
	client.queue_service_action_call('user', 'setInitialPassword', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#update(user_id, user) ⇒ Object

Updates an existing user object. You can also use this action to update the userId.



13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
# File 'lib/kaltura_client.rb', line 13769

def update(user_id, user)
	kparams = {}
	# The user's unique identifier in the partner's system
	client.add_param(kparams, 'userId', user_id);
	# Id The user's unique identifier in the partner's system
	client.add_param(kparams, 'user', user);
	client.queue_service_action_call('user', 'update', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#update_login_data(old_login_id, password, new_login_id = '', new_password = '', new_first_name = KalturaNotImplemented, new_last_name = KalturaNotImplemented) ⇒ Object

Updates a user’s login data: email, password, name.



13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
# File 'lib/kaltura_client.rb', line 13896

def (, password, ='', new_password='', new_first_name=KalturaNotImplemented, new_last_name=KalturaNotImplemented)
	kparams = {}
	# The user's current email address that identified the user for login
	client.add_param(kparams, 'oldLoginId', );
	# The user's current email address that identified the user for login
	client.add_param(kparams, 'password', password);
	# Optional, The user's email address that will identify the user for login
	client.add_param(kparams, 'newLoginId', );
	# Optional, The user's new password
	client.add_param(kparams, 'newPassword', new_password);
	# Optional, The user's new first name
	client.add_param(kparams, 'newFirstName', new_first_name);
	# Optional, The user's new last name
	client.add_param(kparams, 'newLastName', new_last_name);
	client.queue_service_action_call('user', 'updateLoginData', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end