# =================================================================================================== # _ __ _ _ # | |/ /__ _| | |_ _ _ _ _ __ _ # | ' . # # @ignore # =================================================================================================== require 'kaltura_client.rb' require File.dirname(__FILE__) + '/kaltura_event_notification_client_plugin.rb' module Kaltura class KalturaHttpNotificationAuthenticationMethod ANYSAFE = -18 ANY = -17 BASIC = 1 DIGEST = 2 GSSNEGOTIATE = 4 NTLM = 8 end class KalturaHttpNotificationMethod GET = 1 POST = 2 PUT = 3 DELETE = 4 end class KalturaHttpNotificationSslVersion V2 = 2 V3 = 3 end class KalturaHttpNotificationCertificateType DER = "DER" ENG = "ENG" PEM = "PEM" end class KalturaHttpNotificationSslKeyType DER = "DER" ENG = "ENG" PEM = "PEM" end class KalturaHttpNotificationTemplateOrderBy CREATED_AT_ASC = "+createdAt" ID_ASC = "+id" UPDATED_AT_ASC = "+updatedAt" CREATED_AT_DESC = "-createdAt" ID_DESC = "-id" UPDATED_AT_DESC = "-updatedAt" end # Wrapper for sent notifications # class KalturaHttpNotification < KalturaObjectBase # Object that triggered the notification # attr_accessor :object # Object type that triggered the notification # attr_accessor :event_object_type # ID of the batch job that execute the notification # attr_accessor :event_notification_job_id # ID of the template that triggered the notification # attr_accessor :template_id # Name of the template that triggered the notification # attr_accessor :template_name # System name of the template that triggered the notification # attr_accessor :template_system_name # Ecent type that triggered the notification # attr_accessor :event_type def event_notification_job_id=(val) @event_notification_job_id = val.to_i end def template_id=(val) @template_id = val.to_i end def from_xml(xml_element) super self.object = KalturaClientBase.object_from_xml(xml_element.elements['object'], 'KalturaObjectBase') self.event_object_type = xml_element.elements['eventObjectType'].text self.event_notification_job_id = xml_element.elements['eventNotificationJobId'].text self.template_id = xml_element.elements['templateId'].text self.template_name = xml_element.elements['templateName'].text self.template_system_name = xml_element.elements['templateSystemName'].text self.event_type = xml_element.elements['eventType'].text end end class KalturaHttpNotificationData < KalturaObjectBase def from_xml(xml_element) super end end # If this class used as the template data, the fields will be taken from the content parameters # class KalturaHttpNotificationDataFields < KalturaHttpNotificationData def from_xml(xml_element) super end end class KalturaHttpNotificationDataText < KalturaHttpNotificationData attr_accessor :content def from_xml(xml_element) super self.content = KalturaClientBase.object_from_xml(xml_element.elements['content'], 'KalturaStringValue') end end # Evaluates PHP statement, depends on the execution context # class KalturaHttpNotificationObjectData < KalturaHttpNotificationData # Kaltura API object type # attr_accessor :api_object_type # Data format # attr_accessor :format # Ignore null attributes during serialization # attr_accessor :ignore_null # PHP code # attr_accessor :code def format=(val) @format = val.to_i end def ignore_null=(val) @ignore_null = to_b(val) end def from_xml(xml_element) super self.api_object_type = xml_element.elements['apiObjectType'].text self.format = xml_element.elements['format'].text self.ignore_null = xml_element.elements['ignoreNull'].text self.code = xml_element.elements['code'].text end end class KalturaHttpNotificationTemplate < KalturaEventNotificationTemplate # Remote server URL # attr_accessor :url # Request method. # attr_accessor :method # Data to send. # attr_accessor :data # The maximum number of seconds to allow cURL functions to execute. # attr_accessor :timeout # The number of seconds to wait while trying to connect. # Must be larger than zero. # attr_accessor :connect_timeout # A username to use for the connection. # attr_accessor :username # A password to use for the connection. # attr_accessor :password # The HTTP authentication method to use. # attr_accessor :authentication_method # The SSL version (2 or 3) to use. # By default PHP will try to determine this itself, although in some cases this must be set manually. # attr_accessor :ssl_version # SSL certificate to verify the peer with. # attr_accessor :ssl_certificate # The format of the certificate. # attr_accessor :ssl_certificate_type # The password required to use the certificate. # attr_accessor :ssl_certificate_password # The identifier for the crypto engine of the private SSL key specified in ssl key. # attr_accessor :ssl_engine # The identifier for the crypto engine used for asymmetric crypto operations. # attr_accessor :ssl_engine_default # The key type of the private SSL key specified in ssl key - PEM / DER / ENG. # attr_accessor :ssl_key_type # Private SSL key. # attr_accessor :ssl_key # The secret password needed to use the private SSL key specified in ssl key. # attr_accessor :ssl_key_password # Adds a e-mail custom header # attr_accessor :custom_headers def method=(val) @method = val.to_i end def timeout=(val) @timeout = val.to_i end def connect_timeout=(val) @connect_timeout = val.to_i end def authentication_method=(val) @authentication_method = val.to_i end def ssl_version=(val) @ssl_version = val.to_i end def from_xml(xml_element) super self.url = xml_element.elements['url'].text self.method = xml_element.elements['method'].text self.data = KalturaClientBase.object_from_xml(xml_element.elements['data'], 'KalturaHttpNotificationData') self.timeout = xml_element.elements['timeout'].text self.connect_timeout = xml_element.elements['connectTimeout'].text self.username = xml_element.elements['username'].text self.password = xml_element.elements['password'].text self.authentication_method = xml_element.elements['authenticationMethod'].text self.ssl_version = xml_element.elements['sslVersion'].text self.ssl_certificate = xml_element.elements['sslCertificate'].text self.ssl_certificate_type = xml_element.elements['sslCertificateType'].text self.ssl_certificate_password = xml_element.elements['sslCertificatePassword'].text self.ssl_engine = xml_element.elements['sslEngine'].text self.ssl_engine_default = xml_element.elements['sslEngineDefault'].text self.ssl_key_type = xml_element.elements['sslKeyType'].text self.ssl_key = xml_element.elements['sslKey'].text self.ssl_key_password = xml_element.elements['sslKeyPassword'].text self.custom_headers = KalturaClientBase.object_from_xml(xml_element.elements['customHeaders'], 'KalturaKeyValue') end end class KalturaHttpNotificationDispatchJobData < KalturaEventNotificationDispatchJobData # Remote server URL # attr_accessor :url # Request method. # attr_accessor :method # Data to send. # attr_accessor :data # The maximum number of seconds to allow cURL functions to execute. # attr_accessor :timeout # The number of seconds to wait while trying to connect. # Must be larger than zero. # attr_accessor :connect_timeout # A username to use for the connection. # attr_accessor :username # A password to use for the connection. # attr_accessor :password # The HTTP authentication method to use. # attr_accessor :authentication_method # The SSL version (2 or 3) to use. # By default PHP will try to determine this itself, although in some cases this must be set manually. # attr_accessor :ssl_version # SSL certificate to verify the peer with. # attr_accessor :ssl_certificate # The format of the certificate. # attr_accessor :ssl_certificate_type # The password required to use the certificate. # attr_accessor :ssl_certificate_password # The identifier for the crypto engine of the private SSL key specified in ssl key. # attr_accessor :ssl_engine # The identifier for the crypto engine used for asymmetric crypto operations. # attr_accessor :ssl_engine_default # The key type of the private SSL key specified in ssl key - PEM / DER / ENG. # attr_accessor :ssl_key_type # Private SSL key. # attr_accessor :ssl_key # The secret password needed to use the private SSL key specified in ssl key. # attr_accessor :ssl_key_password # Adds a e-mail custom header # attr_accessor :custom_headers # The secret to sign the notification with # attr_accessor :sign_secret def method=(val) @method = val.to_i end def timeout=(val) @timeout = val.to_i end def connect_timeout=(val) @connect_timeout = val.to_i end def authentication_method=(val) @authentication_method = val.to_i end def ssl_version=(val) @ssl_version = val.to_i end def from_xml(xml_element) super self.url = xml_element.elements['url'].text self.method = xml_element.elements['method'].text self.data = xml_element.elements['data'].text self.timeout = xml_element.elements['timeout'].text self.connect_timeout = xml_element.elements['connectTimeout'].text self.username = xml_element.elements['username'].text self.password = xml_element.elements['password'].text self.authentication_method = xml_element.elements['authenticationMethod'].text self.ssl_version = xml_element.elements['sslVersion'].text self.ssl_certificate = xml_element.elements['sslCertificate'].text self.ssl_certificate_type = xml_element.elements['sslCertificateType'].text self.ssl_certificate_password = xml_element.elements['sslCertificatePassword'].text self.ssl_engine = xml_element.elements['sslEngine'].text self.ssl_engine_default = xml_element.elements['sslEngineDefault'].text self.ssl_key_type = xml_element.elements['sslKeyType'].text self.ssl_key = xml_element.elements['sslKey'].text self.ssl_key_password = xml_element.elements['sslKeyPassword'].text self.custom_headers = KalturaClientBase.object_from_xml(xml_element.elements['customHeaders'], 'KalturaKeyValue') self.sign_secret = xml_element.elements['signSecret'].text end end class KalturaHttpNotificationTemplateBaseFilter < KalturaEventNotificationTemplateFilter def from_xml(xml_element) super end end class KalturaHttpNotificationTemplateFilter < KalturaHttpNotificationTemplateBaseFilter def from_xml(xml_element) super end end end