Overview

Namespaces

  • PHP
  • Saklient
    • Cloud
      • Enums
      • Errors
      • Models
      • Resources
    • Errors

Classes

  • Activity
  • Appliance
  • Archive
  • Bridge
  • Disk
  • DiskActivity
  • DiskConfig
  • DiskPlan
  • FtpInfo
  • Icon
  • Iface
  • IfaceActivity
  • Ipv4Net
  • Ipv4Range
  • Ipv6Net
  • IsoImage
  • LbServer
  • LbVirtualIp
  • License
  • LicenseInfo
  • LoadBalancer
  • Region
  • Router
  • RouterActivity
  • RouterPlan
  • Script
  • Server
  • ServerActivity
  • ServerInstance
  • ServerPlan
  • Swytch
  • VpcRouter
  • Overview
  • Namespace
  • Class
  • Tree
  1: <?php
  2: 
  3: namespace Saklient\Cloud\Resources;
  4: 
  5: require_once __DIR__ . "/../../../Saklient/Errors/SaklientException.php";
  6: use \Saklient\Errors\SaklientException;
  7: require_once __DIR__ . "/../../../Saklient/Cloud/Client.php";
  8: use \Saklient\Cloud\Client;
  9: require_once __DIR__ . "/../../../Saklient/Cloud/Resources/Resource.php";
 10: use \Saklient\Cloud\Resources\Resource;
 11: require_once __DIR__ . "/../../../Saklient/Cloud/Resources/Region.php";
 12: use \Saklient\Cloud\Resources\Region;
 13: require_once __DIR__ . "/../../../Saklient/Util.php";
 14: use \Saklient\Util;
 15: 
 16: /**
 17:  * ブリッジの実体1つに対応し、属性の取得や操作を行うためのクラス。
 18:  * 
 19:  * @property-read string $id ID 
 20:  * @property string $name 名前 
 21:  * @property string $description 説明 
 22:  * @property \Saklient\Cloud\Resources\Region $region リージョン 
 23:  */
 24: class Bridge extends Resource {
 25:     
 26:     /**
 27:      * ID
 28:      * 
 29:      * @access protected
 30:      * @ignore
 31:      * @var string
 32:      */
 33:     protected $m_id;
 34:     
 35:     /**
 36:      * 名前
 37:      * 
 38:      * @access protected
 39:      * @ignore
 40:      * @var string
 41:      */
 42:     protected $m_name;
 43:     
 44:     /**
 45:      * 説明
 46:      * 
 47:      * @access protected
 48:      * @ignore
 49:      * @var string
 50:      */
 51:     protected $m_description;
 52:     
 53:     /**
 54:      * リージョン
 55:      * 
 56:      * @access protected
 57:      * @ignore
 58:      * @var Region
 59:      */
 60:     protected $m_region;
 61:     
 62:     /**
 63:      * @private
 64:      * @access protected
 65:      * @ignore
 66:      * @return string
 67:      */
 68:     protected function _apiPath()
 69:     {
 70:         return "/bridge";
 71:     }
 72:     
 73:     /**
 74:      * @private
 75:      * @access protected
 76:      * @ignore
 77:      * @return string
 78:      */
 79:     protected function _rootKey()
 80:     {
 81:         return "Bridge";
 82:     }
 83:     
 84:     /**
 85:      * @private
 86:      * @access protected
 87:      * @ignore
 88:      * @return string
 89:      */
 90:     protected function _rootKeyM()
 91:     {
 92:         return "Bridges";
 93:     }
 94:     
 95:     /**
 96:      * @private
 97:      * @access public
 98:      * @ignore
 99:      * @return string
100:      */
101:     public function _className()
102:     {
103:         return "Bridge";
104:     }
105:     
106:     /**
107:      * @private
108:      * @access public
109:      * @ignore
110:      * @return string
111:      */
112:     public function _id()
113:     {
114:         return $this->get_id();
115:     }
116:     
117:     /**
118:      * このローカルオブジェクトに現在設定されているリソース情報をAPIに送信し、新規作成または上書き保存します。
119:      * 
120:      * @access public
121:      * @return \Saklient\Cloud\Resources\Bridge this
122:      */
123:     public function save()
124:     {
125:         return $this->_save();
126:     }
127:     
128:     /**
129:      * 最新のリソース情報を再取得します。
130:      * 
131:      * @access public
132:      * @return \Saklient\Cloud\Resources\Bridge this
133:      */
134:     public function reload()
135:     {
136:         return $this->_reload();
137:     }
138:     
139:     /**
140:      * @ignore
141:      * @access public
142:      * @param \Saklient\Cloud\Client $client
143:      * @param mixed $obj
144:      * @param boolean $wrapped=false
145:      */
146:     public function __construct(\Saklient\Cloud\Client $client, $obj, $wrapped=false)
147:     {
148:         parent::__construct($client);
149:         Util::validateArgCount(func_num_args(), 2);
150:         Util::validateType($client, "\\Saklient\\Cloud\\Client");
151:         Util::validateType($wrapped, "boolean");
152:         $this->apiDeserialize($obj, $wrapped);
153:     }
154:     
155:     /**
156:      * @access private
157:      * @ignore
158:      * @var boolean
159:      */
160:     private $n_id = false;
161:     
162:     /**
163:      * (This method is generated in Translator_default#buildImpl)
164:      * 
165:      * @access private
166:      * @ignore
167:      * @return string
168:      */
169:     private function get_id()
170:     {
171:         return $this->m_id;
172:     }
173:     
174:     
175:     
176:     /**
177:      * @access private
178:      * @ignore
179:      * @var boolean
180:      */
181:     private $n_name = false;
182:     
183:     /**
184:      * (This method is generated in Translator_default#buildImpl)
185:      * 
186:      * @access private
187:      * @ignore
188:      * @return string
189:      */
190:     private function get_name()
191:     {
192:         return $this->m_name;
193:     }
194:     
195:     /**
196:      * (This method is generated in Translator_default#buildImpl)
197:      * 
198:      * @access private
199:      * @ignore
200:      * @param string $v
201:      * @return string
202:      */
203:     private function set_name($v)
204:     {
205:         Util::validateArgCount(func_num_args(), 1);
206:         Util::validateType($v, "string");
207:         $this->m_name = $v;
208:         $this->n_name = true;
209:         return $this->m_name;
210:     }
211:     
212:     
213:     
214:     /**
215:      * @access private
216:      * @ignore
217:      * @var boolean
218:      */
219:     private $n_description = false;
220:     
221:     /**
222:      * (This method is generated in Translator_default#buildImpl)
223:      * 
224:      * @access private
225:      * @ignore
226:      * @return string
227:      */
228:     private function get_description()
229:     {
230:         return $this->m_description;
231:     }
232:     
233:     /**
234:      * (This method is generated in Translator_default#buildImpl)
235:      * 
236:      * @access private
237:      * @ignore
238:      * @param string $v
239:      * @return string
240:      */
241:     private function set_description($v)
242:     {
243:         Util::validateArgCount(func_num_args(), 1);
244:         Util::validateType($v, "string");
245:         $this->m_description = $v;
246:         $this->n_description = true;
247:         return $this->m_description;
248:     }
249:     
250:     
251:     
252:     /**
253:      * @access private
254:      * @ignore
255:      * @var boolean
256:      */
257:     private $n_region = false;
258:     
259:     /**
260:      * (This method is generated in Translator_default#buildImpl)
261:      * 
262:      * @access private
263:      * @ignore
264:      * @return \Saklient\Cloud\Resources\Region
265:      */
266:     private function get_region()
267:     {
268:         return $this->m_region;
269:     }
270:     
271:     /**
272:      * (This method is generated in Translator_default#buildImpl)
273:      * 
274:      * @access private
275:      * @ignore
276:      * @param \Saklient\Cloud\Resources\Region|null $v
277:      * @return \Saklient\Cloud\Resources\Region
278:      */
279:     private function set_region(\Saklient\Cloud\Resources\Region $v=null)
280:     {
281:         Util::validateArgCount(func_num_args(), 1);
282:         Util::validateType($v, "\\Saklient\\Cloud\\Resources\\Region");
283:         if (!$this->isNew) {
284:             throw new SaklientException("immutable_field", "Immutable fields cannot be modified after the resource creation: " . "Saklient\\Cloud\\Resources\\Bridge#region");
285:         }
286:         $this->m_region = $v;
287:         $this->n_region = true;
288:         return $this->m_region;
289:     }
290:     
291:     
292:     
293:     /**
294:      * (This method is generated in Translator_default#buildImpl)
295:      * 
296:      * @access protected
297:      * @ignore
298:      * @param mixed $r
299:      */
300:     protected function apiDeserializeImpl($r)
301:     {
302:         Util::validateArgCount(func_num_args(), 1);
303:         $this->isNew = $r == null;
304:         if ($this->isNew) {
305:             $r = (object)[];
306:         }
307:         $this->isIncomplete = false;
308:         if (Util::existsPath($r, "ID")) {
309:             $this->m_id = Util::getByPath($r, "ID") == null ? null : "" . Util::getByPath($r, "ID");
310:         }
311:         else {
312:             $this->m_id = null;
313:             $this->isIncomplete = true;
314:         }
315:         $this->n_id = false;
316:         if (Util::existsPath($r, "Name")) {
317:             $this->m_name = Util::getByPath($r, "Name") == null ? null : "" . Util::getByPath($r, "Name");
318:         }
319:         else {
320:             $this->m_name = null;
321:             $this->isIncomplete = true;
322:         }
323:         $this->n_name = false;
324:         if (Util::existsPath($r, "Description")) {
325:             $this->m_description = Util::getByPath($r, "Description") == null ? null : "" . Util::getByPath($r, "Description");
326:         }
327:         else {
328:             $this->m_description = null;
329:             $this->isIncomplete = true;
330:         }
331:         $this->n_description = false;
332:         if (Util::existsPath($r, "Region")) {
333:             $this->m_region = Util::getByPath($r, "Region") == null ? null : new Region($this->_client, Util::getByPath($r, "Region"));
334:         }
335:         else {
336:             $this->m_region = null;
337:             $this->isIncomplete = true;
338:         }
339:         $this->n_region = false;
340:     }
341:     
342:     /**
343:      * @ignore
344:      * @access protected
345:      * @param boolean $withClean=false
346:      * @return mixed
347:      */
348:     protected function apiSerializeImpl($withClean=false)
349:     {
350:         Util::validateType($withClean, "boolean");
351:         $missing = new \ArrayObject([]);
352:         $ret = (object)[];
353:         if ($withClean || $this->n_id) {
354:             Util::setByPath($ret, "ID", $this->m_id);
355:         }
356:         if ($withClean || $this->n_name) {
357:             Util::setByPath($ret, "Name", $this->m_name);
358:         }
359:         else {
360:             if ($this->isNew) {
361:                 $missing->append("name");
362:             }
363:         }
364:         if ($withClean || $this->n_description) {
365:             Util::setByPath($ret, "Description", $this->m_description);
366:         }
367:         if ($withClean || $this->n_region) {
368:             Util::setByPath($ret, "Region", $withClean ? ($this->m_region == null ? null : $this->m_region->apiSerialize($withClean)) : ($this->m_region == null ? (object)['ID' => "0"] : $this->m_region->apiSerializeID()));
369:         }
370:         else {
371:             if ($this->isNew) {
372:                 $missing->append("region");
373:             }
374:         }
375:         if ($missing->count() > 0) {
376:             throw new SaklientException("required_field", "Required fields must be set before the Bridge creation: " . implode(", ", (array)($missing)));
377:         }
378:         return $ret;
379:     }
380:     
381:     /**
382:      * @ignore
383:      */
384:     public function __get($key) {
385:         switch ($key) {
386:             case "id": return $this->get_id();
387:             case "name": return $this->get_name();
388:             case "description": return $this->get_description();
389:             case "region": return $this->get_region();
390:             default: return parent::__get($key);
391:         }
392:     }
393:     
394:     /**
395:      * @ignore
396:      */
397:     public function __set($key, $v) {
398:         switch ($key) {
399:             case "name": return $this->set_name($v);
400:             case "description": return $this->set_description($v);
401:             case "region": return $this->set_region($v);
402:             default: return parent::__set($key, $v);
403:         }
404:     }
405: 
406: }
407: 
408: 
API documentation generated by ApiGen 2.8.0