ONUModel.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. <?php
  2. /**
  3. * ONUModel
  4. *
  5. * PHP version 5
  6. *
  7. * @category Class
  8. * @package Swagger\Client
  9. * @author Swagger Codegen team
  10. * @link https://github.com/swagger-api/swagger-codegen
  11. */
  12. /**
  13. * FTTH Flowdat
  14. *
  15. * API REST para Flowdat FTTH.
  16. *
  17. * OpenAPI spec version: 1.0.0
  18. *
  19. * Generated by: https://github.com/swagger-api/swagger-codegen.git
  20. * Swagger Codegen version: 2.4.0-SNAPSHOT
  21. */
  22. /**
  23. * NOTE: This class is auto generated by the swagger code generator program.
  24. * https://github.com/swagger-api/swagger-codegen
  25. * Do not edit the class manually.
  26. */
  27. namespace Swagger\Client\FTTH\Model;
  28. use ArrayAccess;
  29. use Swagger\Client\Model\ModelInterface;
  30. use Swagger\Client\ObjectSerializer;
  31. /**
  32. * ONUModel Class Doc Comment
  33. *
  34. * @category Class
  35. * @package Swagger\Client\FTTH
  36. * @author Swagger Codegen team
  37. * @link https://github.com/swagger-api/swagger-codegen
  38. */
  39. class ONUModel implements ModelInterface, ArrayAccess
  40. {
  41. const DISCRIMINATOR = null;
  42. /**
  43. * The original name of the model.
  44. *
  45. * @var string
  46. */
  47. protected static $swaggerModelName = 'ONUModel';
  48. /**
  49. * Array of property to type mappings. Used for (de)serialization
  50. *
  51. * @var string[]
  52. */
  53. protected static $swaggerTypes = [
  54. 'id' => 'int',
  55. 'name' => 'string',
  56. 'catv' => 'bool',
  57. 'wifi' => 'bool',
  58. 'extra_data' => 'string',
  59. 'routing_mode' => 'string',
  60. 'tenancy_id' => 'int'
  61. ];
  62. /**
  63. * Array of property to format mappings. Used for (de)serialization
  64. *
  65. * @var string[]
  66. */
  67. protected static $swaggerFormats = [
  68. 'id' => null,
  69. 'name' => null,
  70. 'catv' => null,
  71. 'wifi' => null,
  72. 'extra_data' => 'json',
  73. 'routing_mode' => null,
  74. 'tenancy_id' => null
  75. ];
  76. /**
  77. * Array of property to type mappings. Used for (de)serialization
  78. *
  79. * @return array
  80. */
  81. public static function swaggerTypes()
  82. {
  83. return self::$swaggerTypes;
  84. }
  85. /**
  86. * Array of property to format mappings. Used for (de)serialization
  87. *
  88. * @return array
  89. */
  90. public static function swaggerFormats()
  91. {
  92. return self::$swaggerFormats;
  93. }
  94. /**
  95. * Array of attributes where the key is the local name,
  96. * and the value is the original name
  97. *
  98. * @var string[]
  99. */
  100. protected static $attributeMap = [
  101. 'id' => 'id',
  102. 'name' => 'name',
  103. 'catv' => 'catv',
  104. 'wifi' => 'wifi',
  105. 'extra_data' => 'extraData',
  106. 'routing_mode' => 'routingMode',
  107. 'tenancy_id' => 'tenancyId'
  108. ];
  109. /**
  110. * Array of attributes to setter functions (for deserialization of responses)
  111. *
  112. * @var string[]
  113. */
  114. protected static $setters = [
  115. 'id' => 'setId',
  116. 'name' => 'setName',
  117. 'catv' => 'setCatv',
  118. 'wifi' => 'setWifi',
  119. 'extra_data' => 'setExtraData',
  120. 'routing_mode' => 'setRoutingMode',
  121. 'tenancy_id' => 'setTenancyId'
  122. ];
  123. /**
  124. * Array of attributes to getter functions (for serialization of requests)
  125. *
  126. * @var string[]
  127. */
  128. protected static $getters = [
  129. 'id' => 'getId',
  130. 'name' => 'getName',
  131. 'catv' => 'getCatv',
  132. 'wifi' => 'getWifi',
  133. 'extra_data' => 'getExtraData',
  134. 'routing_mode' => 'getRoutingMode',
  135. 'tenancy_id' => 'getTenancyId'
  136. ];
  137. /**
  138. * Array of attributes where the key is the local name,
  139. * and the value is the original name
  140. *
  141. * @return array
  142. */
  143. public static function attributeMap()
  144. {
  145. return self::$attributeMap;
  146. }
  147. /**
  148. * Array of attributes to setter functions (for deserialization of responses)
  149. *
  150. * @return array
  151. */
  152. public static function setters()
  153. {
  154. return self::$setters;
  155. }
  156. /**
  157. * Array of attributes to getter functions (for serialization of requests)
  158. *
  159. * @return array
  160. */
  161. public static function getters()
  162. {
  163. return self::$getters;
  164. }
  165. /**
  166. * The original name of the model.
  167. *
  168. * @return string
  169. */
  170. public function getModelName()
  171. {
  172. return self::$swaggerModelName;
  173. }
  174. const ROUTING_MODE_ROUTER = 'router';
  175. const ROUTING_MODE_NULL = 'NULL';
  176. const ROUTING_MODE_BRIDGE = 'bridge';
  177. /**
  178. * Gets allowable values of the enum
  179. *
  180. * @return string[]
  181. */
  182. public function getRoutingModeAllowableValues()
  183. {
  184. return [
  185. self::ROUTING_MODE_ROUTER,
  186. self::ROUTING_MODE_NULL,
  187. self::ROUTING_MODE_BRIDGE,
  188. ];
  189. }
  190. /**
  191. * Associative array for storing property values
  192. *
  193. * @var mixed[]
  194. */
  195. protected $container = [];
  196. /**
  197. * Constructor
  198. *
  199. * @param mixed[] $data Associated array of property values
  200. * initializing the model
  201. */
  202. public function __construct(array $data = null)
  203. {
  204. $this->container['id'] = isset($data['id']) ? $data['id'] : null;
  205. $this->container['name'] = isset($data['name']) ? $data['name'] : null;
  206. $this->container['catv'] = isset($data['catv']) ? $data['catv'] : null;
  207. $this->container['wifi'] = isset($data['wifi']) ? $data['wifi'] : null;
  208. $this->container['extra_data'] = isset($data['extra_data']) ? $data['extra_data'] : null;
  209. $this->container['routing_mode'] = isset($data['routing_mode']) ? $data['routing_mode'] : null;
  210. $this->container['tenancy_id'] = isset($data['tenancy_id']) ? $data['tenancy_id'] : null;
  211. }
  212. /**
  213. * Show all the invalid properties with reasons.
  214. *
  215. * @return array invalid properties with reasons
  216. */
  217. public function listInvalidProperties()
  218. {
  219. $invalidProperties = [];
  220. $allowedValues = $this->getRoutingModeAllowableValues();
  221. if (!is_null($this->container['routing_mode']) && !in_array($this->container['routing_mode'], $allowedValues, true)) {
  222. $invalidProperties[] = sprintf(
  223. "invalid value for 'routing_mode', must be one of '%s'",
  224. implode("', '", $allowedValues)
  225. );
  226. }
  227. return $invalidProperties;
  228. }
  229. /**
  230. * Validate all the properties in the model
  231. * return true if all passed
  232. *
  233. * @return bool True if all properties are valid
  234. */
  235. public function valid()
  236. {
  237. return count($this->listInvalidProperties()) === 0;
  238. }
  239. /**
  240. * Gets id
  241. *
  242. * @return int
  243. */
  244. public function getId()
  245. {
  246. return $this->container['id'];
  247. }
  248. /**
  249. * Sets id
  250. *
  251. * @param int $id Id del modelo de ONU.
  252. *
  253. * @return $this
  254. */
  255. public function setId($id)
  256. {
  257. $this->container['id'] = $id;
  258. return $this;
  259. }
  260. /**
  261. * Gets name
  262. *
  263. * @return string
  264. */
  265. public function getName()
  266. {
  267. return $this->container['name'];
  268. }
  269. /**
  270. * Sets name
  271. *
  272. * @param string $name Nombre del modelo de ONU.
  273. *
  274. * @return $this
  275. */
  276. public function setName($name)
  277. {
  278. $this->container['name'] = $name;
  279. return $this;
  280. }
  281. /**
  282. * Gets catv
  283. *
  284. * @return bool
  285. */
  286. public function getCatv()
  287. {
  288. return $this->container['catv'];
  289. }
  290. /**
  291. * Sets catv
  292. *
  293. * @param bool $catv Si esta en TRUE, significa que posee catv.
  294. *
  295. * @return $this
  296. */
  297. public function setCatv($catv)
  298. {
  299. $this->container['catv'] = $catv;
  300. return $this;
  301. }
  302. /**
  303. * Gets wifi
  304. *
  305. * @return bool
  306. */
  307. public function getWifi()
  308. {
  309. return $this->container['wifi'];
  310. }
  311. /**
  312. * Sets wifi
  313. *
  314. * @param bool $wifi Si esta en TRUE, significa que posee wifi.
  315. *
  316. * @return $this
  317. */
  318. public function setWifi($wifi)
  319. {
  320. $this->container['wifi'] = $wifi;
  321. return $this;
  322. }
  323. /**
  324. * Gets extra_data
  325. *
  326. * @return string
  327. */
  328. public function getExtraData()
  329. {
  330. return $this->container['extra_data'];
  331. }
  332. /**
  333. * Sets extra_data
  334. *
  335. * @param string $extra_data Datos extras almacenados.
  336. *
  337. * @return $this
  338. */
  339. public function setExtraData($extra_data)
  340. {
  341. $this->container['extra_data'] = $extra_data;
  342. return $this;
  343. }
  344. /**
  345. * Gets routing_mode
  346. *
  347. * @return string
  348. */
  349. public function getRoutingMode()
  350. {
  351. return $this->container['routing_mode'];
  352. }
  353. /**
  354. * Sets routing_mode
  355. *
  356. * @param string $routing_mode Tipo de ruteo.
  357. *
  358. * @return $this
  359. */
  360. public function setRoutingMode($routing_mode)
  361. {
  362. $allowedValues = $this->getRoutingModeAllowableValues();
  363. if (!is_null($routing_mode) && !in_array($routing_mode, $allowedValues, true)) {
  364. throw new \InvalidArgumentException(
  365. sprintf(
  366. "Invalid value for 'routing_mode', must be one of '%s'",
  367. implode("', '", $allowedValues)
  368. )
  369. );
  370. }
  371. $this->container['routing_mode'] = $routing_mode;
  372. return $this;
  373. }
  374. /**
  375. * Gets tenancy_id
  376. *
  377. * @return int
  378. */
  379. public function getTenancyId()
  380. {
  381. return $this->container['tenancy_id'];
  382. }
  383. /**
  384. * Sets tenancy_id
  385. *
  386. * @param int $tenancy_id Id de la tenencia a la que pertenece el Modelo de ONU.
  387. *
  388. * @return $this
  389. */
  390. public function setTenancyId($tenancy_id)
  391. {
  392. $this->container['tenancy_id'] = $tenancy_id;
  393. return $this;
  394. }
  395. /**
  396. * Returns true if offset exists. False otherwise.
  397. *
  398. * @param integer $offset Offset
  399. *
  400. * @return boolean
  401. */
  402. public function offsetExists($offset)
  403. {
  404. return isset($this->container[$offset]);
  405. }
  406. /**
  407. * Gets offset.
  408. *
  409. * @param integer $offset Offset
  410. *
  411. * @return mixed
  412. */
  413. public function offsetGet($offset)
  414. {
  415. return isset($this->container[$offset]) ? $this->container[$offset] : null;
  416. }
  417. /**
  418. * Sets value based on offset.
  419. *
  420. * @param integer $offset Offset
  421. * @param mixed $value Value to be set
  422. *
  423. * @return void
  424. */
  425. public function offsetSet($offset, $value)
  426. {
  427. if (is_null($offset)) {
  428. $this->container[] = $value;
  429. } else {
  430. $this->container[$offset] = $value;
  431. }
  432. }
  433. /**
  434. * Unsets offset.
  435. *
  436. * @param integer $offset Offset
  437. *
  438. * @return void
  439. */
  440. public function offsetUnset($offset)
  441. {
  442. unset($this->container[$offset]);
  443. }
  444. /**
  445. * Gets the string presentation of the object
  446. *
  447. * @return string
  448. */
  449. public function __toString()
  450. {
  451. if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
  452. return json_encode(
  453. ObjectSerializer::sanitizeForSerialization($this),
  454. JSON_PRETTY_PRINT
  455. );
  456. }
  457. return json_encode(ObjectSerializer::sanitizeForSerialization($this));
  458. }
  459. }