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.



15928
15929
15930
# File 'lib/kaltura_client.rb', line 15928

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.



15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
# File 'lib/kaltura_client.rb', line 15935

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



16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
# File 'lib/kaltura_client.rb', line 16171

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



16185
16186
16187
16188
16189
16190
16191
16192
16193
# File 'lib/kaltura_client.rb', line 16185

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.



15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
# File 'lib/kaltura_client.rb', line 15991

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.



16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
# File 'lib/kaltura_client.rb', line 16145

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



16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
# File 'lib/kaltura_client.rb', line 16127

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.



15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
# File 'lib/kaltura_client.rb', line 15964

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.



15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
# File 'lib/kaltura_client.rb', line 15978

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.



16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
# File 'lib/kaltura_client.rb', line 16160

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.



16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
# File 'lib/kaltura_client.rb', line 16006

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.



16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
# File 'lib/kaltura_client.rb', line 16034

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.



16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
# File 'lib/kaltura_client.rb', line 16055

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.



16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
# File 'lib/kaltura_client.rb', line 16021

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.



16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
# File 'lib/kaltura_client.rb', line 16099

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



16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
# File 'lib/kaltura_client.rb', line 16112

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.



15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
# File 'lib/kaltura_client.rb', line 15949

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.



16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
# File 'lib/kaltura_client.rb', line 16076

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