Class: Kaltura::KalturaUserService
- Inherits:
-
KalturaServiceBase
- Object
- KalturaServiceBase
- Kaltura::KalturaUserService
- 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
Instance Method Summary collapse
-
#add(user) ⇒ KalturaUser
Adds a new user to an existing account in the Kaltura database.
- #add_from_bulk_upload(file_data, bulk_upload_data = KalturaNotImplemented, bulk_upload_user_data = KalturaNotImplemented) ⇒ KalturaBulkUpload
-
#check_login_data_exists(filter) ⇒ bool
Action which checks whther user login.
-
#delete(user_id) ⇒ KalturaUser
Deletes a user from a partner account.
-
#disable_login(user_id = KalturaNotImplemented, login_id = KalturaNotImplemented) ⇒ KalturaUser
Disables a user’s ability to log into a partner account using an email address and a password.
-
#enable_login(user_id, login_id, password = KalturaNotImplemented) ⇒ KalturaUser
Enables a user to log into a partner account using an email address and a password.
-
#export_to_csv(filter = KalturaNotImplemented, metadata_profile_id = KalturaNotImplemented, additional_fields = KalturaNotImplemented, mapped_fields = KalturaNotImplemented, options = KalturaNotImplemented) ⇒ string
Creates a batch job that sends an email with a link to download a CSV containing a list of users.
-
#generate_qr_code(hash_key) ⇒ string
get QR image content.
-
#get(user_id = KalturaNotImplemented) ⇒ KalturaUser
Retrieves a user object for a specified user ID.
-
#get_by_login_id(login_id) ⇒ KalturaUser
Retrieves a user object for a user’s login ID and partner ID.
-
#index(id, should_update = true) ⇒ string
Index an entry by id.
-
#initialize(client) ⇒ KalturaUserService
constructor
A new instance of KalturaUserService.
-
#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ KalturaUserListResponse
Lists user objects that are associated with an account.
-
#login(partner_id, user_id, password, expiry = 86400, privileges = '*') ⇒ string
Logs a user into a partner account with a partner ID, a partner user ID (puser), and a user password.
-
#login_by_ks(requested_partner_id) ⇒ KalturaSessionResponse
Logs a user to the destination account provided the KS’ user ID is associated with the destination account and the loginData ID matches.
-
#login_by_login_id(login_id, password, partner_id = KalturaNotImplemented, expiry = 86400, privileges = '*', otp = KalturaNotImplemented) ⇒ string
Logs a user into a partner account with a user login ID and a user password.
-
#login_data_reset_password(login_data_id, new_password) ⇒ KalturaUser
Resets user login password.
-
#notify_ban(user_id) ⇒ Object
Notifies that a user is banned from an account.
-
#reset_password(email, link_type = KalturaNotImplemented) ⇒ Object
Reset user’s password and send the user an email to generate a new one.
-
#serve_csv(id) ⇒ string
Will serve a requested CSV.
-
#set_initial_password(hash_key, new_password) ⇒ KalturaAuthentication
Set initial user password.
-
#update(user_id, user) ⇒ KalturaUser
Updates an existing user object.
-
#update_login_data(old_login_id, password, new_login_id = '', new_password = '', new_first_name = KalturaNotImplemented, new_last_name = KalturaNotImplemented, otp = KalturaNotImplemented) ⇒ Object
Updates a user’s login data: email, password, name.
-
#validate_hash_key(hash_key) ⇒ KalturaAuthentication
Validate hash key.
Constructor Details
#initialize(client) ⇒ KalturaUserService
Returns a new instance of KalturaUserService.
5554 5555 5556 |
# File 'lib/kaltura_client.rb', line 5554 def initialize(client) super(client) end |
Instance Method Details
#add(user) ⇒ KalturaUser
Adds a new user to an existing account in the Kaltura database. Input param $id is the unique identifier in the partner’s system.
5561 5562 5563 5564 5565 5566 5567 5568 5569 |
# File 'lib/kaltura_client.rb', line 5561 def add(user) kparams = {} client.add_param(kparams, 'user', user) client.queue_service_action_call('user', 'add', 'KalturaUser', 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) ⇒ KalturaBulkUpload
5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 |
# File 'lib/kaltura_client.rb', line 5572 def add_from_bulk_upload(file_data, bulk_upload_data=KalturaNotImplemented, bulk_upload_user_data=KalturaNotImplemented) kparams = {} kfiles = {} client.add_param(kfiles, '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', 'KalturaBulkUpload', kparams, kfiles) if (client.is_multirequest) return nil end return client.do_queue() end |
#check_login_data_exists(filter) ⇒ bool
Action which checks whther user login
5587 5588 5589 5590 5591 5592 5593 5594 5595 |
# File 'lib/kaltura_client.rb', line 5587 def check_login_data_exists(filter) kparams = {} client.add_param(kparams, 'filter', filter) client.queue_service_action_call('user', 'checkLoginDataExists', 'bool', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#delete(user_id) ⇒ KalturaUser
Deletes a user from a partner account.
5599 5600 5601 5602 5603 5604 5605 5606 5607 |
# File 'lib/kaltura_client.rb', line 5599 def delete(user_id) kparams = {} client.add_param(kparams, 'userId', user_id) client.queue_service_action_call('user', 'delete', 'KalturaUser', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#disable_login(user_id = KalturaNotImplemented, login_id = KalturaNotImplemented) ⇒ KalturaUser
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.
5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 |
# File 'lib/kaltura_client.rb', line 5612 def disable_login(user_id=KalturaNotImplemented, login_id=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'userId', user_id) client.add_param(kparams, 'loginId', login_id) client.queue_service_action_call('user', 'disableLogin', 'KalturaUser', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#enable_login(user_id, login_id, password = KalturaNotImplemented) ⇒ KalturaUser
Enables a user to log into a partner account using an email address and a password
5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 |
# File 'lib/kaltura_client.rb', line 5625 def enable_login(user_id, login_id, password=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'userId', user_id) client.add_param(kparams, 'loginId', login_id) client.add_param(kparams, 'password', password) client.queue_service_action_call('user', 'enableLogin', 'KalturaUser', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#export_to_csv(filter = KalturaNotImplemented, metadata_profile_id = KalturaNotImplemented, additional_fields = KalturaNotImplemented, mapped_fields = KalturaNotImplemented, options = KalturaNotImplemented) ⇒ string
Creates a batch job that sends an email with a link to download a CSV containing a list of users
5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 |
# File 'lib/kaltura_client.rb', line 5639 def export_to_csv(filter=KalturaNotImplemented, =KalturaNotImplemented, additional_fields=KalturaNotImplemented, mapped_fields=KalturaNotImplemented, =KalturaNotImplemented) kparams = {} client.add_param(kparams, 'filter', filter) client.add_param(kparams, 'metadataProfileId', ) client.add_param(kparams, 'additionalFields', additional_fields) client.add_param(kparams, 'mappedFields', mapped_fields) client.add_param(kparams, 'options', ) client.queue_service_action_call('user', 'exportToCsv', 'string', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#generate_qr_code(hash_key) ⇒ string
get QR image content
5655 5656 5657 5658 5659 5660 5661 5662 5663 |
# File 'lib/kaltura_client.rb', line 5655 def generate_qr_code(hash_key) kparams = {} client.add_param(kparams, 'hashKey', hash_key) client.queue_service_action_call('user', 'generateQrCode', 'string', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#get(user_id = KalturaNotImplemented) ⇒ KalturaUser
Retrieves a user object for a specified user ID.
5667 5668 5669 5670 5671 5672 5673 5674 5675 |
# File 'lib/kaltura_client.rb', line 5667 def get(user_id=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'userId', user_id) client.queue_service_action_call('user', 'get', 'KalturaUser', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#get_by_login_id(login_id) ⇒ KalturaUser
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.
5680 5681 5682 5683 5684 5685 5686 5687 5688 |
# File 'lib/kaltura_client.rb', line 5680 def get_by_login_id(login_id) kparams = {} client.add_param(kparams, 'loginId', login_id) client.queue_service_action_call('user', 'getByLoginId', 'KalturaUser', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#index(id, should_update = true) ⇒ string
Index an entry by id.
5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 |
# File 'lib/kaltura_client.rb', line 5692 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', 'string', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ KalturaUserListResponse
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.
5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 |
# File 'lib/kaltura_client.rb', line 5707 def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'filter', filter) client.add_param(kparams, 'pager', pager) client.queue_service_action_call('user', 'list', 'KalturaUserListResponse', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#login(partner_id, user_id, password, expiry = 86400, privileges = '*') ⇒ string
Logs a user into a partner account with a partner ID, a partner user ID (puser), and a user password.
5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 |
# File 'lib/kaltura_client.rb', line 5720 def login(partner_id, user_id, password, expiry=86400, privileges='*') kparams = {} client.add_param(kparams, 'partnerId', partner_id) client.add_param(kparams, 'userId', user_id) client.add_param(kparams, 'password', password) client.add_param(kparams, 'expiry', expiry) client.add_param(kparams, 'privileges', privileges) client.queue_service_action_call('user', 'login', 'string', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#login_by_ks(requested_partner_id) ⇒ KalturaSessionResponse
Logs a user to the destination account provided the KS’ user ID is associated with the destination account and the loginData ID matches
5736 5737 5738 5739 5740 5741 5742 5743 5744 |
# File 'lib/kaltura_client.rb', line 5736 def login_by_ks(requested_partner_id) kparams = {} client.add_param(kparams, 'requestedPartnerId', requested_partner_id) client.queue_service_action_call('user', 'loginByKs', 'KalturaSessionResponse', 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 = '*', otp = KalturaNotImplemented) ⇒ string
Logs a user into a partner account with a user login ID and a user password.
5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 |
# File 'lib/kaltura_client.rb', line 5748 def login_by_login_id(login_id, password, partner_id=KalturaNotImplemented, expiry=86400, privileges='*', otp=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'loginId', login_id) client.add_param(kparams, 'password', password) client.add_param(kparams, 'partnerId', partner_id) client.add_param(kparams, 'expiry', expiry) client.add_param(kparams, 'privileges', privileges) client.add_param(kparams, 'otp', otp) client.queue_service_action_call('user', 'loginByLoginId', 'string', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#login_data_reset_password(login_data_id, new_password) ⇒ KalturaUser
Resets user login password
5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 |
# File 'lib/kaltura_client.rb', line 5765 def login_data_reset_password(login_data_id, new_password) kparams = {} client.add_param(kparams, 'loginDataId', login_data_id) client.add_param(kparams, 'newPassword', new_password) client.queue_service_action_call('user', 'loginDataResetPassword', 'KalturaUser', 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.
5778 5779 5780 5781 5782 5783 5784 5785 5786 |
# File 'lib/kaltura_client.rb', line 5778 def notify_ban(user_id) kparams = {} 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, link_type = KalturaNotImplemented) ⇒ Object
Reset user’s password and send the user an email to generate a new one.
5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 |
# File 'lib/kaltura_client.rb', line 5790 def reset_password(email, link_type=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'email', email) client.add_param(kparams, 'linkType', link_type) client.queue_service_action_call('user', 'resetPassword', '', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#serve_csv(id) ⇒ string
Will serve a requested CSV
5803 5804 5805 5806 5807 5808 5809 5810 5811 |
# File 'lib/kaltura_client.rb', line 5803 def serve_csv(id) kparams = {} client.add_param(kparams, 'id', id) client.queue_service_action_call('user', 'serveCsv', 'string', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#set_initial_password(hash_key, new_password) ⇒ KalturaAuthentication
Set initial user password
5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 |
# File 'lib/kaltura_client.rb', line 5815 def set_initial_password(hash_key, new_password) kparams = {} client.add_param(kparams, 'hashKey', hash_key) client.add_param(kparams, 'newPassword', new_password) client.queue_service_action_call('user', 'setInitialPassword', 'KalturaAuthentication', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#update(user_id, user) ⇒ KalturaUser
Updates an existing user object. You can also use this action to update the userId.
5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 |
# File 'lib/kaltura_client.rb', line 5829 def update(user_id, user) kparams = {} client.add_param(kparams, 'userId', user_id) client.add_param(kparams, 'user', user) client.queue_service_action_call('user', 'update', 'KalturaUser', 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, otp = KalturaNotImplemented) ⇒ Object
Updates a user’s login data: email, password, name.
5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 |
# File 'lib/kaltura_client.rb', line 5842 def update_login_data(old_login_id, password, new_login_id='', new_password='', new_first_name=KalturaNotImplemented, new_last_name=KalturaNotImplemented, otp=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'oldLoginId', old_login_id) client.add_param(kparams, 'password', password) client.add_param(kparams, 'newLoginId', new_login_id) client.add_param(kparams, 'newPassword', new_password) client.add_param(kparams, 'newFirstName', new_first_name) client.add_param(kparams, 'newLastName', new_last_name) client.add_param(kparams, 'otp', otp) client.queue_service_action_call('user', 'updateLoginData', '', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#validate_hash_key(hash_key) ⇒ KalturaAuthentication
Validate hash key
5860 5861 5862 5863 5864 5865 5866 5867 5868 |
# File 'lib/kaltura_client.rb', line 5860 def validate_hash_key(hash_key) kparams = {} client.add_param(kparams, 'hashKey', hash_key) client.queue_service_action_call('user', 'validateHashKey', 'KalturaAuthentication', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |