1: <?php
2:
3: namespace Saklient\Cloud\Resources;
4:
5: require_once __DIR__ . "/../../../Saklient/Cloud/Client.php";
6: use \Saklient\Cloud\Client;
7: require_once __DIR__ . "/../../../Saklient/Cloud/Resources/Resource.php";
8: use \Saklient\Cloud\Resources\Resource;
9: require_once __DIR__ . "/../../../Saklient/Cloud/Resources/Swytch.php";
10: use \Saklient\Cloud\Resources\Swytch;
11: require_once __DIR__ . "/../../../Saklient/Util.php";
12: use \Saklient\Util;
13: require_once __DIR__ . "/../../../Saklient/Errors/SaklientException.php";
14: use \Saklient\Errors\SaklientException;
15:
16: 17: 18: 19: 20: 21: 22: 23:
24: class Ipv6Net extends Resource {
25:
26: 27: 28: 29: 30: 31: 32:
33: protected $m_id;
34:
35: 36: 37: 38: 39: 40: 41:
42: protected $m_prefix;
43:
44: 45: 46: 47: 48: 49: 50:
51: protected $m_prefixLen;
52:
53: 54: 55: 56: 57: 58: 59:
60: protected $m_prefixTail;
61:
62: 63: 64: 65: 66: 67:
68: protected function _apiPath()
69: {
70: return "/ipv6net";
71: }
72:
73: 74: 75: 76: 77: 78:
79: protected function _rootKey()
80: {
81: return "IPv6Net";
82: }
83:
84: 85: 86: 87: 88: 89:
90: protected function _rootKeyM()
91: {
92: return "IPv6Nets";
93: }
94:
95: 96: 97: 98: 99: 100:
101: public function _className()
102: {
103: return "Ipv6Net";
104: }
105:
106: 107: 108: 109: 110: 111:
112: public function _id()
113: {
114: return $this->get_id();
115: }
116:
117: 118: 119: 120: 121: 122:
123: public function reload()
124: {
125: return $this->_reload();
126: }
127:
128: 129: 130: 131: 132: 133: 134:
135: public function __construct(\Saklient\Cloud\Client $client, $obj, $wrapped=false)
136: {
137: parent::__construct($client);
138: Util::validateArgCount(func_num_args(), 2);
139: Util::validateType($client, "\\Saklient\\Cloud\\Client");
140: Util::validateType($wrapped, "boolean");
141: $this->apiDeserialize($obj, $wrapped);
142: }
143:
144: 145: 146: 147: 148:
149: private $n_id = false;
150:
151: 152: 153: 154: 155: 156: 157:
158: private function get_id()
159: {
160: return $this->m_id;
161: }
162:
163:
164:
165: 166: 167: 168: 169:
170: private $n_prefix = false;
171:
172: 173: 174: 175: 176: 177: 178:
179: private function get_prefix()
180: {
181: return $this->m_prefix;
182: }
183:
184:
185:
186: 187: 188: 189: 190:
191: private $n_prefixLen = false;
192:
193: 194: 195: 196: 197: 198: 199:
200: private function get_prefixLen()
201: {
202: return $this->m_prefixLen;
203: }
204:
205:
206:
207: 208: 209: 210: 211:
212: private $n_prefixTail = false;
213:
214: 215: 216: 217: 218: 219: 220:
221: private function get_prefixTail()
222: {
223: return $this->m_prefixTail;
224: }
225:
226:
227:
228: 229: 230: 231: 232: 233: 234:
235: protected function apiDeserializeImpl($r)
236: {
237: Util::validateArgCount(func_num_args(), 1);
238: $this->isNew = $r == null;
239: if ($this->isNew) {
240: $r = (object)[];
241: }
242: $this->isIncomplete = false;
243: if (Util::existsPath($r, "ID")) {
244: $this->m_id = Util::getByPath($r, "ID") == null ? null : "" . Util::getByPath($r, "ID");
245: }
246: else {
247: $this->m_id = null;
248: $this->isIncomplete = true;
249: }
250: $this->n_id = false;
251: if (Util::existsPath($r, "IPv6Prefix")) {
252: $this->m_prefix = Util::getByPath($r, "IPv6Prefix") == null ? null : "" . Util::getByPath($r, "IPv6Prefix");
253: }
254: else {
255: $this->m_prefix = null;
256: $this->isIncomplete = true;
257: }
258: $this->n_prefix = false;
259: if (Util::existsPath($r, "IPv6PrefixLen")) {
260: $this->m_prefixLen = Util::getByPath($r, "IPv6PrefixLen") == null ? null : intval("" . Util::getByPath($r, "IPv6PrefixLen"));
261: }
262: else {
263: $this->m_prefixLen = null;
264: $this->isIncomplete = true;
265: }
266: $this->n_prefixLen = false;
267: if (Util::existsPath($r, "IPv6PrefixTail")) {
268: $this->m_prefixTail = Util::getByPath($r, "IPv6PrefixTail") == null ? null : "" . Util::getByPath($r, "IPv6PrefixTail");
269: }
270: else {
271: $this->m_prefixTail = null;
272: $this->isIncomplete = true;
273: }
274: $this->n_prefixTail = false;
275: }
276:
277: 278: 279: 280: 281: 282:
283: protected function apiSerializeImpl($withClean=false)
284: {
285: Util::validateType($withClean, "boolean");
286: $ret = (object)[];
287: if ($withClean || $this->n_id) {
288: Util::setByPath($ret, "ID", $this->m_id);
289: }
290: if ($withClean || $this->n_prefix) {
291: Util::setByPath($ret, "IPv6Prefix", $this->m_prefix);
292: }
293: if ($withClean || $this->n_prefixLen) {
294: Util::setByPath($ret, "IPv6PrefixLen", $this->m_prefixLen);
295: }
296: if ($withClean || $this->n_prefixTail) {
297: Util::setByPath($ret, "IPv6PrefixTail", $this->m_prefixTail);
298: }
299: return $ret;
300: }
301:
302: 303: 304:
305: public function __get($key) {
306: switch ($key) {
307: case "id": return $this->get_id();
308: case "prefix": return $this->get_prefix();
309: case "prefixLen": return $this->get_prefixLen();
310: case "prefixTail": return $this->get_prefixTail();
311: default: return parent::__get($key);
312: }
313: }
314:
315: }
316:
317: