Class: Kaltura::KalturaEventNotificationTemplateService

Inherits:
KalturaServiceBase show all
Defined in:
lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb

Overview

Event notification template service lets you create and manage event notification templates

Instance Attribute Summary

Attributes inherited from KalturaServiceBase

#client

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ KalturaEventNotificationTemplateService

Returns a new instance of KalturaEventNotificationTemplateService.



445
446
447
# File 'lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb', line 445

def initialize(client)
  super(client)
end

Instance Method Details

#add(event_notification_template) ⇒ KalturaEventNotificationTemplate

This action allows for the creation of new backend event types in the system. This action requires access to the Kaltura server Admin Console. If you’re looking to register to existing event types, please use the clone action instead.



451
452
453
454
455
456
457
458
459
# File 'lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb', line 451

def add(event_notification_template)
  kparams = {}
  client.add_param(kparams, 'eventNotificationTemplate', event_notification_template)
  client.queue_service_action_call('eventnotification_eventnotificationtemplate', 'add', 'KalturaEventNotificationTemplate', kparams)
  if (client.is_multirequest)
    return nil
  end
  return client.do_queue()
end

#clone(id, event_notification_template = KalturaNotImplemented) ⇒ KalturaEventNotificationTemplate

This action allows registering to various backend event. Use this action to create notifications that will react to events such as new video was uploaded or metadata field was updated. To see the list of available event types, call the listTemplates action.



463
464
465
466
467
468
469
470
471
472
# File 'lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb', line 463

def clone(id, event_notification_template=KalturaNotImplemented)
  kparams = {}
  client.add_param(kparams, 'id', id)
  client.add_param(kparams, 'eventNotificationTemplate', event_notification_template)
  client.queue_service_action_call('eventnotification_eventnotificationtemplate', 'clone', 'KalturaEventNotificationTemplate', kparams)
  if (client.is_multirequest)
    return nil
  end
  return client.do_queue()
end

#delete(id) ⇒ Object

Delete an event notification template object

Returns:



476
477
478
479
480
481
482
483
484
# File 'lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb', line 476

def delete(id)
  kparams = {}
  client.add_param(kparams, 'id', id)
  client.queue_service_action_call('eventnotification_eventnotificationtemplate', 'delete', '', kparams)
  if (client.is_multirequest)
    return nil
  end
  return client.do_queue()
end

#dispatch(id, scope) ⇒ int

Dispatch event notification object by id

Returns:

  • (int)


488
489
490
491
492
493
494
495
496
497
# File 'lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb', line 488

def dispatch(id, scope)
  kparams = {}
  client.add_param(kparams, 'id', id)
  client.add_param(kparams, 'scope', scope)
  client.queue_service_action_call('eventnotification_eventnotificationtemplate', 'dispatch', 'int', kparams)
  if (client.is_multirequest)
    return nil
  end
  return client.do_queue()
end

#get(id) ⇒ KalturaEventNotificationTemplate

Retrieve an event notification template object by id



501
502
503
504
505
506
507
508
509
# File 'lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb', line 501

def get(id)
  kparams = {}
  client.add_param(kparams, 'id', id)
  client.queue_service_action_call('eventnotification_eventnotificationtemplate', 'get', 'KalturaEventNotificationTemplate', kparams)
  if (client.is_multirequest)
    return nil
  end
  return client.do_queue()
end

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

list event notification template objects



513
514
515
516
517
518
519
520
521
522
# File 'lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb', line 513

def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)
  kparams = {}
  client.add_param(kparams, 'filter', filter)
  client.add_param(kparams, 'pager', pager)
  client.queue_service_action_call('eventnotification_eventnotificationtemplate', 'list', 'KalturaEventNotificationTemplateListResponse', kparams)
  if (client.is_multirequest)
    return nil
  end
  return client.do_queue()
end

#list_by_partner(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ KalturaEventNotificationTemplateListResponse



525
526
527
528
529
530
531
532
533
534
# File 'lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb', line 525

def list_by_partner(filter=KalturaNotImplemented, pager=KalturaNotImplemented)
  kparams = {}
  client.add_param(kparams, 'filter', filter)
  client.add_param(kparams, 'pager', pager)
  client.queue_service_action_call('eventnotification_eventnotificationtemplate', 'listByPartner', 'KalturaEventNotificationTemplateListResponse', kparams)
  if (client.is_multirequest)
    return nil
  end
  return client.do_queue()
end

#list_templates(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ KalturaEventNotificationTemplateListResponse

Action lists the template partner event notification templates.



538
539
540
541
542
543
544
545
546
547
# File 'lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb', line 538

def list_templates(filter=KalturaNotImplemented, pager=KalturaNotImplemented)
  kparams = {}
  client.add_param(kparams, 'filter', filter)
  client.add_param(kparams, 'pager', pager)
  client.queue_service_action_call('eventnotification_eventnotificationtemplate', 'listTemplates', 'KalturaEventNotificationTemplateListResponse', kparams)
  if (client.is_multirequest)
    return nil
  end
  return client.do_queue()
end

#register(notification_template_system_name, push_notification_params) ⇒ KalturaPushNotificationData

Register to a queue from which event messages will be provided according to given template. Queue will be created if not already exists



551
552
553
554
555
556
557
558
559
560
# File 'lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb', line 551

def register(notification_template_system_name, push_notification_params)
  kparams = {}
  client.add_param(kparams, 'notificationTemplateSystemName', notification_template_system_name)
  client.add_param(kparams, 'pushNotificationParams', push_notification_params)
  client.queue_service_action_call('eventnotification_eventnotificationtemplate', 'register', 'KalturaPushNotificationData', kparams)
  if (client.is_multirequest)
    return nil
  end
  return client.do_queue()
end

#send_command(notification_template_system_name, push_notification_params, command) ⇒ Object

Clear queue messages

Returns:



564
565
566
567
568
569
570
571
572
573
574
# File 'lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb', line 564

def send_command(notification_template_system_name, push_notification_params, command)
  kparams = {}
  client.add_param(kparams, 'notificationTemplateSystemName', notification_template_system_name)
  client.add_param(kparams, 'pushNotificationParams', push_notification_params)
  client.add_param(kparams, 'command', command)
  client.queue_service_action_call('eventnotification_eventnotificationtemplate', 'sendCommand', '', kparams)
  if (client.is_multirequest)
    return nil
  end
  return client.do_queue()
end

#update(id, event_notification_template) ⇒ KalturaEventNotificationTemplate

Update an existing event notification template object



578
579
580
581
582
583
584
585
586
587
# File 'lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb', line 578

def update(id, event_notification_template)
  kparams = {}
  client.add_param(kparams, 'id', id)
  client.add_param(kparams, 'eventNotificationTemplate', event_notification_template)
  client.queue_service_action_call('eventnotification_eventnotificationtemplate', 'update', 'KalturaEventNotificationTemplate', kparams)
  if (client.is_multirequest)
    return nil
  end
  return client.do_queue()
end

#update_status(id, status) ⇒ KalturaEventNotificationTemplate

Update event notification template status by id



591
592
593
594
595
596
597
598
599
600
# File 'lib/kaltura_plugins/kaltura_event_notification_client_plugin.rb', line 591

def update_status(id, status)
  kparams = {}
  client.add_param(kparams, 'id', id)
  client.add_param(kparams, 'status', status)
  client.queue_service_action_call('eventnotification_eventnotificationtemplate', 'updateStatus', 'KalturaEventNotificationTemplate', kparams)
  if (client.is_multirequest)
    return nil
  end
  return client.do_queue()
end