<commit_before><?php

/**
 * Sending beacons on objects
 *
 * @service beacon
 * @package plugins.beacon
 * @subpackage api.services
 */
class BeaconService extends KalturaBaseService
{
	public function initService($serviceId, $serviceName, $actionName)
	{
		if (($actionName == 'getLast' || $actionName == 'enhanceSearch') && !kCurrentContext::$is_admin_session)
			throw new KalturaAPIException(KalturaErrors::SERVICE_FORBIDDEN, $this->serviceName . '->' . $this->actionName);
		
		parent::initService($serviceId, $serviceName, $actionName);
	}
	
	/**
	 * @action add
	 * @param KalturaBeacon $beacon
	 * @param KalturaNullableBoolean $shouldLog
	 * @return bool
	 */
	public function addAction(KalturaBeacon $beacon, $shouldLog = KalturaNullableBoolean::FALSE_VALUE)
	{
		$beaconObj = $beacon->toInsertableObject();
		$beaconObj->index($shouldLog);
		
		return true;
	}
	
	/**
	 * @action list
	 * @param KalturaBeaconFilter $filter
	 * @param KalturaFilterPager $pager
	 * @return KalturaBeaconListResponse
	 * @throws KalturaAPIException
	 */
	public function listAction(KalturaBeaconFilter $filter = null, KalturaFilterPager $pager = null)
	{
		if (!$filter)
			$filter = new KalturaBeaconFilter();
		
		if (!$pager)
			$pager = new KalturaFilterPager();
		
		return $filter->getListResponse($pager);
	}
	
	/**
	 * @action enhanceSearch
	 * @param KalturaBeaconEnhanceFilter $filter
	 * @param KalturaFilterPager $pager
	 * @return KalturaBeaconListResponse
	 * @throws KalturaAPIException
	 */
	
	public function enhanceSearchAction(KalturaBeaconEnhanceFilter $filter = null, KalturaFilterPager $pager = null)
	{
		if (!$filter)
			$filter = new KalturaBeaconEnhanceFilter();
		
		if(!$pager)
			$pager = new KalturaFilterPager();
		
		return $filter->enhanceSearch($pager);
	}

	/**
	 * @action SearchScheduledResource
	 * @param KalturaBeaconSearchParams $searchParams
	 * @param KalturaPager $pager
	 * @return KalturaBeaconListResponse
	 * @throws KalturaAPIException
	 */

	public function SearchScheduledResourceAction(KalturaBeaconSearchParams $searchParams, KalturaPager $pager = null)
	{
		return new KalturaBeaconListResponse();
	}

}<commit_msg>Naos-14.9.0-PLAT-9384 fixing action name<commit_after><?php

/**
 * Sending beacons on objects
 *
 * @service beacon
 * @package plugins.beacon
 * @subpackage api.services
 */
class BeaconService extends KalturaBaseService
{
	public function initService($serviceId, $serviceName, $actionName)
	{
		if (($actionName == 'getLast' || $actionName == 'enhanceSearch') && !kCurrentContext::$is_admin_session)
			throw new KalturaAPIException(KalturaErrors::SERVICE_FORBIDDEN, $this->serviceName . '->' . $this->actionName);
		
		parent::initService($serviceId, $serviceName, $actionName);
	}
	
	/**
	 * @action add
	 * @param KalturaBeacon $beacon
	 * @param KalturaNullableBoolean $shouldLog
	 * @return bool
	 */
	public function addAction(KalturaBeacon $beacon, $shouldLog = KalturaNullableBoolean::FALSE_VALUE)
	{
		$beaconObj = $beacon->toInsertableObject();
		$beaconObj->index($shouldLog);
		
		return true;
	}
	
	/**
	 * @action list
	 * @param KalturaBeaconFilter $filter
	 * @param KalturaFilterPager $pager
	 * @return KalturaBeaconListResponse
	 * @throws KalturaAPIException
	 */
	public function listAction(KalturaBeaconFilter $filter = null, KalturaFilterPager $pager = null)
	{
		if (!$filter)
			$filter = new KalturaBeaconFilter();
		
		if (!$pager)
			$pager = new KalturaFilterPager();
		
		return $filter->getListResponse($pager);
	}
	
	/**
	 * @action enhanceSearch
	 * @param KalturaBeaconEnhanceFilter $filter
	 * @param KalturaFilterPager $pager
	 * @return KalturaBeaconListResponse
	 * @throws KalturaAPIException
	 */
	
	public function enhanceSearchAction(KalturaBeaconEnhanceFilter $filter = null, KalturaFilterPager $pager = null)
	{
		if (!$filter)
			$filter = new KalturaBeaconEnhanceFilter();
		
		if(!$pager)
			$pager = new KalturaFilterPager();
		
		return $filter->enhanceSearch($pager);
	}

	/**
	 * @action searchScheduledResource
	 * @param KalturaBeaconSearchParams $searchParams
	 * @param KalturaPager $pager
	 * @return KalturaBeaconListResponse
	 * @throws KalturaAPIException
	 */

	public function SearchScheduledResourceAction(KalturaBeaconSearchParams $searchParams, KalturaPager $pager = null)
	{
		return new KalturaBeaconListResponse();
	}

}
{'fraction_non_alphanumeric': 0.11693085228577992, 'fraction_numerical': 0.001837813002526993, 'mean_word_length': 4.907734056987788, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2354339', 'n_tokens_mistral': 1556, 'n_tokens_neox': 1413, 'n_words': 283}