PageRenderTime 3256ms CodeModel.GetById 27ms RepoModel.GetById 1ms app.codeStats 0ms

/public/plugin/ckfinder/core/connector/php/vendor/microsoft/windowsazure/WindowsAzure/MediaServices/Models/AssetFile.php

https://gitlab.com/vietdhtn/myweb
PHP | 551 lines | 220 code | 61 blank | 270 comment | 14 complexity | 074d486ce7c2757cc6e58dda1264c57e MD5 | raw file
  1. <?php
  2. /**
  3. * LICENSE: Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. * http://www.apache.org/licenses/LICENSE-2.0
  7. *
  8. * Unless required by applicable law or agreed to in writing, software
  9. * distributed under the License is distributed on an "AS IS" BASIS,
  10. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. * See the License for the specific language governing permissions and
  12. * limitations under the License.
  13. *
  14. * PHP version 5
  15. *
  16. * @category Microsoft
  17. * @package WindowsAzure\MediaServices\Models
  18. * @author Azure PHP SDK <azurephpsdk@microsoft.com>
  19. * @copyright Microsoft Corporation
  20. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  21. * @link https://github.com/windowsazure/azure-sdk-for-php
  22. */
  23. namespace WindowsAzure\MediaServices\Models;
  24. use WindowsAzure\Common\Internal\Utilities;
  25. use WindowsAzure\Common\Internal\Validate;
  26. /**
  27. * Represents asset file object used in media services
  28. *
  29. * @category Microsoft
  30. * @package WindowsAzure\MediaServices\Models
  31. * @author Azure PHP SDK <azurephpsdk@microsoft.com>
  32. * @copyright Microsoft Corporation
  33. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  34. * @version Release: 0.4.0_2014-01
  35. * @link https://github.com/windowsazure/azure-sdk-for-php
  36. */
  37. class AssetFile
  38. {
  39. /**
  40. * Asset file Id
  41. *
  42. * @var string
  43. */
  44. private $_id;
  45. /**
  46. * Name
  47. *
  48. * @var string
  49. */
  50. private $_name;
  51. /**
  52. * Content file size
  53. *
  54. * @var int
  55. */
  56. private $_contentFileSize;
  57. /**
  58. * Parent asset id
  59. *
  60. * @var string
  61. */
  62. private $_parentAssetId;
  63. /**
  64. * Encryption version
  65. *
  66. * @var string
  67. */
  68. private $_encryptionVersion;
  69. /**
  70. * Encryption scheme
  71. *
  72. * @var string
  73. */
  74. private $_encryptionScheme;
  75. /**
  76. * Is encrypted
  77. *
  78. * @var bool
  79. */
  80. private $_isEncrypted;
  81. /**
  82. * Encryption key id
  83. *
  84. * @var string
  85. */
  86. private $_encryptionKeyId;
  87. /**
  88. * Initialization vector
  89. *
  90. * @var string
  91. */
  92. private $_initializationVector;
  93. /**
  94. * Is primary
  95. *
  96. * @var bool
  97. */
  98. private $_isPrimary;
  99. /**
  100. * Last modified
  101. *
  102. * @var \DateTime
  103. */
  104. private $_lastModified;
  105. /**
  106. * Created
  107. *
  108. * @var \DateTime
  109. */
  110. private $_created;
  111. /**
  112. * Mime type
  113. *
  114. * @var string
  115. */
  116. private $_mimeType;
  117. /**
  118. * Content check sum
  119. *
  120. * @var string
  121. */
  122. private $_contentCheckSum;
  123. /**
  124. * Create asset file from array
  125. *
  126. * @param array $options Array containing values for object properties
  127. *
  128. * @return WindowsAzure\MediaServices\Models\AssetFile
  129. */
  130. public static function createFromOptions($options)
  131. {
  132. Validate::notNull($options['Name'], 'options[Name]');
  133. Validate::notNull($options['ParentAssetId'], 'options[ParentAssetId]');
  134. $assetFile = new AssetFile($options['Name'], $options['ParentAssetId']);
  135. $assetFile->fromArray($options);
  136. return $assetFile;
  137. }
  138. /**
  139. * Create asset file
  140. *
  141. * @param string $name Friendly name for asset file.
  142. * @param string $parentAssetId Asset Id of the Asset that this file is
  143. * associated with.
  144. */
  145. public function __construct($name, $parentAssetId)
  146. {
  147. $this->_name = $name;
  148. $this->_parentAssetId = $parentAssetId;
  149. }
  150. /**
  151. * Fill asset file from array
  152. *
  153. * @param array $options Array containing values for object properties
  154. *
  155. * @return none
  156. */
  157. public function fromArray($options)
  158. {
  159. if (isset($options['Id'])) {
  160. Validate::isString($options['Id'], 'options[Id]');
  161. $this->_id = $options['Id'];
  162. }
  163. if (isset($options['Name'])) {
  164. Validate::isString($options['Name'], 'options[Name]');
  165. $this->_name = $options['Name'];
  166. }
  167. if (isset($options['ContentFileSize'])) {
  168. Validate::isString(
  169. $options['ContentFileSize'],
  170. 'options[ContentFileSize]'
  171. );
  172. $this->_contentFileSize = $options['ContentFileSize'];
  173. }
  174. if (isset($options['ParentAssetId'])) {
  175. Validate::isString(
  176. $options['ParentAssetId'],
  177. 'options[ParentAssetId]'
  178. );
  179. $this->_parentAssetId = $options['ParentAssetId'];
  180. }
  181. if (isset($options['EncryptionVersion'])) {
  182. Validate::isString(
  183. $options['EncryptionVersion'],
  184. 'options[EncryptionVersion]'
  185. );
  186. $this->_encryptionVersion = $options['EncryptionVersion'];
  187. }
  188. if (isset($options['EncryptionScheme'])) {
  189. Validate::isString(
  190. $options['EncryptionScheme'],
  191. 'options[EncryptionScheme]'
  192. );
  193. $this->_encryptionScheme = $options['EncryptionScheme'];
  194. }
  195. if (isset($options['IsEncrypted'])) {
  196. Validate::isBoolean(
  197. $options['IsEncrypted'],
  198. 'options[IsEncrypted]'
  199. );
  200. $this->_isEncrypted = $options['IsEncrypted'];
  201. }
  202. if (isset($options['EncryptionKeyId'])) {
  203. Validate::isString(
  204. $options['EncryptionKeyId'],
  205. 'options[EncryptionKeyId]'
  206. );
  207. $this->_encryptionKeyId = $options['EncryptionKeyId'];
  208. }
  209. if (isset($options['InitializationVector'])) {
  210. Validate::isString(
  211. $options['InitializationVector'],
  212. 'options[InitializationVector]'
  213. );
  214. $this->_initializationVector = $options['InitializationVector'];
  215. }
  216. if (isset($options['IsPrimary'])) {
  217. Validate::isBoolean($options['IsPrimary'], 'options[IsPrimary]');
  218. $this->_isPrimary = $options['IsPrimary'];
  219. }
  220. if (isset($options['LastModified'])) {
  221. Validate::isDateString(
  222. $options['LastModified'],
  223. 'options[LastModified]'
  224. );
  225. $this->_lastModified = new \DateTime($options['LastModified']);
  226. }
  227. if (isset($options['Created'])) {
  228. Validate::isDateString($options['Created'], 'options[Created]');
  229. $this->_created = new \DateTime($options['Created']);
  230. }
  231. if (isset($options['MimeType'])) {
  232. Validate::isString($options['MimeType'], 'options[MimeType]');
  233. $this->_mimeType = $options['MimeType'];
  234. }
  235. if (isset($options['ContentChecksum'])) {
  236. Validate::isString(
  237. $options['ContentChecksum'],
  238. 'options[ContentChecksum]'
  239. );
  240. $this->_contentCheckSum = $options['ContentChecksum'];
  241. }
  242. }
  243. /**
  244. * Get "Content check sum"
  245. *
  246. * @return string
  247. */
  248. public function getContentCheckSum()
  249. {
  250. return $this->_contentCheckSum;
  251. }
  252. /**
  253. * Set "Content check sum"
  254. *
  255. * @param string $value Content check sum
  256. *
  257. * @return none
  258. */
  259. public function setContentCheckSum($value)
  260. {
  261. $this->_contentCheckSum = $value;
  262. }
  263. /**
  264. * Get "Mime type"
  265. *
  266. * @return string
  267. */
  268. public function getMimeType()
  269. {
  270. return $this->_mimeType;
  271. }
  272. /**
  273. * Set "Mime type"
  274. *
  275. * @param string $value Mime type
  276. *
  277. * @return none
  278. */
  279. public function setMimeType($value)
  280. {
  281. $this->_mimeType = $value;
  282. }
  283. /**
  284. * Get "Created"
  285. *
  286. * @return \DateTime
  287. */
  288. public function getCreated()
  289. {
  290. return $this->_created;
  291. }
  292. /**
  293. * Get "Last modified"
  294. *
  295. * @return \DateTime
  296. */
  297. public function getLastModified()
  298. {
  299. return $this->_lastModified;
  300. }
  301. /**
  302. * Get "Is primary"
  303. *
  304. * @return bool
  305. */
  306. public function getIsPrimary()
  307. {
  308. return $this->_isPrimary;
  309. }
  310. /**
  311. * Set "Is primary"
  312. *
  313. * @param bool $value Is primary
  314. *
  315. * @return none
  316. */
  317. public function setIsPrimary($value)
  318. {
  319. $this->_isPrimary = $value;
  320. }
  321. /**
  322. * Get "Initialization vector"
  323. *
  324. * @return string
  325. */
  326. public function getInitializationVector()
  327. {
  328. return $this->_initializationVector;
  329. }
  330. /**
  331. * Set "Initialization vector"
  332. *
  333. * @param string $value Initialization vector
  334. *
  335. * @return none
  336. */
  337. public function setInitializationVector($value)
  338. {
  339. $this->_initializationVector = $value;
  340. }
  341. /**
  342. * Get "Encryption key id"
  343. *
  344. * @return string
  345. */
  346. public function getEncryptionKeyId()
  347. {
  348. return $this->_encryptionKeyId;
  349. }
  350. /**
  351. * Set "Encryption key id"
  352. *
  353. * @param string $value Encryption key id
  354. *
  355. * @return none
  356. */
  357. public function setEncryptionKeyId($value)
  358. {
  359. $this->_encryptionKeyId = $value;
  360. }
  361. /**
  362. * Get "Is encrypted"
  363. *
  364. * @return bool
  365. */
  366. public function getIsEncrypted()
  367. {
  368. return $this->_isEncrypted;
  369. }
  370. /**
  371. * Set "Is encrypted"
  372. *
  373. * @param bool $value Is encrypted
  374. *
  375. * @return none
  376. */
  377. public function setIsEncrypted($value)
  378. {
  379. $this->_isEncrypted = $value;
  380. }
  381. /**
  382. * Get "Encryption scheme"
  383. *
  384. * @return string
  385. */
  386. public function getEncryptionScheme()
  387. {
  388. return $this->_encryptionScheme;
  389. }
  390. /**
  391. * Set "Encryption scheme"
  392. *
  393. * @param string $value Encryption scheme
  394. *
  395. * @return none
  396. */
  397. public function setEncryptionScheme($value)
  398. {
  399. $this->_encryptionScheme = $value;
  400. }
  401. /**
  402. * Get "Encryption version"
  403. *
  404. * @return string
  405. */
  406. public function getEncryptionVersion()
  407. {
  408. return $this->_encryptionVersion;
  409. }
  410. /**
  411. * Set "Encryption version"
  412. *
  413. * @param string $value Encryption version
  414. *
  415. * @return none
  416. */
  417. public function setEncryptionVersion($value)
  418. {
  419. $this->_encryptionVersion = $value;
  420. }
  421. /**
  422. * Get "Parent asset id"
  423. *
  424. * @return string
  425. */
  426. public function getParentAssetId()
  427. {
  428. return $this->_parentAssetId;
  429. }
  430. /**
  431. * Set "Parent asset id"
  432. *
  433. * @param string $value Parent asset id
  434. *
  435. * @return none
  436. */
  437. public function setParentAssetId($value)
  438. {
  439. $this->_parentAssetId = $value;
  440. }
  441. /**
  442. * Get "Content file size"
  443. *
  444. * @return int
  445. */
  446. public function getContentFileSize()
  447. {
  448. return $this->_contentFileSize;
  449. }
  450. /**
  451. * Set "Content file size"
  452. *
  453. * @param int $value Content file size
  454. *
  455. * @return none
  456. */
  457. public function setContentFileSize($value)
  458. {
  459. $this->_contentFileSize = $value;
  460. }
  461. /**
  462. * Get "Name"
  463. *
  464. * @return string
  465. */
  466. public function getName()
  467. {
  468. return $this->_name;
  469. }
  470. /**
  471. * Set "Name"
  472. *
  473. * @param string $value Name
  474. *
  475. * @return none
  476. */
  477. public function setName($value)
  478. {
  479. $this->_name = $value;
  480. }
  481. /**
  482. * Get "Asset file Id"
  483. *
  484. * @return string
  485. */
  486. public function getId()
  487. {
  488. return $this->_id;
  489. }
  490. }