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.



5406
5407
5408
# File 'lib/kaltura_client.rb', line 5406

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.

Returns:



5413
5414
5415
5416
5417
5418
5419
5420
5421
# File 'lib/kaltura_client.rb', line 5413

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

Returns:



5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
# File 'lib/kaltura_client.rb', line 5424

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

Returns:

  • (bool)


5439
5440
5441
5442
5443
5444
5445
5446
5447
# File 'lib/kaltura_client.rb', line 5439

def (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.

Returns:



5451
5452
5453
5454
5455
5456
5457
5458
5459
# File 'lib/kaltura_client.rb', line 5451

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.

Returns:



5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
# File 'lib/kaltura_client.rb', line 5464

def (user_id=KalturaNotImplemented, =KalturaNotImplemented)
  kparams = {}
  client.add_param(kparams, 'userId', user_id)
  client.add_param(kparams, 'loginId', )
  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

Returns:



5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
# File 'lib/kaltura_client.rb', line 5477

def (user_id, , password=KalturaNotImplemented)
  kparams = {}
  client.add_param(kparams, 'userId', user_id)
  client.add_param(kparams, 'loginId', )
  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) ⇒ string

Creates a batch job that sends an email with a link to download a CSV containing a list of users

Returns:

  • (string)


5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
# File 'lib/kaltura_client.rb', line 5491

def export_to_csv(filter=KalturaNotImplemented, =KalturaNotImplemented, additional_fields=KalturaNotImplemented)
  kparams = {}
  client.add_param(kparams, 'filter', filter)
  client.add_param(kparams, 'metadataProfileId', )
  client.add_param(kparams, 'additionalFields', additional_fields)
  client.queue_service_action_call('user', 'exportToCsv', '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.

Returns:



5505
5506
5507
5508
5509
5510
5511
5512
5513
# File 'lib/kaltura_client.rb', line 5505

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.

Returns:



5518
5519
5520
5521
5522
5523
5524
5525
5526
# File 'lib/kaltura_client.rb', line 5518

def ()
  kparams = {}
  client.add_param(kparams, 'loginId', )
  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.

Returns:

  • (string)


5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
# File 'lib/kaltura_client.rb', line 5530

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.



5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
# File 'lib/kaltura_client.rb', line 5545

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.

Returns:

  • (string)


5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
# File 'lib/kaltura_client.rb', line 5558

def (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



5574
5575
5576
5577
5578
5579
5580
5581
5582
# File 'lib/kaltura_client.rb', line 5574

def (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.

Returns:

  • (string)


5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
# File 'lib/kaltura_client.rb', line 5586

def (, password, partner_id=KalturaNotImplemented, expiry=86400, privileges='*', otp=KalturaNotImplemented)
  kparams = {}
  client.add_param(kparams, 'loginId', )
  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

#notify_ban(user_id) ⇒ Object

Notifies that a user is banned from an account.

Returns:



5603
5604
5605
5606
5607
5608
5609
5610
5611
# File 'lib/kaltura_client.rb', line 5603

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) ⇒ Object

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

Returns:



5615
5616
5617
5618
5619
5620
5621
5622
5623
# File 'lib/kaltura_client.rb', line 5615

def reset_password(email)
  kparams = {}
  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

#serve_csv(id) ⇒ string

Will serve a requested CSV

Returns:

  • (string)


5627
5628
5629
5630
5631
5632
5633
5634
5635
# File 'lib/kaltura_client.rb', line 5627

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) ⇒ Object

Set initial user password

Returns:



5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
# File 'lib/kaltura_client.rb', line 5639

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', '', 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.

Returns:



5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
# File 'lib/kaltura_client.rb', line 5653

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) ⇒ Object

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

Returns:



5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
# File 'lib/kaltura_client.rb', line 5666

def (, password, ='', new_password='', new_first_name=KalturaNotImplemented, new_last_name=KalturaNotImplemented)
  kparams = {}
  client.add_param(kparams, 'oldLoginId', )
  client.add_param(kparams, 'password', password)
  client.add_param(kparams, 'newLoginId', )
  client.add_param(kparams, 'newPassword', new_password)
  client.add_param(kparams, 'newFirstName', new_first_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