Node.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. <?php
  2. /**
  3. * Node
  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. * Cablemodem Flowdat
  14. *
  15. * API REST para Flowdat Cablemodem.
  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\Cablemodem\Model;
  28. use ArrayAccess;
  29. use Swagger\Client\Model\ModelInterface;
  30. use Swagger\Client\ObjectSerializer;
  31. /**
  32. * Node Class Doc Comment
  33. *
  34. * @category Class
  35. * @package Swagger\Client\Cablemodem
  36. * @author Swagger Codegen team
  37. * @link https://github.com/swagger-api/swagger-codegen
  38. */
  39. class Node 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 = 'Node';
  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. 'parent' => 'int',
  57. 'childs' => '\Swagger\Client\Cablemodem\Model\Node[]',
  58. 'tenancy_id' => 'int'
  59. ];
  60. /**
  61. * Array of property to format mappings. Used for (de)serialization
  62. *
  63. * @var string[]
  64. */
  65. protected static $swaggerFormats = [
  66. 'id' => null,
  67. 'name' => null,
  68. 'parent' => null,
  69. 'childs' => null,
  70. 'tenancy_id' => null
  71. ];
  72. /**
  73. * Array of property to type mappings. Used for (de)serialization
  74. *
  75. * @return array
  76. */
  77. public static function swaggerTypes()
  78. {
  79. return self::$swaggerTypes;
  80. }
  81. /**
  82. * Array of property to format mappings. Used for (de)serialization
  83. *
  84. * @return array
  85. */
  86. public static function swaggerFormats()
  87. {
  88. return self::$swaggerFormats;
  89. }
  90. /**
  91. * Array of attributes where the key is the local name,
  92. * and the value is the original name
  93. *
  94. * @var string[]
  95. */
  96. protected static $attributeMap = [
  97. 'id' => 'id',
  98. 'name' => 'name',
  99. 'parent' => 'parent',
  100. 'childs' => 'childs',
  101. 'tenancy_id' => 'tenancyId'
  102. ];
  103. /**
  104. * Array of attributes to setter functions (for deserialization of responses)
  105. *
  106. * @var string[]
  107. */
  108. protected static $setters = [
  109. 'id' => 'setId',
  110. 'name' => 'setName',
  111. 'parent' => 'setParent',
  112. 'childs' => 'setChilds',
  113. 'tenancy_id' => 'setTenancyId'
  114. ];
  115. /**
  116. * Array of attributes to getter functions (for serialization of requests)
  117. *
  118. * @var string[]
  119. */
  120. protected static $getters = [
  121. 'id' => 'getId',
  122. 'name' => 'getName',
  123. 'parent' => 'getParent',
  124. 'childs' => 'getChilds',
  125. 'tenancy_id' => 'getTenancyId'
  126. ];
  127. /**
  128. * Array of attributes where the key is the local name,
  129. * and the value is the original name
  130. *
  131. * @return array
  132. */
  133. public static function attributeMap()
  134. {
  135. return self::$attributeMap;
  136. }
  137. /**
  138. * Array of attributes to setter functions (for deserialization of responses)
  139. *
  140. * @return array
  141. */
  142. public static function setters()
  143. {
  144. return self::$setters;
  145. }
  146. /**
  147. * Array of attributes to getter functions (for serialization of requests)
  148. *
  149. * @return array
  150. */
  151. public static function getters()
  152. {
  153. return self::$getters;
  154. }
  155. /**
  156. * The original name of the model.
  157. *
  158. * @return string
  159. */
  160. public function getModelName()
  161. {
  162. return self::$swaggerModelName;
  163. }
  164. /**
  165. * Associative array for storing property values
  166. *
  167. * @var mixed[]
  168. */
  169. protected $container = [];
  170. /**
  171. * Constructor
  172. *
  173. * @param mixed[] $data Associated array of property values
  174. * initializing the model
  175. */
  176. public function __construct(array $data = null)
  177. {
  178. $this->container['id'] = isset($data['id']) ? $data['id'] : null;
  179. $this->container['name'] = isset($data['name']) ? $data['name'] : null;
  180. $this->container['parent'] = isset($data['parent']) ? $data['parent'] : null;
  181. $this->container['childs'] = isset($data['childs']) ? $data['childs'] : null;
  182. $this->container['tenancy_id'] = isset($data['tenancy_id']) ? $data['tenancy_id'] : null;
  183. }
  184. /**
  185. * Show all the invalid properties with reasons.
  186. *
  187. * @return array invalid properties with reasons
  188. */
  189. public function listInvalidProperties()
  190. {
  191. $invalidProperties = [];
  192. return $invalidProperties;
  193. }
  194. /**
  195. * Validate all the properties in the model
  196. * return true if all passed
  197. *
  198. * @return bool True if all properties are valid
  199. */
  200. public function valid()
  201. {
  202. return count($this->listInvalidProperties()) === 0;
  203. }
  204. /**
  205. * Gets id
  206. *
  207. * @return int
  208. */
  209. public function getId()
  210. {
  211. return $this->container['id'];
  212. }
  213. /**
  214. * Sets id
  215. *
  216. * @param int $id Id del nodo.
  217. *
  218. * @return $this
  219. */
  220. public function setId($id)
  221. {
  222. $this->container['id'] = $id;
  223. return $this;
  224. }
  225. /**
  226. * Gets name
  227. *
  228. * @return string
  229. */
  230. public function getName()
  231. {
  232. return $this->container['name'];
  233. }
  234. /**
  235. * Sets name
  236. *
  237. * @param string $name Nombre del nodo.
  238. *
  239. * @return $this
  240. */
  241. public function setName($name)
  242. {
  243. $this->container['name'] = $name;
  244. return $this;
  245. }
  246. /**
  247. * Gets parent
  248. *
  249. * @return int
  250. */
  251. public function getParent()
  252. {
  253. return $this->container['parent'];
  254. }
  255. /**
  256. * Sets parent
  257. *
  258. * @param int $parent Id del nodo padre.
  259. *
  260. * @return $this
  261. */
  262. public function setParent($parent)
  263. {
  264. $this->container['parent'] = $parent;
  265. return $this;
  266. }
  267. /**
  268. * Gets childs
  269. *
  270. * @return \Swagger\Client\Cablemodem\Model\Node[]
  271. */
  272. public function getChilds()
  273. {
  274. return $this->container['childs'];
  275. }
  276. /**
  277. * Sets childs
  278. *
  279. * @param \Swagger\Client\Cablemodem\Model\Node[] $childs Listado de Nodos hijos.
  280. *
  281. * @return $this
  282. */
  283. public function setChilds($childs)
  284. {
  285. $this->container['childs'] = $childs;
  286. return $this;
  287. }
  288. /**
  289. * Gets tenancy_id
  290. *
  291. * @return int
  292. */
  293. public function getTenancyId()
  294. {
  295. return $this->container['tenancy_id'];
  296. }
  297. /**
  298. * Sets tenancy_id
  299. *
  300. * @param int $tenancy_id Id de la tenencia a la que pertenece el NAP.
  301. *
  302. * @return $this
  303. */
  304. public function setTenancyId($tenancy_id)
  305. {
  306. $this->container['tenancy_id'] = $tenancy_id;
  307. return $this;
  308. }
  309. /**
  310. * Returns true if offset exists. False otherwise.
  311. *
  312. * @param integer $offset Offset
  313. *
  314. * @return boolean
  315. */
  316. public function offsetExists($offset)
  317. {
  318. return isset($this->container[$offset]);
  319. }
  320. /**
  321. * Gets offset.
  322. *
  323. * @param integer $offset Offset
  324. *
  325. * @return mixed
  326. */
  327. public function offsetGet($offset)
  328. {
  329. return isset($this->container[$offset]) ? $this->container[$offset] : null;
  330. }
  331. /**
  332. * Sets value based on offset.
  333. *
  334. * @param integer $offset Offset
  335. * @param mixed $value Value to be set
  336. *
  337. * @return void
  338. */
  339. public function offsetSet($offset, $value)
  340. {
  341. if (is_null($offset)) {
  342. $this->container[] = $value;
  343. } else {
  344. $this->container[$offset] = $value;
  345. }
  346. }
  347. /**
  348. * Unsets offset.
  349. *
  350. * @param integer $offset Offset
  351. *
  352. * @return void
  353. */
  354. public function offsetUnset($offset)
  355. {
  356. unset($this->container[$offset]);
  357. }
  358. /**
  359. * Gets the string presentation of the object
  360. *
  361. * @return string
  362. */
  363. public function __toString()
  364. {
  365. if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
  366. return json_encode(
  367. ObjectSerializer::sanitizeForSerialization($this),
  368. JSON_PRETTY_PRINT
  369. );
  370. }
  371. return json_encode(ObjectSerializer::sanitizeForSerialization($this));
  372. }
  373. }