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/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/Util.php";
 10: use \Saklient\Util;
 11: require_once __DIR__ . "/../../../Saklient/Errors/SaklientException.php";
 12: use \Saklient\Errors\SaklientException;
 13: 
 14: /**
 15:  * サーバプラン情報の1レコードに対応するクラス。
 16:  * 
 17:  * @property-read int $memoryGib
 18:  * @property-read string $id ID 
 19:  * @property-read string $name 名前 
 20:  * @property-read int $cpu 仮想コア数 
 21:  * @property-read int $memoryMib メモリ容量[MiB] 
 22:  * @property-read string $serviceClass サービスクラス 
 23:  */
 24: class ServerPlan 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 int
 50:      */
 51:     protected $m_cpu;
 52:     
 53:     /**
 54:      * メモリ容量[MiB]
 55:      * 
 56:      * @access protected
 57:      * @ignore
 58:      * @var int
 59:      */
 60:     protected $m_memoryMib;
 61:     
 62:     /**
 63:      * サービスクラス
 64:      * 
 65:      * @access protected
 66:      * @ignore
 67:      * @var string
 68:      */
 69:     protected $m_serviceClass;
 70:     
 71:     /**
 72:      * @private
 73:      * @access protected
 74:      * @ignore
 75:      * @return string
 76:      */
 77:     protected function _apiPath()
 78:     {
 79:         return "/product/server";
 80:     }
 81:     
 82:     /**
 83:      * @private
 84:      * @access protected
 85:      * @ignore
 86:      * @return string
 87:      */
 88:     protected function _rootKey()
 89:     {
 90:         return "ServerPlan";
 91:     }
 92:     
 93:     /**
 94:      * @private
 95:      * @access protected
 96:      * @ignore
 97:      * @return string
 98:      */
 99:     protected function _rootKeyM()
