PageRenderTime 63ms CodeModel.GetById 30ms RepoModel.GetById 1ms app.codeStats 0ms

/src/MediaServices/Models/IngestManifestFile.php

http://github.com/WindowsAzure/azure-sdk-for-php
PHP | 576 lines | 237 code | 67 blank | 272 comment | 15 complexity | 243834b67c6e72593c3f86e0e2ee7b11 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. *
  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. *
  22. * @link https://github.com/windowsazure/azure-sdk-for-php
  23. */
  24. namespace WindowsAzure\MediaServices\Models;
  25. use WindowsAzure\Common\Internal\Validate;
  26. /**
  27. * Represents IngestManifestFile file object used in media services.
  28. *
  29. * @category Microsoft
  30. *
  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. *
  35. * @version Release: 0.5.0_2016-11
  36. *
  37. * @link https://github.com/windowsazure/azure-sdk-for-php
  38. */
  39. class IngestManifestFile
  40. {
  41. /**
  42. * The state of the file "inactive".
  43. *
  44. * @var int
  45. */
  46. const STATE_PENDING = 0;
  47. /**
  48. * The state of the file "finished".
  49. *
  50. * @var int
  51. */
  52. const STATE_FINISHED = 1;
  53. /**
  54. * The state of the file "error".
  55. *
  56. * @var int
  57. */
  58. const STATE_ERROR = 2;
  59. /**
  60. * IngestManifestFile Id.
  61. *
  62. * @var string
  63. */
  64. private $_id;
  65. /**
  66. * Name.
  67. *
  68. * @var string
  69. */
  70. private $_name;
  71. /**
  72. * Encryption version.
  73. *
  74. * @var string
  75. */
  76. private $_encryptionVersion;
  77. /**
  78. * Encryption scheme.
  79. *
  80. * @var string
  81. */
  82. private $_encryptionScheme;
  83. /**
  84. * Is encrypted.
  85. *
  86. * @var bool
  87. */
  88. private $_isEncrypted;
  89. /**
  90. * Encryption key id.
  91. *
  92. * @var string
  93. */
  94. private $_encryptionKeyId;
  95. /**
  96. * Initialization vector.
  97. *
  98. * @var string
  99. */
  100. private $_initializationVector;
  101. /**
  102. * Is primary.
  103. *
  104. * @var bool
  105. */
  106. private $_isPrimary;
  107. /**
  108. * Last modified.
  109. *
  110. * @var \DateTime
  111. */
  112. private $_lastModified;
  113. /**
  114. * Created.
  115. *
  116. * @var \DateTime
  117. */
  118. private $_created;
  119. /**
  120. * Mime type.
  121. *
  122. * @var string
  123. */
  124. private $_mimeType;
  125. /**
  126. * State.
  127. *
  128. * @var int
  129. */
  130. private $_state;
  131. /**
  132. * ParentIngestManifestId.
  133. *
  134. * @var string
  135. */
  136. private $_parentIngestManifestId;
  137. /**
  138. * ParentIngestManifestAssetId.
  139. *
  140. * @var string
  141. */
  142. private $_parentIngestManifestAssetId;
  143. /**
  144. * ErrorDetail.
  145. *
  146. * @var string
  147. */
  148. private $_errorDetail;
  149. /**
  150. * Create manifest file from array.
  151. *
  152. * @param array $options Array containing values for object properties
  153. *
  154. * @return IngestManifestFile
  155. */
  156. public static function createFromOptions(array $options)
  157. {
  158. Validate::notNull($options['Name'], 'options[Name]');
  159. Validate::notNull(
  160. $options['ParentIngestManifestId'],
  161. 'options[ParentIngestManifestId]'
  162. );
  163. Validate::notNull(
  164. $options['ParentIngestManifestAssetId'],
  165. 'options[ParentIngestManifestAssetId]'
  166. );
  167. $file = new self(
  168. $options['Name'],
  169. $options['ParentIngestManifestId'],
  170. $options['ParentIngestManifestAssetId']
  171. );
  172. $file->fromArray($options);
  173. return $file;
  174. }
  175. /**
  176. * Create manifest file.
  177. *
  178. * @param string $name Actual filename that will be
  179. * uploaded
  180. * @param string $parentIngestManifestId IngestManifest Id of the manifest
  181. * that contains this file
  182. * @param string $parentIngestManifestAssetId IngestManifestAsset Id of the
  183. * IngestManifestAsset that this file is associated with
  184. */
  185. public function __construct(
  186. $name,
  187. $parentIngestManifestId,
  188. $parentIngestManifestAssetId
  189. ) {
  190. $this->_name = $name;
  191. $this->_parentIngestManifestId = $parentIngestManifestId;
  192. $this->_parentIngestManifestAssetId = $parentIngestManifestAssetId;
  193. }
  194. /**
  195. * Fill manifest file from array.
  196. *
  197. * @param array $options Array containing values for object properties
  198. */
  199. public function fromArray(array $options)
  200. {
  201. if (isset($options['Id'])) {
  202. Validate::isString($options['Id'], 'options[Id]');
  203. $this->_id = $options['Id'];
  204. }
  205. if (isset($options['Name'])) {
  206. Validate::isString($options['Name'], 'options[Name]');
  207. $this->_name = $options['Name'];
  208. }
  209. if (isset($options['EncryptionVersion'])) {
  210. Validate::isString(
  211. $options['EncryptionVersion'],
  212. 'options[EncryptionVersion]'
  213. );
  214. $this->_encryptionVersion = $options['EncryptionVersion'];
  215. }
  216. if (isset($options['EncryptionScheme'])) {
  217. Validate::isString(
  218. $options['EncryptionScheme'],
  219. 'options[EncryptionScheme]'
  220. );
  221. $this->_encryptionScheme = $options['EncryptionScheme'];
  222. }
  223. if (isset($options['IsEncrypted'])) {
  224. Validate::isBoolean($options['IsEncrypted'], 'options[IsEncrypted]');
  225. $this->_isEncrypted = $options['IsEncrypted'];
  226. }
  227. if (isset($options['EncryptionKeyId'])) {
  228. Validate::isString(
  229. $options['EncryptionKeyId'],
  230. 'options[EncryptionKeyId]'
  231. );
  232. $this->_encryptionKeyId = $options['EncryptionKeyId'];
  233. }
  234. if (isset($options['InitializationVector'])) {
  235. Validate::isString(
  236. $options['InitializationVector'],
  237. 'options[InitializationVector]'
  238. );
  239. $this->_initializationVector = $options['InitializationVector'];
  240. }
  241. if (isset($options['IsPrimary'])) {
  242. Validate::isBoolean($options['IsPrimary'], 'options[IsPrimary]');
  243. $this->_isPrimary = $options['IsPrimary'];
  244. }
  245. if (isset($options['LastModified'])) {
  246. Validate::isDateString(
  247. $options['LastModified'],
  248. 'options[LastModified]'
  249. );
  250. $this->_lastModified = new \DateTime($options['LastModified']);
  251. }
  252. if (isset($options['Created'])) {
  253. Validate::isDateString($options['Created'], 'options[Created]');
  254. $this->_created = new \DateTime($options['Created']);
  255. }
  256. if (isset($options['MimeType'])) {
  257. Validate::isString($options['MimeType'], 'options[MimeType]');
  258. $this->_mimeType = $options['MimeType'];
  259. }
  260. if (isset($options['State'])) {
  261. Validate::isInteger($options['State'], 'options[State]');
  262. $this->_state = $options['State'];
  263. }
  264. if (isset($options['ParentIngestManifestId'])) {
  265. Validate::isString(
  266. $options['ParentIngestManifestId'],
  267. 'options[ParentIngestManifestId]'
  268. );
  269. $this->_parentIngestManifestId = $options['ParentIngestManifestId'];
  270. }
  271. if (isset($options['ParentIngestManifestAssetId'])) {
  272. Validate::isString(
  273. $options['ParentIngestManifestAssetId'],
  274. 'options[ParentIngestManifestAssetId]'
  275. );
  276. $id = $options['ParentIngestManifestAssetId'];
  277. $this->_parentIngestManifestAssetId = $id;
  278. }
  279. if (isset($options['ErrorDetail'])) {
  280. Validate::isString($options['ErrorDetail'], 'options[ErrorDetail]');
  281. $this->_errorDetail = $options['ErrorDetail'];
  282. }
  283. }
  284. /**
  285. * Get "ErrorDetail".
  286. *
  287. * @return string
  288. */
  289. public function getErrorDetail()
  290. {
  291. return $this->_errorDetail;
  292. }
  293. /**
  294. * Get "ParentIngestManifestAssetId".
  295. *
  296. * @return string
  297. */
  298. public function getParentIngestManifestAssetId()
  299. {
  300. return $this->_parentIngestManifestAssetId;
  301. }
  302. /**
  303. * Set "ParentIngestManifestAssetId".
  304. *
  305. * @param string $value ParentIngestManifestAssetId
  306. */
  307. public function setParentIngestManifestAssetId($value)
  308. {
  309. $this->_parentIngestManifestAssetId = $value;
  310. }
  311. /**
  312. * Get "ParentIngestManifestId".
  313. *
  314. * @return string
  315. */
  316. public function getParentIngestManifestId()
  317. {
  318. return $this->_parentIngestManifestId;
  319. }
  320. /**
  321. * Set "ParentIngestManifestId".
  322. *
  323. * @param string $value ParentIngestManifestId
  324. */
  325. public function setParentIngestManifestId($value)
  326. {
  327. $this->_parentIngestManifestId = $value;
  328. }
  329. /**
  330. * Get "State".
  331. *
  332. * @return int
  333. */
  334. public function getState()
  335. {
  336. return $this->_state;
  337. }
  338. /**
  339. * Get "Mime type".
  340. *
  341. * @return string
  342. */
  343. public function getMimeType()
  344. {
  345. return $this->_mimeType;
  346. }
  347. /**
  348. * Set "Mime type".
  349. *
  350. * @param string $value Mime type
  351. */
  352. public function setMimeType($value)
  353. {
  354. $this->_mimeType = $value;
  355. }
  356. /**
  357. * Get "Created".
  358. *
  359. * @return \DateTime
  360. */
  361. public function getCreated()
  362. {
  363. return $this->_created;
  364. }
  365. /**
  366. * Get "Last modified".
  367. *
  368. * @return \DateTime
  369. */
  370. public function getLastModified()
  371. {
  372. return $this->_lastModified;
  373. }
  374. /**
  375. * Get "Is primary".
  376. *
  377. * @return bool
  378. */
  379. public function getIsPrimary()
  380. {
  381. return $this->_isPrimary;
  382. }
  383. /**
  384. * Set "Is primary".
  385. *
  386. * @param bool $value Is primary
  387. */
  388. public function setIsPrimary($value)
  389. {
  390. $this->_isPrimary = $value;
  391. }
  392. /**
  393. * Get "Initialization vector".
  394. *
  395. * @return string
  396. */
  397. public function getInitializationVector()
  398. {
  399. return $this->_initializationVector;
  400. }
  401. /**
  402. * Set "Initialization vector".
  403. *
  404. * @param string $value Initialization vector
  405. */
  406. public function setInitializationVector($value)
  407. {
  408. $this->_initializationVector = $value;
  409. }
  410. /**
  411. * Get "Encryption key id".
  412. *
  413. * @return string
  414. */
  415. public function getEncryptionKeyId()
  416. {
  417. return $this->_encryptionKeyId;
  418. }
  419. /**
  420. * Set "Encryption key id".
  421. *
  422. * @param string $value Encryption key id
  423. */
  424. public function setEncryptionKeyId($value)
  425. {
  426. $this->_encryptionKeyId = $value;
  427. }
  428. /**
  429. * Get "Is encrypted".
  430. *
  431. * @return bool
  432. */
  433. public function getIsEncrypted()
  434. {
  435. return $this->_isEncrypted;
  436. }
  437. /**
  438. * Set "Is encrypted".
  439. *
  440. * @param bool $value Is encrypted
  441. */
  442. public function setIsEncrypted($value)
  443. {
  444. $this->_isEncrypted = $value;
  445. }
  446. /**
  447. * Get "Encryption scheme".
  448. *
  449. * @return string
  450. */
  451. public function getEncryptionScheme()
  452. {
  453. return $this->_encryptionScheme;
  454. }
  455. /**
  456. * Set "Encryption scheme".
  457. *
  458. * @param string $value Encryption scheme
  459. */
  460. public function setEncryptionScheme($value)
  461. {
  462. $this->_encryptionScheme = $value;
  463. }
  464. /**
  465. * Get "Encryption version".
  466. *
  467. * @return string
  468. */
  469. public function getEncryptionVersion()
  470. {
  471. return $this->_encryptionVersion;
  472. }
  473. /**
  474. * Set "Encryption version".
  475. *
  476. * @param string $value Encryption version
  477. */
  478. public function setEncryptionVersion($value)
  479. {
  480. $this->_encryptionVersion = $value;
  481. }
  482. /**
  483. * Get "Name".
  484. *
  485. * @return string
  486. */
  487. public function getName()
  488. {
  489. return $this->_name;
  490. }
  491. /**
  492. * Set "Name".
  493. *
  494. * @param string $value Name
  495. */
  496. public function setName($value)
  497. {
  498. $this->_name = $value;
  499. }
  500. /**
  501. * Get "Manifest file Id".
  502. *
  503. * @return string
  504. */
  505. public function getId()
  506. {
  507. return $this->_id;
  508. }
  509. }