. // // @ignore // =================================================================================================== /** * @package Kaltura * @subpackage Client */ class Kaltura_Client_Attachment_AttachmentAssetService extends Kaltura_Client_ServiceBase { function __construct(Kaltura_Client_Client $client = null) { parent::__construct($client); } function add($entryId, Kaltura_Client_Attachment_Type_AttachmentAsset $attachmentAsset) { $kparams = array(); $this->client->addParam($kparams, "entryId", $entryId); $this->client->addParam($kparams, "attachmentAsset", $attachmentAsset->toParams()); $this->client->queueServiceActionCall("attachment_attachmentasset", "add", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Attachment_Type_AttachmentAsset"); return $resultObject; } function setContent($id, Kaltura_Client_Type_ContentResource $contentResource) { $kparams = array(); $this->client->addParam($kparams, "id", $id); $this->client->addParam($kparams, "contentResource", $contentResource->toParams()); $this->client->queueServiceActionCall("attachment_attachmentasset", "setContent", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Attachment_Type_AttachmentAsset"); return $resultObject; } function update($id, Kaltura_Client_Attachment_Type_AttachmentAsset $attachmentAsset) { $kparams = array(); $this->client->addParam($kparams, "id", $id); $this->client->addParam($kparams, "attachmentAsset", $attachmentAsset->toParams()); $this->client->queueServiceActionCall("attachment_attachmentasset", "update", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Attachment_Type_AttachmentAsset"); return $resultObject; } function getUrl($id, $storageId = null) { $kparams = array(); $this->client->addParam($kparams, "id", $id); $this->client->addParam($kparams, "storageId", $storageId); $this->client->queueServiceActionCall("attachment_attachmentasset", "getUrl", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); if(!$resultObject) $resultObject = array(); $this->client->validateObjectType($resultObject, "string"); return $resultObject; } function getRemotePaths($id) { $kparams = array(); $this->client->addParam($kparams, "id", $id); $this->client->queueServiceActionCall("attachment_attachmentasset", "getRemotePaths", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Type_RemotePathListResponse"); return $resultObject; } function serve($attachmentAssetId) { $kparams = array(); $this->client->addParam($kparams, "attachmentAssetId", $attachmentAssetId); $this->client->queueServiceActionCall('attachment_attachmentasset', 'serve', $kparams); $resultObject = $this->client->getServeUrl(); return $resultObject; } function get($attachmentAssetId) { $kparams = array(); $this->client->addParam($kparams, "attachmentAssetId", $attachmentAssetId); $this->client->queueServiceActionCall("attachment_attachmentasset", "get", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Attachment_Type_AttachmentAsset"); return $resultObject; } function listAction(Kaltura_Client_Type_AssetFilter $filter = null, Kaltura_Client_Type_FilterPager $pager = null) { $kparams = array(); if ($filter !== null) $this->client->addParam($kparams, "filter", $filter->toParams()); if ($pager !== null) $this->client->addParam($kparams, "pager", $pager->toParams()); $this->client->queueServiceActionCall("attachment_attachmentasset", "list", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); $this->client->validateObjectType($resultObject, "Kaltura_Client_Attachment_Type_AttachmentAssetListResponse"); return $resultObject; } function delete($attachmentAssetId) { $kparams = array(); $this->client->addParam($kparams, "attachmentAssetId", $attachmentAssetId); $this->client->queueServiceActionCall("attachment_attachmentasset", "delete", $kparams); if ($this->client->isMultiRequest()) return $this->client->getMultiRequestResult(); $resultObject = $this->client->doQueue(); $this->client->throwExceptionIfError($resultObject); return $resultObject; } }