1: <?php
2:
3: namespace Saklient\Cloud\Models;
4:
5: require_once __DIR__ . "/../../../Saklient/Cloud/Client.php";
6: use \Saklient\Cloud\Client;
7: require_once __DIR__ . "/../../../Saklient/Cloud/Models/Model.php";
8: use \Saklient\Cloud\Models\Model;
9: require_once __DIR__ . "/../../../Saklient/Cloud/Resources/Resource.php";
10: use \Saklient\Cloud\Resources\Resource;
11: require_once __DIR__ . "/../../../Saklient/Cloud/Resources/Router.php";
12: use \Saklient\Cloud\Resources\Router;
13: require_once __DIR__ . "/../../../Saklient/Util.php";
14: use \Saklient\Util;
15: require_once __DIR__ . "/../../../Saklient/Errors/SaklientException.php";
16: use \Saklient\Errors\SaklientException;
17:
18:
19: class Model_Router extends Model {
20:
21: 22: 23: 24: 25: 26:
27: protected function _apiPath()
28: {
29: return "/internet";
30: }
31:
32: 33: 34: 35: 36: 37:
38: protected function _rootKey()
39: {
40: return "Internet";
41: }
42:
43: 44: 45: 46: 47: 48:
49: protected function _rootKeyM()
50: {
51: return "Internet";
52: }
53:
54: 55: 56: 57: 58: 59:
60: protected function _className()
61: {
62: return "Router";
63: }
64:
65: 66: 67: 68: 69: 70: 71: 72:
73: protected function _createResourceImpl($obj, $wrapped=false)
74: {
75: Util::validateArgCount(func_num_args(), 1);
76: Util::validateType($wrapped, "boolean");
77: return new Router($this->_client, $obj, $wrapped);
78: }
79:
80: 81: 82: 83: 84: 85: 86:
87: public function offset($offset)
88: {
89: Util::validateArgCount(func_num_args(), 1);
90: Util::validateType($offset, "int");
91: return $this->_offset($offset);
92: }
93:
94: 95: 96: 97: 98: 99: 100:
101: public function limit($count)
102: {
103: Util::validateArgCount(func_num_args(), 1);
104: Util::validateType($count, "int");
105: return $this->_limit($count);
106: }
107:
108: 109: 110: 111: 112: 113: 114: 115: 116:
117: public function filterBy($key, $value, $multiple=false)
118: {
119: Util::validateArgCount(func_num_args(), 2);
120: Util::validateType($key, "string");
121: Util::validateType($multiple, "boolean");
122: return $this->_filterBy($key, $value, $multiple);
123: }
124:
125: 126: 127: 128: 129: 130:
131: public function reset()
132: {
133: return $this->_reset();
134: }
135:
136: 137: 138: 139: 140: 141: 142: 143:
144: public function create()
145: {
146: return $this->_create();
147: }
148:
149: 150: 151: 152: 153: 154: 155:
156: public function getById($id)
157: {
158: Util::validateArgCount(func_num_args(), 1);
159: Util::validateType($id, "string");
160: return $this->_getById($id);
161: }
162:
163: 164: 165: 166: 167: 168:
169: public function find()
170: {
171: return $this->_find();
172: }
173:
174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184:
185: public function withNameLike($name)
186: {
187: Util::validateArgCount(func_num_args(), 1);
188: Util::validateType($name, "string");
189: return $this->_withNameLike($name);
190: }
191:
192: 193: 194: 195: 196: 197: 198: 199: 200: 201:
202: public function withTag($tag)
203: {
204: Util::validateArgCount(func_num_args(), 1);
205: Util::validateType($tag, "string");
206: return $this->_withTag($tag);
207: }
208:
209: 210: 211: 212: 213: 214: 215: 216:
217: public function withTags($tags)
218: {
219: Util::validateArgCount(func_num_args(), 1);
220: Util::validateType($tags, "\\ArrayObject");
221: return $this->_withTags($tags);
222: }
223:
224: 225: 226: 227: 228: 229: 230: 231:
232: public function withTagDnf($dnf)
233: {
234: Util::validateArgCount(func_num_args(), 1);
235: Util::validateType($dnf, "\\ArrayObject");
236: return $this->_withTagDnf($dnf);
237: }
238:
239: 240: 241: 242: 243: 244: 245: 246:
247: public function sortByName($reverse=false)
248: {
249: Util::validateType($reverse, "boolean");
250: return $this->_sortByName($reverse);
251: }
252:
253: 254: 255: 256: 257:
258: public function __construct(\Saklient\Cloud\Client $client)
259: {
260: parent::__construct($client);
261: Util::validateArgCount(func_num_args(), 1);
262: Util::validateType($client, "\\Saklient\\Cloud\\Client");
263: }
264:
265: 266: 267: 268: 269: 270: 271:
272: public function withBandWidthMbps($mbps)
273: {
274: Util::validateArgCount(func_num_args(), 1);
275: Util::validateType($mbps, "int");
276: $this->_filterBy("BandWidthMbps", new \ArrayObject([$mbps]));
277: return $this;
278: }
279:
280:
281:
282: }
283:
284: