# =================================================================================================== # _ __ _ _ # | |/ /__ _| | |_ _ _ _ _ __ _ # | ' . # # @ignore # =================================================================================================== require 'kaltura_client.rb' require File.dirname(__FILE__) + '/kaltura_event_notification_client_plugin.rb' module Kaltura class KalturaEmailNotificationTemplatePriority HIGH = 1 NORMAL = 3 LOW = 5 end class KalturaEmailNotificationFormat HTML = "1" TEXT = "2" end class KalturaEmailNotificationRecipientProviderType STATIC_LIST = "1" CATEGORY = "2" USER = "3" end class KalturaEmailNotificationTemplateOrderBy CREATED_AT_ASC = "+createdAt" ID_ASC = "+id" UPDATED_AT_ASC = "+updatedAt" CREATED_AT_DESC = "-createdAt" ID_DESC = "-id" UPDATED_AT_DESC = "-updatedAt" end class KalturaEmailNotificationRecipient < KalturaObjectBase # Recipient e-mail address # attr_accessor :email # Recipient name # attr_accessor :name def from_xml(xml_element) super self.email = KalturaClientBase.object_from_xml(xml_element.elements['email'], 'KalturaStringValue') self.name = KalturaClientBase.object_from_xml(xml_element.elements['name'], 'KalturaStringValue') end end # Abstract class representing the final output recipients going into the batch mechanism # class KalturaEmailNotificationRecipientJobData < KalturaObjectBase # Provider type of the job data. # attr_accessor :provider_type def from_xml(xml_element) super self.provider_type = xml_element.elements['providerType'].text end end # Abstract core class which provides the recipients (to, CC, BCC) for an email notification # class KalturaEmailNotificationRecipientProvider < KalturaObjectBase def from_xml(xml_element) super end end class KalturaCategoryUserProviderFilter < KalturaFilter attr_accessor :user_id_equal attr_accessor :user_id_in attr_accessor :status_equal attr_accessor :status_in attr_accessor :created_at_greater_than_or_equal attr_accessor :created_at_less_than_or_equal attr_accessor :updated_at_greater_than_or_equal attr_accessor :updated_at_less_than_or_equal attr_accessor :update_method_equal attr_accessor :update_method_in attr_accessor :permission_names_match_and attr_accessor :permission_names_match_or def status_equal=(val) @status_equal = val.to_i end def created_at_greater_than_or_equal=(val) @created_at_greater_than_or_equal = val.to_i end def created_at_less_than_or_equal=(val) @created_at_less_than_or_equal = val.to_i end def updated_at_greater_than_or_equal=(val) @updated_at_greater_than_or_equal = val.to_i end def updated_at_less_than_or_equal=(val) @updated_at_less_than_or_equal = val.to_i end def update_method_equal=(val) @update_method_equal = val.to_i end def from_xml(xml_element) super self.user_id_equal = xml_element.elements['userIdEqual'].text self.user_id_in = xml_element.elements['userIdIn'].text self.status_equal = xml_element.elements['statusEqual'].text self.status_in = xml_element.elements['statusIn'].text self.created_at_greater_than_or_equal = xml_element.elements['createdAtGreaterThanOrEqual'].text self.created_at_less_than_or_equal = xml_element.elements['createdAtLessThanOrEqual'].text self.updated_at_greater_than_or_equal = xml_element.elements['updatedAtGreaterThanOrEqual'].text self.updated_at_less_than_or_equal = xml_element.elements['updatedAtLessThanOrEqual'].text self.update_method_equal = xml_element.elements['updateMethodEqual'].text self.update_method_in = xml_element.elements['updateMethodIn'].text self.permission_names_match_and = xml_element.elements['permissionNamesMatchAnd'].text self.permission_names_match_or = xml_element.elements['permissionNamesMatchOr'].text end end # Job Data representing the provider of recipients for a single categoryId # class KalturaEmailNotificationCategoryRecipientJobData < KalturaEmailNotificationRecipientJobData attr_accessor :category_user_filter def from_xml(xml_element) super self.category_user_filter = KalturaClientBase.object_from_xml(xml_element.elements['categoryUserFilter'], 'KalturaCategoryUserFilter') end end # API object which provides the recipients of category related notifications. # class KalturaEmailNotificationCategoryRecipientProvider < KalturaEmailNotificationRecipientProvider # The ID of the category whose subscribers should receive the email notification. # attr_accessor :category_id attr_accessor :category_user_filter def from_xml(xml_element) super self.category_id = KalturaClientBase.object_from_xml(xml_element.elements['categoryId'], 'KalturaStringValue') self.category_user_filter = KalturaClientBase.object_from_xml(xml_element.elements['categoryUserFilter'], 'KalturaCategoryUserProviderFilter') end end class KalturaEmailNotificationParameter < KalturaEventNotificationParameter def from_xml(xml_element) super end end # JobData representing the static receipient array # class KalturaEmailNotificationStaticRecipientJobData < KalturaEmailNotificationRecipientJobData # Email to emails and names # attr_accessor :email_recipients def from_xml(xml_element) super self.email_recipients = KalturaClientBase.object_from_xml(xml_element.elements['emailRecipients'], 'KalturaKeyValue') end end # API class for recipient provider containing a static list of email recipients. # class KalturaEmailNotificationStaticRecipientProvider < KalturaEmailNotificationRecipientProvider # Email to emails and names # attr_accessor :email_recipients def from_xml(xml_element) super self.email_recipients = KalturaClientBase.object_from_xml(xml_element.elements['emailRecipients'], 'KalturaEmailNotificationRecipient') end end class KalturaEmailNotificationTemplate < KalturaEventNotificationTemplate # Define the email body format # attr_accessor :format # Define the email subject # attr_accessor :subject # Define the email body content # attr_accessor :body # Define the email sender email # attr_accessor :from_email # Define the email sender name # attr_accessor :from_name # Email recipient emails and names # attr_accessor :to # Email recipient emails and names # attr_accessor :cc # Email recipient emails and names # attr_accessor :bcc # Default email addresses to whom the reply should be sent. # attr_accessor :reply_to # Define the email priority # attr_accessor :priority # Email address that a reading confirmation will be sent # attr_accessor :confirm_reading_to # Hostname to use in Message-Id and Received headers and as default HELLO string. # If empty, the value returned by SERVER_NAME is used or 'localhost.localdomain'. # attr_accessor :hostname # Sets the message ID to be used in the Message-Id header. # If empty, a unique id will be generated. # attr_accessor :message_id # Adds a e-mail custom header # attr_accessor :custom_headers def priority=(val) @priority = val.to_i end def from_xml(xml_element) super self.format = xml_element.elements['format'].text self.subject = xml_element.elements['subject'].text self.body = xml_element.elements['body'].text self.from_email = xml_element.elements['fromEmail'].text self.from_name = xml_element.elements['fromName'].text self.to = KalturaClientBase.object_from_xml(xml_element.elements['to'], 'KalturaEmailNotificationRecipientProvider') self.cc = KalturaClientBase.object_from_xml(xml_element.elements['cc'], 'KalturaEmailNotificationRecipientProvider') self.bcc = KalturaClientBase.object_from_xml(xml_element.elements['bcc'], 'KalturaEmailNotificationRecipientProvider') self.reply_to = KalturaClientBase.object_from_xml(xml_element.elements['replyTo'], 'KalturaEmailNotificationRecipientProvider') self.priority = xml_element.elements['priority'].text self.confirm_reading_to = xml_element.elements['confirmReadingTo'].text self.hostname = xml_element.elements['hostname'].text self.message_id = xml_element.elements['messageID'].text self.custom_headers = KalturaClientBase.object_from_xml(xml_element.elements['customHeaders'], 'KalturaKeyValue') end end # JobData representing the dynamic user receipient array # class KalturaEmailNotificationUserRecipientJobData < KalturaEmailNotificationRecipientJobData attr_accessor :filter def from_xml(xml_element) super self.filter = KalturaClientBase.object_from_xml(xml_element.elements['filter'], 'KalturaUserFilter') end end # API class for recipient provider which constructs a dynamic list of recipients according to a user filter # class KalturaEmailNotificationUserRecipientProvider < KalturaEmailNotificationRecipientProvider attr_accessor :filter def from_xml(xml_element) super self.filter = KalturaClientBase.object_from_xml(xml_element.elements['filter'], 'KalturaUserFilter') end end class KalturaEmailNotificationDispatchJobData < KalturaEventNotificationDispatchJobData # Define the email sender email # attr_accessor :from_email # Define the email sender name # attr_accessor :from_name # Email recipient emails and names, key is mail address and value is the name # attr_accessor :to # Email cc emails and names, key is mail address and value is the name # attr_accessor :cc # Email bcc emails and names, key is mail address and value is the name # attr_accessor :bcc # Email addresses that a replies should be sent to, key is mail address and value is the name # attr_accessor :reply_to # Define the email priority # attr_accessor :priority # Email address that a reading confirmation will be sent to # attr_accessor :confirm_reading_to # Hostname to use in Message-Id and Received headers and as default HELO string. # If empty, the value returned by SERVER_NAME is used or 'localhost.localdomain'. # attr_accessor :hostname # Sets the message ID to be used in the Message-Id header. # If empty, a unique id will be generated. # attr_accessor :message_id # Adds a e-mail custom header # attr_accessor :custom_headers def priority=(val) @priority = val.to_i end def from_xml(xml_element) super self.from_email = xml_element.elements['fromEmail'].text self.from_name = xml_element.elements['fromName'].text self.to = KalturaClientBase.object_from_xml(xml_element.elements['to'], 'KalturaEmailNotificationRecipientJobData') self.cc = KalturaClientBase.object_from_xml(xml_element.elements['cc'], 'KalturaEmailNotificationRecipientJobData') self.bcc = KalturaClientBase.object_from_xml(xml_element.elements['bcc'], 'KalturaEmailNotificationRecipientJobData') self.reply_to = KalturaClientBase.object_from_xml(xml_element.elements['replyTo'], 'KalturaEmailNotificationRecipientJobData') self.priority = xml_element.elements['priority'].text self.confirm_reading_to = xml_element.elements['confirmReadingTo'].text self.hostname = xml_element.elements['hostname'].text self.message_id = xml_element.elements['messageID'].text self.custom_headers = KalturaClientBase.object_from_xml(xml_element.elements['customHeaders'], 'KalturaKeyValue') end end class KalturaEmailNotificationTemplateBaseFilter < KalturaEventNotificationTemplateFilter def from_xml(xml_element) super end end class KalturaEmailNotificationTemplateFilter < KalturaEmailNotificationTemplateBaseFilter def from_xml(xml_element) super end end end