100:     {
101:         return "ServerPlans";
102:     }
103:     
104:     /**
105:      * @private
106:      * @access public
107:      * @ignore
108:      * @return string
109:      */
110:     public function _className()
111:     {
112:         return "ServerPlan";
113:     }
114:     
115:     /**
116:      * @private
117:      * @access public
118:      * @ignore
119:      * @return string
120:      */
121:     public function _id()
122:     {
123:         return $this->get_id();
124:     }
125:     
126:     /**
127:      * @ignore
128:      * @access public
129:      * @param \Saklient\Cloud\Client $client
130:      * @param mixed $obj
131:      * @param boolean $wrapped=false
132:      */
133:     public function __construct(\Saklient\Cloud\Client $client, $obj, $wrapped=false)
134:     {
135:         parent::__construct($client);
136:         Util::validateArgCount(func_num_args(), 2);
137:         Util::validateType($client, "\\Saklient\\Cloud\\Client");
138:         Util::validateType($wrapped, "boolean");
139:         $this->apiDeserialize($obj, $wrapped);
140:     }
141:     
142:     /**
143:      * @access protected
144:      * @ignore
145:      * @return int
146:      */
147:     protected function get_memoryGib()
148:     {
149:         $memoryMib = $this->get_memoryMib();
150:         return $memoryMib == null ? null : $memoryMib >> 10;
151:     }
152:     
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:     
197:     /**
198:      * @access private
199:      * @ignore
200:      * @var boolean
201:      */
202:     private $n_cpu = false;
203:     
204:     /**
205:      * (This method is generated in Translator_default#buildImpl)
206:      * 
207:      * @access private
208:      * @ignore
209:      * @return int
210:      */
211:     private function get_cpu()
212:     {
213:         return $this->m_cpu;
214:     }
215:     
216:     
217:     
218:     /**
219:      * @access private
220:      * @ignore
221:      * @var boolean
222:      */
223:     private $n_memoryMib = false;
224:     
225:     /**
226:      * (This method is generated in Translator_default#buildImpl)
227:      * 
228:      * @access private
229:      * @ignore
230:      * @return int
231:      */
232:     private function get_memoryMib()
233:     {
234:         return $this->m_memoryMib;
235:     }
236:     
237:     
238:     
239:     /**
240:      * @access private
241:      * @ignore
242:      * @var boolean
243:      */
244:     private $n_serviceClass = false;
245:     
246:     /**
247:      * (This method is generated in Translator_default#buildImpl)
248:      * 
249:      * @access private
250:      * @ignore
251:      * @return string
252:      */
253:     private function get_serviceClass()
254:     {
255:         return $this->m_serviceClass;
256:     }
257:     
258:     
259:     
260:     /**
261:      * (This method is generated in Translator_default#buildImpl)
262:      * 
263:      * @access protected
264:      * @ignore
265:      * @param mixed $r
266:      */
267:     protected function apiDeserializeImpl($r)
268:     {
269:         Util::validateArgCount(func_num_args(), 1);
270:         $this->isNew = $r == null;
271:         if ($this->isNew) {
272:             $r = (object)[];
273:         }
274:         $this->isIncomplete = false;
275:         if (Util::existsPath($r, "ID")) {
276:             $this->m_id = Util::getByPath($r, "ID") == null ? null : "" . Util::getByPath($r, "ID");
277:         }
278:         else {
279:             $this->m_id = null;
280:             $this->isIncomplete = true;
281:         }
282:         $this->n_id = false;
283:         if (Util::existsPath($r, "Name")) {
284:             $this->m_name = Util::getByPath($r, "Name") == null ? null : "" . Util::getByPath($r, "Name");
285:         }
286:         else {
287:             $this->m_name = null;
288:             $this->isIncomplete = true;
289:         }
290:         $this->n_name = false;
291:         if (Util::existsPath($r, "CPU")) {
292:             $this->m_cpu = Util::getByPath($r, "CPU") == null ? null : intval("" . Util::getByPath($r, "CPU"));
293:         }
294:         else {
295:             $this->m_cpu = null;
296:             $this->isIncomplete = true;
297:         }
298:         $this->n_cpu = false;
299:         if (Util::existsPath($r, "MemoryMB")) {
300:             $this->m_memoryMib = Util::getByPath($r, "MemoryMB") == null ? null : intval("" . Util::getByPath($r, "MemoryMB"));
301:         }
302:         else {
303:             $this->m_memoryMib = null;
304:             $this->isIncomplete = true;
305:         }
306:         $this->n_memoryMib = false;
307:         if (Util::existsPath($r, "ServiceClass")) {
308:             $this->m_serviceClass = Util::getByPath($r, "ServiceClass") == null ? null : "" . Util::getByPath($r, "ServiceClass");
309:         }
310:         else {
311:             $this->m_serviceClass = null;
312:             $this->isIncomplete = true;
313:         }
314:         $this->n_serviceClass = false;
315:     }
316:     
317:     /**
318:      * @ignore
319:      * @access protected
320:      * @param boolean $withClean=false
321:      * @return mixed
322:      */
323:     protected function apiSerializeImpl($withClean=false)
324:     {
325:         Util::validateType($withClean, "boolean");
326:         $ret = (object)[];
327:         if ($withClean || $this->n_id) {
328:             Util::setByPath($ret, "ID", $this->m_id);
329:         }
330:         if ($withClean || $this->n_name) {
331:             Util::setByPath($ret, "Name", $this->m_name);
332:         }
333:         if ($withClean || $this->n_cpu) {
334:             Util::setByPath($ret, "CPU", $this->m_cpu);
335:         }
336:         if ($withClean || $this->n_memoryMib) {
337:             Util::setByPath($ret, "MemoryMB", $this->m_memoryMib);
338:         }
339:         if ($withClean || $this->n_serviceClass) {
340:             Util::setByPath($ret, "ServiceClass", $this->m_serviceClass);
341:         }
342:         return $ret;
343:     }
344:     
345:     /**
346:      * @ignore
347:      */
348:     public function __get($key) {
349:         switch ($key) {
350:             case "memoryGib": return $this->get_memoryGib();
351:             case "id": return $this->get_id();
352:             case "name": return $this->get_name();
353:             case "cpu": return $this->get_cpu();
354:             case "memoryMib": return $this->get_memoryMib();
355:             case "serviceClass": return $this->get_serviceClass();
356:             default: return parent::__get($key);
357:         }
358:     }
359: 
360: }
361: 
362: 
API documentation generated by ApiGen 2.8.0