# =================================================================================================== # _ __ _ _ # | |/ /__ _| | |_ _ _ _ _ __ _ # | ' . # # @ignore # =================================================================================================== require 'kaltura_client.rb' module Kaltura class KalturaLikeOrderBy end class KalturaLike < KalturaObjectBase # The id of the entry that the like belongs to attr_accessor :entry_id # The id of user that the like belongs to attr_accessor :user_id # The date of the like's creation attr_accessor :created_at def created_at=(val) @created_at = val.to_i end def from_xml(xml_element) super if xml_element.elements['entryId'] != nil self.entry_id = xml_element.elements['entryId'].text end if xml_element.elements['userId'] != nil self.user_id = xml_element.elements['userId'].text end if xml_element.elements['createdAt'] != nil self.created_at = xml_element.elements['createdAt'].text end end end class KalturaLikeListResponse < KalturaListResponse attr_accessor :objects def from_xml(xml_element) super if xml_element.elements['objects'] != nil self.objects = KalturaClientBase.object_from_xml(xml_element.elements['objects'], 'KalturaLike') end end end class KalturaLikeBaseFilter < KalturaRelatedFilter attr_accessor :entry_id_equal attr_accessor :entry_id_in attr_accessor :user_id_equal attr_accessor :created_at_greater_than_or_equal attr_accessor :created_at_less_than_or_equal 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 from_xml(xml_element) super if xml_element.elements['entryIdEqual'] != nil self.entry_id_equal = xml_element.elements['entryIdEqual'].text end if xml_element.elements['entryIdIn'] != nil self.entry_id_in = xml_element.elements['entryIdIn'].text end if xml_element.elements['userIdEqual'] != nil self.user_id_equal = xml_element.elements['userIdEqual'].text end if xml_element.elements['createdAtGreaterThanOrEqual'] != nil self.created_at_greater_than_or_equal = xml_element.elements['createdAtGreaterThanOrEqual'].text end if xml_element.elements['createdAtLessThanOrEqual'] != nil self.created_at_less_than_or_equal = xml_element.elements['createdAtLessThanOrEqual'].text end end end class KalturaLikeFilter < KalturaLikeBaseFilter def from_xml(xml_element) super end end # Allows user to 'like' or 'unlike' and entry class KalturaLikeService < KalturaServiceBase def initialize(client) super(client) end # @return [bool] def check_like_exists(entry_id, user_id=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.add_param(kparams, 'userId', user_id) client.queue_service_action_call('like_like', 'checkLikeExists', 'bool', kparams) if (client.is_multirequest) return nil end return client.do_queue() end # @return [bool] def like(entry_id) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.queue_service_action_call('like_like', 'like', 'bool', kparams) if (client.is_multirequest) return nil end return client.do_queue() end # @return [KalturaLikeListResponse] def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'filter', filter) client.add_param(kparams, 'pager', pager) client.queue_service_action_call('like_like', 'list', 'KalturaLikeListResponse', kparams) if (client.is_multirequest) return nil end return client.do_queue() end # @return [bool] def unlike(entry_id) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.queue_service_action_call('like_like', 'unlike', 'bool', kparams) if (client.is_multirequest) return nil end return client.do_queue() end end class KalturaClient < KalturaClientBase attr_reader :like_service def like_service if (@like_service == nil) @like_service = KalturaLikeService.new(self) end return @like_service end end end