PageRenderTime 48ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

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

https://gitlab.com/vietdhtn/myweb
PHP | 372 lines | 126 code | 47 blank | 199 comment | 9 complexity | 58bdfa34a919d86f4371b3a196df6834 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\Validate;
  25. /**
  26. * Represents asset object used in media services
  27. *
  28. * @category Microsoft
  29. * @package WindowsAzure\MediaServices\Models
  30. * @author Azure PHP SDK <azurephpsdk@microsoft.com>
  31. * @copyright Microsoft Corporation
  32. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  33. * @version Release: 0.4.0_2014-01
  34. * @link https://github.com/windowsazure/azure-sdk-for-php
  35. */
  36. class Asset
  37. {
  38. /**
  39. * The state of the asset "initialized"
  40. *
  41. * @var int
  42. */
  43. const STATE_INITIALIZED = 0;
  44. /**
  45. * The state of the asset "published"
  46. *
  47. * @var int
  48. */
  49. const STATE_PUBLISHED = 1;
  50. /**
  51. * The state of the asset "deleted"
  52. *
  53. * @var int
  54. */
  55. const STATE_DELETED = 2;
  56. /**
  57. * The encryption options "none"
  58. *
  59. * @var int
  60. */
  61. const OPTIONS_NONE = 0;
  62. /**
  63. * The encryption options "storage encrypted"
  64. *
  65. * @var int
  66. */
  67. const OPTIONS_STORAGE_ENCRYPTED = 1;
  68. /**
  69. * The encryption options "common encryption protected"
  70. *
  71. * @var int
  72. */
  73. const OPTIONS_COMMON_ENCRYPTION_PROTECTED = 2;
  74. /**
  75. * The encryption options "envelope encryption protected"
  76. *
  77. * @var int
  78. */
  79. const OPTIONS_ENVELOPE_ENCRYPTION_PROTECTED = 4;
  80. /**
  81. * Asset id
  82. *
  83. * @var string
  84. */
  85. private $_id;
  86. /**
  87. * State
  88. *
  89. * @var int
  90. */
  91. private $_state;
  92. /**
  93. * Created
  94. *
  95. * @var \DateTime
  96. */
  97. private $_created;
  98. /**
  99. * Last modified
  100. *
  101. * @var \DateTime
  102. */
  103. private $_lastModified;
  104. /**
  105. * Alternate id
  106. *
  107. * @var string
  108. */
  109. private $_alternateId;
  110. /**
  111. * Name
  112. *
  113. * @var string
  114. */
  115. private $_name;
  116. /**
  117. * Options
  118. *
  119. * @var int
  120. */
  121. private $_options;
  122. /**
  123. * URI
  124. *
  125. * @var string
  126. */
  127. private $_uri;
  128. /**
  129. * Storage account name
  130. *
  131. * @var string
  132. */
  133. private $_storageAccountName;
  134. /**
  135. * Create asset from array
  136. *
  137. * @param array $options Array containing values for object properties
  138. *
  139. * @return WindowsAzure\MediaServices\Models\Asset
  140. */
  141. public static function createFromOptions($options)
  142. {
  143. Validate::notNull($options['Options'], 'options[Options]');
  144. $asset = new Asset($options['Options']);
  145. $asset->fromArray($options);
  146. return $asset;
  147. }
  148. /**
  149. * Create asset
  150. *
  151. * @param int $options Asset encrytion options.
  152. *
  153. * @return none
  154. */
  155. public function __construct($options)
  156. {
  157. $this->options = $options;
  158. }
  159. /**
  160. * Fill asset from array
  161. *
  162. * @param array $options Array containing values for object properties
  163. *
  164. * @return none
  165. */
  166. public function fromArray($options)
  167. {
  168. if (isset($options['Id'])) {
  169. Validate::isString($options['Id'], 'options[Id]');
  170. $this->_id = $options['Id'];
  171. }
  172. if (isset($options['State'])) {
  173. Validate::isInteger($options['State'], 'options[State]');
  174. $this->_state = $options['State'];
  175. }
  176. if (isset($options['Created'])) {
  177. Validate::isDateString($options['Created'], 'options[Created]');
  178. $this->_created = new \DateTime($options['Created']);
  179. }
  180. if (isset($options['LastModified'])) {
  181. Validate::isDateString(
  182. $options['LastModified'],
  183. 'options[LastModified]'
  184. );
  185. $this->_lastModified = new \DateTime($options['LastModified']);
  186. }
  187. if (isset($options['AlternateId'])) {
  188. Validate::isString($options['AlternateId'], 'options[AlternateId]');
  189. $this->_alternateId = $options['AlternateId'];
  190. }
  191. if (isset($options['Name'])) {
  192. Validate::isString($options['Name'], 'options[Name]');
  193. $this->_name = $options['Name'];
  194. }
  195. if (isset($options['Options'])) {
  196. Validate::isInteger($options['Options'], 'options[Options]');
  197. $this->_options = $options['Options'];
  198. }
  199. if (isset($options['Uri'])) {
  200. Validate::isValidUri($options['Uri'], 'options[Uri]');
  201. $this->_uri = $options['Uri'];
  202. }
  203. if (isset($options['StorageAccountName'])) {
  204. Validate::isString(
  205. $options['StorageAccountName'],
  206. 'options[StorageAccountName]'
  207. );
  208. $this->_storageAccountName = $options['StorageAccountName'];
  209. }
  210. }
  211. /**
  212. * Get "Storage account name"
  213. *
  214. * @return string
  215. */
  216. public function getStorageAccountName()
  217. {
  218. return $this->_storageAccountName;
  219. }
  220. /**
  221. * Get "URI"
  222. *
  223. * @return string
  224. */
  225. public function getUri()
  226. {
  227. return $this->_uri;
  228. }
  229. /**
  230. * Get "Options"
  231. *
  232. * @return int
  233. */
  234. public function getOptions()
  235. {
  236. return $this->_options;
  237. }
  238. /**
  239. * Set "Options"
  240. *
  241. * @param int $value Options
  242. *
  243. * @return none
  244. */
  245. public function setOptions($value)
  246. {
  247. $this->_options = $value;
  248. }
  249. /**
  250. * Get "Name"
  251. *
  252. * @return string
  253. */
  254. public function getName()
  255. {
  256. return $this->_name;
  257. }
  258. /**
  259. * Set "Name"
  260. *
  261. * @param string $value Name
  262. *
  263. * @return none
  264. */
  265. public function setName($value)
  266. {
  267. $this->_name = $value;
  268. }
  269. /**
  270. * Get "Alternate id"
  271. *
  272. * @return string
  273. */
  274. public function getAlternateId()
  275. {
  276. return $this->_alternateId;
  277. }
  278. /**
  279. * Set "Alternate id"
  280. *
  281. * @param string $value Alternate id
  282. *
  283. * @return none
  284. */
  285. public function setAlternateId($value)
  286. {
  287. $this->_alternateId = $value;
  288. }
  289. /**
  290. * Get "Last modified"
  291. *
  292. * @return \DateTime
  293. */
  294. public function getLastModified()
  295. {
  296. return $this->_lastModified;
  297. }
  298. /**
  299. * Get "Created"
  300. *
  301. * @return \DateTime
  302. */
  303. public function getCreated()
  304. {
  305. return $this->_created;
  306. }
  307. /**
  308. * Get "State"
  309. *
  310. * @return int
  311. */
  312. public function getState()
  313. {
  314. return $this->_state;
  315. }
  316. /**
  317. * Get "Asset id"
  318. *
  319. * @return string
  320. */
  321. public function getId()
  322. {
  323. return $this->_id;
  324. }
  325. }