idx int64 0 60.3k | question stringlengths 101 6.21k | target stringlengths 7 803 |
|---|---|---|
39,300 | public function setAuthor ( array $ author ) { $ person = new Person ( ) ; foreach ( $ author as $ authorInstance ) { Validate :: isInstanceOf ( $ authorInstance , $ person , 'author' ) ; } $ this -> author = $ author ; } | Sets the author of the feed . |
39,301 | public function setCategory ( array $ category ) { $ categoryClassInstance = new Category ( ) ; foreach ( $ category as $ categoryInstance ) { Validate :: isInstanceOf ( $ categoryInstance , $ categoryClassInstance , 'category' ) ; } $ this -> category = $ category ; } | Sets the category of the feed . |
39,302 | public function setContributor ( array $ contributor ) { $ person = new Person ( ) ; foreach ( $ contributor as $ contributorInstance ) { Validate :: isInstanceOf ( $ contributorInstance , $ person , 'contributor' ) ; } $ this -> contributor = $ contributor ; } | Sets contributor . |
39,303 | public function insertTypelessEntity ( array $ entries , $ options = null ) { $ entity = new Entity ( ) ; $ entity -> setPartitionKey ( $ this -> _defaultParitionKey ) ; $ entity -> setRowKey ( uniqid ( ) ) ; foreach ( $ entries as $ columnName => $ value ) { $ entity -> addProperty ( $ columnName , null , $ value ) ; } $ this -> _proxy -> insertEntity ( $ this -> _name , $ entity , $ options ) ; } | Inserts new entity to the table . |
39,304 | public function deleteEntity ( $ paritionKey , $ rowKey ) { $ this -> _proxy -> deleteEntity ( $ this -> _name , $ paritionKey , $ rowKey ) ; } | Deletes an entity using the default partition key and provided row key . |
39,305 | public static function createFromConnectionString ( $ connectionString ) { $ tokenizedSettings = self :: parseAndValidateKeys ( $ connectionString ) ; $ matchedSpecs = self :: matchedSpecification ( $ tokenizedSettings , self :: allRequired ( self :: $ _subscriptionIdSetting , self :: $ _certificatePathSetting ) , self :: optional ( self :: $ _endpointSetting ) ) ; if ( $ matchedSpecs ) { $ endpointUri = Utilities :: tryGetValueInsensitive ( Resources :: SERVICE_MANAGEMENT_ENDPOINT_NAME , $ tokenizedSettings , Resources :: SERVICE_MANAGEMENT_URL ) ; $ subscriptionId = Utilities :: tryGetValueInsensitive ( Resources :: SUBSCRIPTION_ID_NAME , $ tokenizedSettings ) ; $ certificatePath = Utilities :: tryGetValueInsensitive ( Resources :: CERTIFICATE_PATH_NAME , $ tokenizedSettings ) ; return new self ( $ subscriptionId , $ endpointUri , $ certificatePath ) ; } self :: noMatch ( $ connectionString ) ; return null ; } | Creates a ServiceManagementSettings object from the given connection string . |
39,306 | public function getRuntimeClient ( $ versionEndpoint ) { $ versionMap = $ this -> _protocolClient -> getVersionMap ( $ versionEndpoint ) ; foreach ( $ this -> _supportedVersionList as $ factory ) { if ( array_key_exists ( $ factory -> getVersion ( ) , $ versionMap ) ) { return $ factory -> createRuntimeClient ( $ versionMap [ $ factory -> getVersion ( ) ] ) ; } } throw new \ RuntimeException ( Resources :: INVALID_VERSION_MSG ) ; } | Gets the runtime client . |
39,307 | public function fromArray ( array $ options ) { if ( isset ( $ options [ 'PendingFilesCount' ] ) ) { Validate :: isInteger ( $ options [ 'PendingFilesCount' ] , 'options[PendingFilesCount]' ) ; $ this -> _pendingFilesCount = $ options [ 'PendingFilesCount' ] ; } if ( isset ( $ options [ 'FinishedFilesCount' ] ) ) { Validate :: isInteger ( $ options [ 'FinishedFilesCount' ] , 'options[FinishedFilesCount]' ) ; $ this -> _finishedFilesCount = $ options [ 'FinishedFilesCount' ] ; } if ( isset ( $ options [ 'ErrorFilesCount' ] ) ) { Validate :: isInteger ( $ options [ 'ErrorFilesCount' ] , 'options[ErrorFilesCount]' ) ; $ this -> _errorFilesCount = $ options [ 'ErrorFilesCount' ] ; } if ( isset ( $ options [ 'ErrorFilesDetails' ] ) ) { Validate :: isString ( $ options [ 'ErrorFilesDetails' ] , 'options[ErrorFilesDetails]' ) ; $ this -> _errorFilesDetails = $ options [ 'ErrorFilesDetails' ] ; } } | Fill ManifestStatistics from array . |
39,308 | public function parseXml ( $ xmlString ) { $ sourceXml = new \ SimpleXMLElement ( $ xmlString ) ; $ sourceArray = ( array ) $ sourceXml ; if ( array_key_exists ( Resources :: AUTHOR , $ sourceArray ) ) { $ this -> author = $ this -> processAuthorNode ( $ sourceArray ) ; } if ( array_key_exists ( Resources :: CATEGORY , $ sourceArray ) ) { $ this -> category = $ this -> processCategoryNode ( $ sourceArray ) ; } if ( array_key_exists ( Resources :: CONTRIBUTOR , $ sourceArray ) ) { $ this -> contributor = $ this -> processContributorNode ( $ sourceArray ) ; } if ( array_key_exists ( 'generator' , $ sourceArray ) ) { $ generator = new Generator ( ) ; $ generator -> setText ( ( string ) $ sourceArray [ 'generator' ] -> asXML ( ) ) ; $ this -> generator = $ generator ; } if ( array_key_exists ( 'icon' , $ sourceArray ) ) { $ this -> icon = ( string ) $ sourceArray [ 'icon' ] ; } if ( array_key_exists ( 'id' , $ sourceArray ) ) { $ this -> id = ( string ) $ sourceArray [ 'id' ] ; } if ( array_key_exists ( Resources :: LINK , $ sourceArray ) ) { $ this -> link = $ this -> processLinkNode ( $ sourceArray ) ; } if ( array_key_exists ( 'logo' , $ sourceArray ) ) { $ this -> logo = ( string ) $ sourceArray [ 'logo' ] ; } if ( array_key_exists ( 'rights' , $ sourceArray ) ) { $ this -> rights = ( string ) $ sourceArray [ 'rights' ] ; } if ( array_key_exists ( 'subtitle' , $ sourceArray ) ) { $ this -> subtitle = ( string ) $ sourceArray [ 'subtitle' ] ; } if ( array_key_exists ( 'title' , $ sourceArray ) ) { $ this -> title = ( string ) $ sourceArray [ 'title' ] ; } if ( array_key_exists ( 'updated' , $ sourceArray ) ) { $ this -> updated = \ DateTime :: createFromFormat ( \ DateTime :: ATOM , ( string ) $ sourceArray [ 'updated' ] ) ; } } | Creates a source object with specified XML string . |
39,309 | public function writeInnerXml ( \ XMLWriter $ xmlWriter ) { Validate :: notNull ( $ xmlWriter , 'xmlWriter' ) ; if ( ! is_null ( $ this -> attributes ) ) { if ( is_array ( $ this -> attributes ) ) { foreach ( $ this -> attributes as $ attributeName => $ attributeValue ) { $ xmlWriter -> writeAttribute ( $ attributeName , $ attributeValue ) ; } } } if ( ! is_null ( $ this -> author ) ) { Validate :: isArray ( $ this -> author , Resources :: AUTHOR ) ; $ this -> writeArrayItem ( $ xmlWriter , $ this -> author , Resources :: AUTHOR ) ; } if ( ! is_null ( $ this -> category ) ) { Validate :: isArray ( $ this -> category , Resources :: CATEGORY ) ; $ this -> writeArrayItem ( $ xmlWriter , $ this -> category , Resources :: CATEGORY ) ; } if ( ! is_null ( $ this -> contributor ) ) { Validate :: isArray ( $ this -> contributor , Resources :: CONTRIBUTOR ) ; $ this -> writeArrayItem ( $ xmlWriter , $ this -> contributor , Resources :: CONTRIBUTOR ) ; } if ( ! is_null ( $ this -> generator ) ) { $ this -> generator -> writeXml ( $ xmlWriter ) ; } if ( ! is_null ( $ this -> icon ) ) { $ xmlWriter -> writeElementNS ( 'atom' , 'icon' , Resources :: ATOM_NAMESPACE , $ this -> icon ) ; } $ this -> writeOptionalElementNS ( $ xmlWriter , 'atom' , 'logo' , Resources :: ATOM_NAMESPACE , $ this -> logo ) ; $ this -> writeOptionalElementNS ( $ xmlWriter , 'atom' , 'id' , Resources :: ATOM_NAMESPACE , $ this -> id ) ; if ( ! is_null ( $ this -> link ) ) { Validate :: isArray ( $ this -> link , Resources :: LINK ) ; $ this -> writeArrayItem ( $ xmlWriter , $ this -> link , Resources :: LINK ) ; } $ this -> writeOptionalElementNS ( $ xmlWriter , 'atom' , 'rights' , Resources :: ATOM_NAMESPACE , $ this -> rights ) ; $ this -> writeOptionalElementNS ( $ xmlWriter , 'atom' , 'subtitle' , Resources :: ATOM_NAMESPACE , $ this -> subtitle ) ; $ this -> writeOptionalElementNS ( $ xmlWriter , 'atom' , 'title' , Resources :: ATOM_NAMESPACE , $ this -> title ) ; if ( ! is_null ( $ this -> updated ) ) { $ xmlWriter -> writeElementNS ( 'atom' , 'updated' , Resources :: ATOM_NAMESPACE , $ this -> updated -> format ( \ DateTime :: ATOM ) ) ; } } | Writes a inner XML representing the source object . |
39,310 | public function tableExists ( $ name ) { $ tables = $ this -> listTables ( ) ; foreach ( $ tables as $ tableName ) { if ( $ tableName == $ name ) { return true ; } } return false ; } | Checks if a given table name exists or not . |
39,311 | public function listTables ( ) { $ nextTableName = null ; $ tables = array ( ) ; do { $ options = new QueryTablesOptions ( ) ; $ options -> setNextTableName ( $ nextTableName ) ; $ result = $ this -> _tableProxy -> queryTables ( ) ; $ nextTableName = $ result -> getNextTableName ( ) ; $ tables = array_merge ( $ tables , $ result -> getTables ( ) ) ; } while ( ! is_null ( $ nextTableName ) ) ; return $ tables ; } | Lists all tables in this storage service . |
39,312 | public function createTable ( $ name ) { $ cloudTable = null ; try { $ this -> _tableProxy -> createTable ( $ name ) ; $ cloudTable = new CloudTable ( $ name , $ this -> _tableProxy ) ; } catch ( \ Exception $ e ) { if ( $ e -> getCode ( ) == WindowsAzureErrorCodes :: TABLE_ALREADY_EXISTS ) { $ cloudTable = new CloudTable ( $ name , $ this -> _tableProxy ) ; } } return $ cloudTable ; } | Creates table if it does not exist . |
39,313 | public function deleteTable ( $ name ) { try { $ this -> _tableProxy -> deleteTable ( $ name ) ; return true ; } catch ( \ Exception $ ex ) { return false ; } } | Deletes given table . |
39,314 | protected function wrapAtomEntry ( $ entity , array $ links = null ) { Validate :: notNull ( $ entity , 'entity' ) ; $ content = new Content ( ) ; $ content -> setType ( Resources :: XML_CONTENT_TYPE ) ; $ content -> setText ( ContentPropertiesSerializer :: serialize ( $ entity ) ) ; $ atomEntry = new Entry ( ) ; $ atomEntry -> setContent ( $ content ) ; if ( $ links ) { $ atomEntry -> setLink ( $ links ) ; } $ xmlWriter = new \ XMLWriter ( ) ; $ xmlWriter -> openMemory ( ) ; $ atomEntry -> writeXml ( $ xmlWriter ) ; return $ xmlWriter -> outputMemory ( ) ; } | Wraps media services entity with Atom entry . |
39,315 | protected function getPropertiesFromAtomEntry ( Entry $ entry ) { $ result = [ ] ; $ content = $ entry -> getContent ( ) ; if ( ! empty ( $ content ) ) { $ result = ContentPropertiesSerializer :: unserialize ( $ content -> getXml ( ) -> children ( Resources :: DSM_XML_NAMESPACE ) ) ; } return $ result ; } | Extract media service entity from Atom Entry object . |
39,316 | protected function getEntryList ( $ xmlString ) { $ xml = simplexml_load_string ( $ xmlString ) ; if ( $ xml -> getName ( ) == Resources :: ENTRY ) { $ entry = new Entry ( ) ; $ entry -> fromXml ( $ xml ) ; $ entries = [ $ entry ] ; } else { $ feed = new Feed ( ) ; $ feed -> parseXml ( $ xmlString ) ; $ entries = $ feed -> getEntry ( ) ; } $ result = [ ] ; if ( is_array ( $ entries ) ) { foreach ( $ entries as $ entry ) { $ properties = $ this -> getPropertiesFromAtomEntry ( $ entry ) ; if ( ! empty ( $ properties ) ) { $ result [ ] = $ properties ; } } } return $ result ; } | Get array of properties of atom entities passed via feed or single entry . |
39,317 | private function _createEntity ( $ entity , $ path , array $ links = null ) { $ method = Resources :: HTTP_POST ; $ headers = [ ] ; $ postParams = [ ] ; $ queryParams = [ ] ; $ statusCode = Resources :: STATUS_CREATED ; $ body = $ this -> wrapAtomEntry ( $ entity , $ links ) ; $ response = $ this -> sendHttp ( $ method , $ headers , $ queryParams , $ postParams , $ path , $ statusCode , $ body ) ; $ entry = new Entry ( ) ; $ entry -> parseXml ( $ response -> getBody ( ) ) ; return $ this -> getPropertiesFromAtomEntry ( $ entry ) ; } | Create entity . |
39,318 | private function _getEntity ( $ path ) { $ method = Resources :: HTTP_GET ; $ headers = [ ] ; $ postParams = [ ] ; $ queryParams = [ ] ; $ statusCode = Resources :: STATUS_OK ; $ response = $ this -> sendHttp ( $ method , $ headers , $ queryParams , $ postParams , $ path , $ statusCode ) ; $ entry = new Entry ( ) ; $ entry -> parseXml ( $ response -> getBody ( ) ) ; return $ this -> getPropertiesFromAtomEntry ( $ entry ) ; } | Get entity from Azure . |
39,319 | private function _getEntityList ( $ path , array $ queryParams = [ ] ) { $ method = Resources :: HTTP_GET ; $ headers = [ ] ; $ postParams = [ ] ; $ statusCode = Resources :: STATUS_OK ; $ response = $ this -> sendHttp ( $ method , $ headers , $ queryParams , $ postParams , $ path , $ statusCode ) ; return $ this -> getEntryList ( $ response -> getBody ( ) ) ; } | Get entity list . |
39,320 | private function _updateEntity ( $ entity , $ path ) { $ method = Resources :: HTTP_MERGE ; $ headers = [ ] ; $ postParams = [ ] ; $ queryParams = [ ] ; $ statusCode = Resources :: STATUS_NO_CONTENT ; $ body = $ this -> wrapAtomEntry ( $ entity ) ; $ this -> sendHttp ( $ method , $ headers , $ queryParams , $ postParams , $ path , $ statusCode , $ body ) ; } | Update entity . |
39,321 | public function getAsset ( $ asset ) { $ assetId = Utilities :: getEntityId ( $ asset , 'WindowsAzure\MediaServices\Models\Asset' ) ; return Asset :: createFromOptions ( $ this -> _getEntity ( "Assets('{$assetId}')" ) ) ; } | Get asset . |
39,322 | public function getAssetList ( array $ queryParams = [ ] ) { $ propertyList = $ this -> _getEntityList ( 'Assets' , $ queryParams ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = Asset :: createFromOptions ( $ properties ) ; } return $ result ; } | Get asset list . |
39,323 | public function getAssetContentKeys ( $ asset ) { $ assetId = Utilities :: getEntityId ( $ asset , 'WindowsAzure\MediaServices\Models\Asset' ) ; $ propertyList = $ this -> _getEntityList ( "Assets('{$assetId}')/ContentKeys" ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = ContentKey :: createFromOptions ( $ properties ) ; } return $ result ; } | Get asset ContentKeys . |
39,324 | public function getAssetParentAssets ( $ asset ) { $ assetId = Utilities :: getEntityId ( $ asset , 'WindowsAzure\MediaServices\Models\Asset' ) ; $ propertyList = $ this -> _getEntityList ( "Assets('{$assetId}')/ParentAssets" ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = Asset :: createFromOptions ( $ properties ) ; } return $ result ; } | Get parent assets of asset . |
39,325 | public function getAssetAssetFileList ( $ asset ) { $ assetId = Utilities :: getEntityId ( $ asset , 'WindowsAzure\MediaServices\Models\Asset' ) ; $ propertyList = $ this -> _getEntityList ( "Assets('{$assetId}')/Files" ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = AssetFile :: createFromOptions ( $ properties ) ; } return $ result ; } | Get assetFiles of asset . |
39,326 | public function getAssetStorageAccount ( $ asset ) { $ assetId = Utilities :: getEntityId ( $ asset , 'WindowsAzure\MediaServices\Models\Asset' ) ; return StorageAccount :: createFromOptions ( $ this -> _getEntity ( "Assets('{$assetId}')/StorageAccount" ) ) ; } | Get storage account of asset . |
39,327 | public function linkContentKeyToAsset ( $ asset , $ contentKey ) { $ assetId = Utilities :: getEntityId ( $ asset , 'WindowsAzure\MediaServices\Models\Asset' ) ; $ assetId = urlencode ( $ assetId ) ; $ contentKeyId = Utilities :: getEntityId ( $ contentKey , 'WindowsAzure\MediaServices\Models\ContentKey' ) ; $ contentKeyId = urlencode ( $ contentKeyId ) ; $ contentWriter = new \ XMLWriter ( ) ; $ contentWriter -> openMemory ( ) ; $ contentWriter -> writeElementNS ( 'data' , 'uri' , Resources :: DS_XML_NAMESPACE , $ this -> getUri ( ) . "ContentKeys('{$contentKeyId}')" ) ; $ method = Resources :: HTTP_POST ; $ path = "Assets('{$assetId}')/\$links/ContentKeys" ; $ headers = [ Resources :: CONTENT_TYPE => Resources :: XML_CONTENT_TYPE , ] ; $ postParams = [ ] ; $ queryParams = [ ] ; $ statusCode = Resources :: STATUS_NO_CONTENT ; $ body = $ contentWriter -> outputMemory ( ) ; $ this -> sendHttp ( $ method , $ headers , $ queryParams , $ postParams , $ path , $ statusCode , $ body ) ; } | Link ContentKey to Asset . |
39,328 | public function removeContentKeyFromAsset ( $ asset , $ contentKey ) { $ assetId = Utilities :: getEntityId ( $ asset , 'WindowsAzure\MediaServices\Models\Asset' ) ; $ contentKeyId = Utilities :: getEntityId ( $ contentKey , 'WindowsAzure\MediaServices\Models\ContentKey' ) ; $ method = Resources :: HTTP_DELETE ; $ path = "Assets('{$assetId}')/\$links/ContentKeys('{$contentKeyId}')" ; $ headers = [ ] ; $ postParams = [ ] ; $ queryParams = [ ] ; $ statusCode = Resources :: STATUS_NO_CONTENT ; $ this -> sendHttp ( $ method , $ headers , $ queryParams , $ postParams , $ path , $ statusCode ) ; } | Remove ContentKey from Asset . |
39,329 | public function getAccessPolicy ( $ accessPolicy ) { $ accessPolicyId = Utilities :: getEntityId ( $ accessPolicy , 'WindowsAzure\MediaServices\Models\AccessPolicy' ) ; return AccessPolicy :: createFromOptions ( $ this -> _getEntity ( "AccessPolicies('{$accessPolicyId}')" ) ) ; } | Get AccessPolicy . |
39,330 | public function getAccessPolicyList ( ) { $ propertyList = $ this -> _getEntityList ( 'AccessPolicies' ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = AccessPolicy :: createFromOptions ( $ properties ) ; } return $ result ; } | Get list of AccessPolicies . |
39,331 | public function getLocator ( $ locator ) { $ locatorId = Utilities :: getEntityId ( $ locator , 'WindowsAzure\MediaServices\Models\Locator' ) ; return Locator :: createFromOptions ( $ this -> _getEntity ( "Locators('{$locatorId}')" ) ) ; } | Get Locator . |
39,332 | public function getLocatorAccessPolicy ( $ locator ) { $ locatorId = Utilities :: getEntityId ( $ locator , 'WindowsAzure\MediaServices\Models\Locator' ) ; return AccessPolicy :: createFromOptions ( $ this -> _getEntity ( "Locators('{$locatorId}')/AccessPolicy" ) ) ; } | Get Locator access policy . |
39,333 | public function getLocatorAsset ( $ locator ) { $ locatorId = Utilities :: getEntityId ( $ locator , 'WindowsAzure\MediaServices\Models\Locator' ) ; return Asset :: createFromOptions ( $ this -> _getEntity ( "Locators('{$locatorId}')/Asset" ) ) ; } | Get Locator asset . |
39,334 | public function getLocatorList ( array $ queryParams = [ ] ) { $ propertyList = $ this -> _getEntityList ( 'Locators' , $ queryParams ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = Locator :: createFromOptions ( $ properties ) ; } return $ result ; } | Get list of Locators . |
39,335 | public function createFileInfos ( $ asset ) { $ assetId = Utilities :: getEntityId ( $ asset , 'WindowsAzure\MediaServices\Models\Asset' ) ; $ assetIdEncoded = urlencode ( $ assetId ) ; $ method = Resources :: HTTP_GET ; $ headers = [ ] ; $ postParams = [ ] ; $ queryParams = [ ] ; $ path = "CreateFileInfos?assetid='{$assetIdEncoded}'" ; $ statusCode = Resources :: STATUS_NO_CONTENT ; $ this -> sendHttp ( $ method , $ headers , $ queryParams , $ postParams , $ path , $ statusCode ) ; } | Generate file info for all files in asset . |
39,336 | public function getAssetFile ( $ assetFile ) { $ assetFileId = Utilities :: getEntityId ( $ assetFile , 'WindowsAzure\MediaServices\Models\AssetFile' ) ; return AssetFile :: createFromOptions ( $ this -> _getEntity ( "Files('{$assetFileId}')" ) ) ; } | Get asset file . |
39,337 | public function getAssetFileList ( ) { $ propertyList = $ this -> _getEntityList ( 'Files' ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = AssetFile :: createFromOptions ( $ properties ) ; } return $ result ; } | Get list of all asset files . |
39,338 | public function uploadAssetFile ( Locator $ locator , $ name , $ file ) { Validate :: isString ( $ name , 'name' ) ; Validate :: notNull ( $ file , 'file' ) ; $ urlFile = $ locator -> getBaseUri ( ) . '/' . $ name ; $ url = $ urlFile . $ locator -> getContentAccessComponent ( ) ; if ( is_resource ( $ file ) ) { $ this -> _uploadAssetFileFromResource ( $ url , $ file ) ; } else { $ this -> _uploadAssetFileFromString ( $ url , $ file ) ; } } | Upload asset file to storage . |
39,339 | public function downloadAssetFile ( AssetFile $ assetFile , Locator $ locator , $ path ) { Validate :: isString ( $ path , 'path' ) ; Validate :: pathExists ( $ path ) ; $ downloadUrl = $ locator -> getBaseUri ( ) . '/' . $ assetFile -> getName ( ) . $ locator -> getContentAccessComponent ( ) ; $ filePath = $ path . '/' . $ assetFile -> getName ( ) ; return file_put_contents ( $ filePath , fopen ( $ downloadUrl , 'r' ) ) ; } | Download asset file to a local path . |
39,340 | private function _getCreateTaskContext ( Task $ task ) { $ result = new HttpCallContext ( ) ; $ result -> setMethod ( Resources :: HTTP_POST ) ; $ result -> setHeaders ( $ this -> _batchHeaders ) ; $ result -> setUri ( $ this -> getUri ( ) ) ; $ result -> setPath ( '/$1/Tasks' ) ; $ result -> setBody ( $ this -> wrapAtomEntry ( $ task ) ) ; $ result -> addStatusCode ( Resources :: STATUS_CREATED ) ; return $ result ; } | Create task HTTP call context . |
39,341 | public function getJob ( $ job ) { $ jobId = Utilities :: getEntityId ( $ job , 'WindowsAzure\MediaServices\Models\Job' ) ; return Job :: createFromOptions ( $ this -> _getEntity ( "Jobs('{$jobId}')" ) ) ; } | Get Job . |
39,342 | public function getJobList ( ) { $ propertyList = $ this -> _getEntityList ( 'Jobs' ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = Job :: createFromOptions ( $ properties ) ; } return $ result ; } | Get list of Jobs . |
39,343 | public function getJobStatus ( $ job ) { $ jobId = Utilities :: getEntityId ( $ job , 'WindowsAzure\MediaServices\Models\Job' ) ; $ jobIdEncoded = urlencode ( $ jobId ) ; $ method = Resources :: HTTP_GET ; $ headers = [ ] ; $ postParams = [ ] ; $ queryParams = [ ] ; $ path = "Jobs('{$jobIdEncoded}')/State" ; $ statusCode = Resources :: STATUS_OK ; $ response = $ this -> sendHttp ( $ method , $ headers , $ queryParams , $ postParams , $ path , $ statusCode ) ; return strip_tags ( $ response -> getBody ( ) ) ; } | Get status of a job . |
39,344 | public function getJobTasks ( $ job ) { $ jobId = Utilities :: getEntityId ( $ job , 'WindowsAzure\MediaServices\Models\Job' ) ; $ propertyList = $ this -> _getEntityList ( "Jobs('{$jobId}')/Tasks" ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = Task :: createFromOptions ( $ properties ) ; } return $ result ; } | Get job tasks . |
39,345 | public function getJobInputMediaAssets ( $ job ) { $ jobId = Utilities :: getEntityId ( $ job , 'WindowsAzure\MediaServices\Models\Job' ) ; $ propertyList = $ this -> _getEntityList ( "Jobs('{$jobId}')/InputMediaAssets" ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = Asset :: createFromOptions ( $ properties ) ; } return $ result ; } | Get job input assets . |
39,346 | public function cancelJob ( $ job ) { $ jobId = Utilities :: getEntityId ( $ job , 'WindowsAzure\MediaServices\Models\Job' ) ; $ jobIdEncoded = urlencode ( $ jobId ) ; $ method = Resources :: HTTP_GET ; $ headers = [ ] ; $ postParams = [ ] ; $ queryParams = [ ] ; $ path = "CancelJob?jobid='{$jobIdEncoded}'" ; $ statusCode = Resources :: STATUS_NO_CONTENT ; $ this -> sendHttp ( $ method , $ headers , $ queryParams , $ postParams , $ path , $ statusCode ) ; } | Cancel a job . |
39,347 | public function getTaskList ( ) { $ propertyList = $ this -> _getEntityList ( 'Tasks' ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = Task :: createFromOptions ( $ properties ) ; } return $ result ; } | Get list of tasks . |
39,348 | private function _getCreateTaskTemplateContext ( TaskTemplate $ taskTemplate ) { $ result = new HttpCallContext ( ) ; $ result -> setMethod ( Resources :: HTTP_POST ) ; $ result -> setHeaders ( $ this -> _batchHeaders ) ; $ result -> setUri ( $ this -> getUri ( ) ) ; $ result -> setPath ( '/$1/TaskTemplates' ) ; $ result -> setBody ( $ this -> wrapAtomEntry ( $ taskTemplate ) ) ; $ result -> addStatusCode ( Resources :: STATUS_CREATED ) ; return $ result ; } | Create task template HTTP call context . |
39,349 | public function getJobTemplate ( $ jobTemplate ) { $ jobTemplateId = Utilities :: getEntityId ( $ jobTemplate , 'WindowsAzure\MediaServices\Models\JobTemplate' ) ; return JobTemplate :: createFromOptions ( $ this -> _getEntity ( "JobTemplates('{$jobTemplateId}')" ) ) ; } | Get job template . |
39,350 | public function getJobTemplateList ( array $ queryParams = [ ] ) { $ propertyList = $ this -> _getEntityList ( 'JobTemplates' , $ queryParams ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = JobTemplate :: createFromOptions ( $ properties ) ; } return $ result ; } | Get list of Job Templates . |
39,351 | public function getJobTemplateTaskTemplateList ( $ jobTemplate ) { $ jobTemplateId = Utilities :: getEntityId ( $ jobTemplate , 'WindowsAzure\MediaServices\Models\JobTemplate' ) ; $ propertyList = $ this -> _getEntityList ( "JobTemplates('{$jobTemplateId}')/TaskTemplates" ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = TaskTemplate :: createFromOptions ( $ properties ) ; } return $ result ; } | Get task templates for job template . |
39,352 | public function getTaskTemplateList ( array $ queryParams = [ ] ) { $ propertyList = $ this -> _getEntityList ( 'TaskTemplates' , $ queryParams ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = TaskTemplate :: createFromOptions ( $ properties ) ; } return $ result ; } | Get list of task templates . |
39,353 | public function getMediaProcessors ( ) { $ propertyList = $ this -> _getEntityList ( 'MediaProcessors' ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = MediaProcessor :: createFromOptions ( $ properties ) ; } return $ result ; } | Get list of all media processors asset files . |
39,354 | public function getIngestManifest ( $ ingestManifest ) { $ ingestManifestId = Utilities :: getEntityId ( $ ingestManifest , 'WindowsAzure\MediaServices\Models\IngestManifest' ) ; return IngestManifest :: createFromOptions ( $ this -> _getEntity ( "IngestManifests('{$ingestManifestId}')" ) ) ; } | Get IngestManifest . |
39,355 | public function getIngestManifestList ( ) { $ propertyList = $ this -> _getEntityList ( 'IngestManifests' ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = IngestManifest :: createFromOptions ( $ properties ) ; } return $ result ; } | Get IngestManifest list . |
39,356 | public function getIngestManifestAssets ( $ ingestManifest ) { $ ingestManifestId = Utilities :: getEntityId ( $ ingestManifest , 'WindowsAzure\MediaServices\Models\IngestManifest' ) ; $ propertyList = $ this -> _getEntityList ( "IngestManifests('{$ingestManifestId}')/IngestManifestAssets" ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = IngestManifestAsset :: createFromOptions ( $ properties ) ; } return $ result ; } | Get IngestManifest assets . |
39,357 | public function getIngestManifestStorageAccount ( $ ingestManifest ) { $ ingestManifestId = Utilities :: getEntityId ( $ ingestManifest , 'WindowsAzure\MediaServices\Models\IngestManifest' ) ; return StorageAccount :: createFromOptions ( $ this -> _getEntity ( "IngestManifests('{$ingestManifestId}')/StorageAccount" ) ) ; } | Get storage account of IngestManifest . |
39,358 | public function createIngestManifestAsset ( IngestManifestAsset $ ingestManifestAsset , Asset $ asset ) { $ href = urlencode ( $ asset -> getId ( ) ) ; $ atomLink = new AtomLink ( ) ; $ atomLink -> setHref ( $ this -> getUri ( ) . "Assets('{$href}')" ) ; $ atomLink -> setType ( Resources :: ATOM_ENTRY_CONTENT_TYPE ) ; $ atomLink -> setTitle ( 'Asset' ) ; $ atomLink -> setRel ( Resources :: MEDIA_SERVICES_ASSET_REL ) ; return IngestManifestAsset :: createFromOptions ( $ this -> _createEntity ( $ ingestManifestAsset , 'IngestManifestAssets' , [ $ atomLink ] ) ) ; } | Create new IngestManifestAsset . |
39,359 | public function getIngestManifestAsset ( $ ingestManifestAsset ) { $ ingestManifestAssetId = Utilities :: getEntityId ( $ ingestManifestAsset , 'WindowsAzure\MediaServices\Models\IngestManifestAsset' ) ; return IngestManifestAsset :: createFromOptions ( $ this -> _getEntity ( "IngestManifestAssets('{$ingestManifestAssetId}')" ) ) ; } | Get IngestManifestAsset . |
39,360 | public function getIngestManifestAssetList ( ) { $ propertyList = $ this -> _getEntityList ( 'IngestManifestAssets' ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = IngestManifestAsset :: createFromOptions ( $ properties ) ; } return $ result ; } | Get list of IngestManifestAsset . |
39,361 | public function getIngestManifestAssetFiles ( $ ingestManifestAsset ) { $ ingestManifestAssetId = Utilities :: getEntityId ( $ ingestManifestAsset , 'WindowsAzure\MediaServices\Models\IngestManifestAsset' ) ; $ propertyList = $ this -> _getEntityList ( "IngestManifestAssets('{$ingestManifestAssetId}')/IngestManifestFiles" ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = IngestManifestFile :: createFromOptions ( $ properties ) ; } return $ result ; } | Get IngestManifestFiles of IngestManifestAsset . |
39,362 | public function getIngestManifestFile ( $ ingestManifestFile ) { $ ingestManifestFileId = Utilities :: getEntityId ( $ ingestManifestFile , 'WindowsAzure\MediaServices\Models\IngestManifestFile' ) ; return IngestManifestFile :: createFromOptions ( $ this -> _getEntity ( "IngestManifestFiles('{$ingestManifestFileId}')" ) ) ; } | Get IngestManifestFile . |
39,363 | public function getIngestManifestFileList ( ) { $ propertyList = $ this -> _getEntityList ( 'IngestManifestFiles' ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = IngestManifestFile :: createFromOptions ( $ properties ) ; } return $ result ; } | Get list of IngestManifestFile . |
39,364 | public function getContentKeyList ( array $ queryParams = [ ] ) { $ propertyList = $ this -> _getEntityList ( 'ContentKeys' , $ queryParams ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = ContentKey :: createFromOptions ( $ properties ) ; } return $ result ; } | Get list of ContentKey . |
39,365 | public function getContentKey ( $ contentKey ) { $ contentKeyId = Utilities :: getEntityId ( $ contentKey , 'WindowsAzure\MediaServices\Models\ContentKey' ) ; return ContentKey :: createFromOptions ( $ this -> _getEntity ( "ContentKeys('{$contentKeyId}')" ) ) ; } | Get ContentKey . |
39,366 | public function rebindContentKey ( $ contentKey , $ x509Certificate ) { $ contentKeyId = Utilities :: getEntityId ( $ contentKey , 'WindowsAzure\MediaServices\Models\ContentKey' ) ; $ contentKeyId = urlencode ( $ contentKeyId ) ; $ x509Certificate = urlencode ( $ x509Certificate ) ; $ method = Resources :: HTTP_GET ; $ headers = [ ] ; $ postParams = [ ] ; $ queryParams = [ ] ; $ statusCode = Resources :: STATUS_OK ; $ path = "RebindContentKey?id='{$contentKeyId}'" . "&x509Certificate='{$x509Certificate}'" ; $ response = $ this -> sendHttp ( $ method , $ headers , $ queryParams , $ postParams , $ path , $ statusCode ) ; $ key = ( string ) simplexml_load_string ( $ response -> getBody ( ) ) ; return base64_decode ( $ key ) ; } | Rebind ContentKey . |
39,367 | public function getProtectionKeyId ( $ contentKeyType ) { Validate :: isInteger ( $ contentKeyType , 'contentKeyType' ) ; $ method = Resources :: HTTP_GET ; $ path = "GetProtectionKeyId?contentKeyType={$contentKeyType}" ; $ headers = [ ] ; $ postParams = [ ] ; $ queryParams = [ ] ; $ statusCode = Resources :: STATUS_OK ; $ response = $ this -> sendHttp ( $ method , $ headers , $ queryParams , $ postParams , $ path , $ statusCode ) ; return ( string ) simplexml_load_string ( $ response -> getBody ( ) ) ; } | The GetProtectionKeyId function retrieves an X . 509 certificate thumbprint that is used to ensure that you have the correct certificate installed on your machine when encrypting your user - defined content key . |
39,368 | public function getProtectionKey ( $ protectionKeyId ) { Validate :: isString ( $ protectionKeyId , 'protectionKeyId' ) ; $ method = Resources :: HTTP_GET ; $ path = "GetProtectionKey?ProtectionKeyId='{$protectionKeyId}'" ; $ headers = [ ] ; $ postParams = [ ] ; $ queryParams = [ ] ; $ statusCode = Resources :: STATUS_OK ; $ response = $ this -> sendHttp ( $ method , $ headers , $ queryParams , $ postParams , $ path , $ statusCode ) ; $ encoded = ( string ) simplexml_load_string ( $ response -> getBody ( ) ) ; $ encoded = implode ( "\n" , str_split ( $ encoded , 76 ) ) ; $ encoded = "-----BEGIN CERTIFICATE-----\n" . $ encoded ; $ encoded .= "\n-----END CERTIFICATE-----" ; return $ encoded ; } | Retrieve the specific X . 509 certificate that should be used to encrypt your user - defined content key . |
39,369 | public function getContentKeyAuthorizationPolicy ( $ contentKeyAuthorizationPolicy ) { $ contentKeyAuthorizationPolicyId = Utilities :: getEntityId ( $ contentKeyAuthorizationPolicy , 'WindowsAzure\MediaServices\Models\ContentKeyAuthorizationPolicy' ) ; return ContentKeyAuthorizationPolicy :: createFromOptions ( $ this -> _getEntity ( "ContentKeyAuthorizationPolicies('{$contentKeyAuthorizationPolicyId}')" ) ) ; } | Get content key authorization policy . |
39,370 | public function getContentKeyAuthorizationPolicyList ( ) { $ propertyList = $ this -> _getEntityList ( 'ContentKeyAuthorizationPolicies' ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = ContentKeyAuthorizationPolicy :: createFromOptions ( $ properties ) ; } return $ result ; } | Get content key authorization policies list . |
39,371 | public function getContentKeyAuthorizationPolicyOption ( $ contentKeyAuthorizationOptions ) { $ contentKeyAuthorizationOptionsId = Utilities :: getEntityId ( $ contentKeyAuthorizationOptions , 'WindowsAzure\MediaServices\Models\ContentKeyAuthorizationPolicyOption' ) ; return ContentKeyAuthorizationPolicyOption :: createFromOptions ( $ this -> _getEntity ( "ContentKeyAuthorizationPolicyOptions('{$contentKeyAuthorizationOptionsId}')" ) ) ; } | Get content key authorization option by id . |
39,372 | public function getContentKeyAuthorizationPolicyOptionList ( ) { $ propertyList = $ this -> _getEntityList ( 'ContentKeyAuthorizationPolicyOptions' ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = ContentKeyAuthorizationPolicyOption :: createFromOptions ( $ properties ) ; } return $ result ; } | Get content key authorization options . |
39,373 | public function getContentKeyAuthorizationPolicyLinkedOptions ( $ policy ) { $ policyId = Utilities :: getEntityId ( $ policy , 'WindowsAzure\MediaServices\Models\ContentKeyAuthorizationPolicy' ) ; $ propertyList = $ this -> _getEntityList ( "ContentKeyAuthorizationPolicies('{$policyId}')/Options" ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = ContentKeyAuthorizationPolicyOption :: createFromOptions ( $ properties ) ; } return $ result ; } | Get ContentKeyAuthorizationPolicy linked Options . |
39,374 | public function removeOptionsFromContentKeyAuthorizationPolicy ( $ options , $ policy ) { $ optionsId = Utilities :: getEntityId ( $ options , 'WindowsAzure\MediaServices\Models\ContentKeyAuthorizationPolicyOption' ) ; $ policyId = Utilities :: getEntityId ( $ policy , 'WindowsAzure\MediaServices\Models\ContentKeyAuthorizationPolicy' ) ; $ method = Resources :: HTTP_DELETE ; $ path = "ContentKeyAuthorizationPolicies('{$policyId}')/\$links/Options('{$optionsId}')" ; $ headers = [ ] ; $ postParams = [ ] ; $ queryParams = [ ] ; $ statusCode = Resources :: STATUS_NO_CONTENT ; $ this -> sendHttp ( $ method , $ headers , $ queryParams , $ postParams , $ path , $ statusCode ) ; } | Remove ContentKeyAuthorizationPolicyOption from ContentKeyAuthorizationPolicy . |
39,375 | public function getAssetDeliveryPolicy ( $ assetDeliveryPolicy ) { $ assetDeliveryPolicyId = Utilities :: getEntityId ( $ assetDeliveryPolicy , 'WindowsAzure\MediaServices\Models\ContentKeyAuthorizationPolicy' ) ; return AssetDeliveryPolicy :: createFromOptions ( $ this -> _getEntity ( "AssetDeliveryPolicies('{$assetDeliveryPolicyId}')" ) ) ; } | Get asset delivery policy . |
39,376 | public function getAssetDeliveryPolicyList ( ) { $ propertyList = $ this -> _getEntityList ( 'AssetDeliveryPolicies' ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = AssetDeliveryPolicy :: createFromOptions ( $ properties ) ; } return $ result ; } | Get asset delivery policies list . |
39,377 | public function getAssetLinkedDeliveryPolicy ( $ asset ) { $ assetId = Utilities :: getEntityId ( $ asset , 'WindowsAzure\MediaServices\Models\Asset' ) ; $ propertyList = $ this -> _getEntityList ( "Assets('{$assetId}')/DeliveryPolicies" ) ; $ result = [ ] ; foreach ( $ propertyList as $ properties ) { $ result [ ] = AssetDeliveryPolicy :: createFromOptions ( $ properties ) ; } return $ result ; } | Get AssetDeliveryPolicy list linked to an Asset . |
39,378 | public function removeDeliveryPolicyFromAsset ( $ asset , $ policy ) { $ assetId = Utilities :: getEntityId ( $ asset , 'WindowsAzure\MediaServices\Models\Asset' ) ; $ policyId = Utilities :: getEntityId ( $ policy , 'WindowsAzure\MediaServices\Models\AssetDeliveryPolicy' ) ; $ method = Resources :: HTTP_DELETE ; $ path = "Assets('{$assetId}')/\$links/DeliveryPolicies('{$policyId}')" ; $ headers = [ ] ; $ postParams = [ ] ; $ queryParams = [ ] ; $ statusCode = Resources :: STATUS_NO_CONTENT ; $ this -> sendHttp ( $ method , $ headers , $ queryParams , $ postParams , $ path , $ statusCode ) ; } | Remove AssetDeliveryPolicy from Asset . |
39,379 | public function getKeyDeliveryUrl ( $ contentKey , $ contentKeyDeliveryType ) { $ contentKeyId = Utilities :: getEntityId ( $ contentKey , 'WindowsAzure\MediaServices\Models\ContentKey' ) ; $ contentKeyId = urlencode ( $ contentKeyId ) ; $ body = json_encode ( [ 'keyDeliveryType' => $ contentKeyDeliveryType ] ) ; $ method = Resources :: HTTP_POST ; $ path = "ContentKeys('{$contentKeyId}')/GetKeyDeliveryUrl" ; $ headers = [ Resources :: CONTENT_TYPE => Resources :: JSON_CONTENT_TYPE , ] ; $ postParams = [ ] ; $ queryParams = [ ] ; $ statusCode = Resources :: STATUS_OK ; $ response = $ this -> sendHttp ( $ method , $ headers , $ queryParams , $ postParams , $ path , $ statusCode , $ body ) ; return simplexml_load_string ( $ response -> getBody ( ) ) -> __toString ( ) ; } | Link AssetDeliveryPolicy to Asset . |
39,380 | public function getEncodingReservedUnit ( ) { $ units = $ this -> _getEntityList ( 'EncodingReservedUnitTypes' ) ; if ( isset ( $ units ) && count ( $ units ) > 0 ) { return EncodingReservedUnit :: createFromOptions ( $ units [ 0 ] ) ; } return null ; } | Get encoding reserved units settings . |
39,381 | public function updateEncodingReservedUnit ( EncodingReservedUnit $ encodingReservedUnit ) { $ accountID = $ encodingReservedUnit -> getAccountId ( ) ; $ encodingReservedUnit -> setAccountId ( null ) ; $ this -> _updateEntity ( $ encodingReservedUnit , "EncodingReservedUnitTypes(guid'{$accountID}')" ) ; $ encodingReservedUnit -> setAccountId ( $ accountID ) ; } | Update encoding reserved units settings . |
39,382 | public function getOperation ( $ operation ) { $ operationId = Utilities :: getEntityId ( $ operation , 'WindowsAzure\MediaServices\Models\Operation' ) ; return Operation :: createFromOptions ( $ this -> _getEntity ( "Operations('{$operationId}')" ) ) ; } | Get the Operation entity . |
39,383 | public function awaitOperation ( Operation $ operation , $ interval = 5 ) { while ( $ operation -> getState ( ) == OperationState :: InProgress ) { $ operation = $ this -> getOperation ( $ operation ) ; if ( $ operation -> getState ( ) == OperationState :: InProgress ) { sleep ( $ interval ) ; } } return $ operation ; } | Utility method to await for an Operation finishes . |
39,384 | public function sendUpdateChannelOperation ( Channel $ channel ) { $ channelId = $ channel -> getId ( ) ; Validate :: notNull ( $ channelId , 'channelId' ) ; return $ this -> _sendOperation ( $ channel , "Channels('{$channelId}')" , Resources :: HTTP_MERGE , [ Resources :: STATUS_ACCEPTED , Resources :: STATUS_NO_CONTENT ] ) ; } | Send Update operation . |
39,385 | public function getChannel ( $ channel ) { $ channelId = Utilities :: getEntityId ( $ channel , 'WindowsAzure\MediaServices\Models\Channel' ) ; return Channel :: createFromOptions ( $ this -> _getEntity ( "Channels('{$channelId}')" ) ) ; } | Get existing channel . |
39,386 | public function sendDeleteChannelOperation ( $ channel ) { $ channelId = Utilities :: getEntityId ( $ channel , 'WindowsAzure\MediaServices\Models\Channel' ) ; return $ this -> _sendOperation ( null , "Channels('{$channelId}')" , Resources :: HTTP_DELETE ) ; } | Delete channel . |
39,387 | public function getChannelList ( ) { $ entityList = $ this -> _getEntityList ( 'Channels' ) ; $ result = [ ] ; foreach ( $ entityList as $ channel ) { $ result [ ] = Channel :: createFromOptions ( $ channel ) ; } return $ result ; } | Get list of Channels . |
39,388 | public function sendStartChannelOperation ( $ channel ) { $ channelId = Utilities :: getEntityId ( $ channel , 'WindowsAzure\MediaServices\Models\Channel' ) ; $ headers = [ Resources :: CONTENT_TYPE => Resources :: JSON_CONTENT_TYPE , ] ; return $ this -> _sendOperation ( null , "Channels('{$channelId}')/Start" , Resources :: HTTP_POST , Resources :: STATUS_ACCEPTED , $ headers ) ; } | Start a channel . |
39,389 | public function sendStartAdvertisementChannelOperation ( $ channel , $ duration , $ cueId , $ showSlate ) { $ channelId = Utilities :: getEntityId ( $ channel , 'WindowsAzure\MediaServices\Models\Channel' ) ; $ headers = [ Resources :: CONTENT_TYPE => Resources :: JSON_CONTENT_TYPE , ] ; $ body = json_encode ( [ 'duration' => $ duration , 'cueId' => $ cueId , 'showSlate' => ( $ showSlate ) ? 'true' : 'false' , ] ) ; return $ this -> _sendOperation ( $ body , "Channels('{$channelId}')/StartAdvertisement" , Resources :: HTTP_POST , Resources :: STATUS_ACCEPTED , $ headers ) ; } | StartAdvertisement on a running channel . |
39,390 | public function sendEndAdvertisementChannelOperation ( $ channel , $ cueId ) { $ channelId = Utilities :: getEntityId ( $ channel , 'WindowsAzure\MediaServices\Models\Channel' ) ; $ headers = [ Resources :: CONTENT_TYPE => Resources :: JSON_CONTENT_TYPE , ] ; $ body = json_encode ( [ 'cueId' => $ cueId , ] ) ; return $ this -> _sendOperation ( $ body , "Channels('{$channelId}')/EndAdvertisement" , Resources :: HTTP_POST , Resources :: STATUS_ACCEPTED , $ headers ) ; } | EndAdvertisement on a running channel . |
39,391 | public function sendShowSlateChannelOperation ( $ channel , $ duration , $ assetId ) { $ channelId = Utilities :: getEntityId ( $ channel , 'WindowsAzure\MediaServices\Models\Channel' ) ; $ headers = [ Resources :: CONTENT_TYPE => Resources :: JSON_CONTENT_TYPE , ] ; $ body = json_encode ( [ 'duration' => $ duration , 'assetId' => $ assetId , ] ) ; return $ this -> _sendOperation ( $ body , "Channels('{$channelId}')/ShowSlate" , Resources :: HTTP_POST , Resources :: STATUS_ACCEPTED , $ headers ) ; } | ShowSlate on a running channel . |
39,392 | public function createChannel ( Channel $ channel ) { $ op = $ this -> sendCreateChannelOperation ( $ channel ) ; $ op = $ this -> awaitOperation ( $ op ) ; if ( $ op -> getState ( ) != OperationState :: Succeeded ) { return null ; } return $ this -> getChannel ( $ op -> getTargetEntityId ( ) ) ; } | Create a Channel . |
39,393 | public function updateChannel ( Channel $ channel ) { $ op = $ this -> sendUpdateChannelOperation ( $ channel ) ; $ op = $ this -> awaitOperation ( $ op ) ; if ( $ op -> getState ( ) != OperationState :: Succeeded ) { return null ; } return $ this -> getChannel ( $ channel -> getId ( ) ) ; } | Update a Channel . |
39,394 | public function deleteChannel ( $ channel ) { $ op = $ this -> sendDeleteChannelOperation ( $ channel ) ; $ op = $ this -> awaitOperation ( $ op ) ; return $ op -> getState ( ) == OperationState :: Succeeded ; } | Delete a Channel . |
39,395 | public function resetChannel ( $ channel ) { $ op = $ this -> sendResetChannelOperation ( $ channel ) ; $ op = $ this -> awaitOperation ( $ op ) ; return $ op -> getState ( ) == OperationState :: Succeeded ; } | Reset a Channel . |
39,396 | public function startChannel ( $ channel ) { $ op = $ this -> sendStartChannelOperation ( $ channel ) ; $ op = $ this -> awaitOperation ( $ op ) ; return $ op -> getState ( ) == OperationState :: Succeeded ; } | Start a Channel . |
39,397 | public function stopChannel ( $ channel ) { $ op = $ this -> sendStopChannelOperation ( $ channel ) ; $ op = $ this -> awaitOperation ( $ op ) ; return $ op -> getState ( ) == OperationState :: Succeeded ; } | Stop a Channel . |
39,398 | public function startAdvertisementChannel ( $ channel , $ duration , $ cueId , $ showSlate ) { $ op = $ this -> sendStartAdvertisementChannelOperation ( $ channel , $ duration , $ cueId , $ showSlate ) ; $ op = $ this -> awaitOperation ( $ op ) ; return $ op -> getState ( ) == OperationState :: Succeeded ; } | Start Advertisement on Channel . |
39,399 | public function endAdvertisementChannel ( $ channel , $ cueId ) { $ op = $ this -> sendEndAdvertisementChannelOperation ( $ channel , $ cueId ) ; $ op = $ this -> awaitOperation ( $ op ) ; return $ op -> getState ( ) == OperationState :: Succeeded ; } | End Advertisement on Channel . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.