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/Enums/EScope.php";
 12: use \Saklient\Cloud\Enums\EScope;
 13: require_once __DIR__ . "/../../../Saklient/Util.php";
 14: use \Saklient\Util;
 15: 
 16: /**
 17:  * アイコンの実体1つに対応し、属性の取得や操作を行うためのクラス。
 18:  * 
 19:  * @property-read string $id ID 
 20:  * @property-read string $scope スコープ {@link \Saklient\Cloud\Enums\EScope} 
 21:  * @property string $name 名前 
 22:  * @property-read string $url URL 
 23:  */
 24: class Icon extends Resource {
 25:     
 26:     /**
 27:      * ID
 28:      * 
 29:      * @access protected
 30:      * @ignore
 31:      * @var string
 32:      */
 33:     protected $m_id;
 34:     
 35:     /**
 36:      * スコープ {@link \Saklient\Cloud\Enums\EScope}
 37:      * 
 38:      * @access protected
 39:      * @ignore
 40:      * @var string
 41:      */
 42:     protected $m_scope;
 43:     
 44:     /**
 45:      * 名前
 46:      * 
 47:      * @access protected
 48:      * @ignore
 49:      * @var string
 50:      */
 51:     protected $m_name;
 52:     
 53:     /**
 54:      * URL
 55:      * 
 56:      * @access protected
 57:      * @ignore
 58:      * @var string
 59:      */
 60:     protected $m_url;
 61:     
 62:     /**
 63:      * @private
 64:      * @access protected
 65:      * @ignore
 66:      * @return string
 67:      */
 68:     protected function _apiPath()
 69:     {
 70:         return "/icon";
 71:     }
 72:     
 73:     /**
 74:      * @private
 75:      * @access protected
 76:      * @ignore
 77:      * @return string
 78:      */
 79:     protected function _rootKey()
 80:     {
 81:         return "Icon";
 82:     }
 83:     
 84:     /**
 85:      * @private
 86:      * @access protected
 87:      * @ignore
 88:      * @return string
 89:      */
 90:     protected function _rootKeyM()
 91:     {
 92:         return "Icons";
 93:     }
 94:     
 95:     /**
 96:      * @private
 97:      * @access public
 98:      * @ignore
 99:      * @return string
100:      */
101:     public function _className()
102:     {
103:         return "Icon";
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\Icon this
122:      */
123:     public function save()
124:     {
125:         return $this->_save();
126:     }
127:     
128:     /**
129:      * 最新のリソース情報を再取得します。
130:      * 
131:      * @access public
132:      * @return \Saklient\Cloud\Resources\Icon 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_scope = 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_scope()
191:     {
192:         return $this->m_scope;
193:     }
194:     
195:     
196:     
197:     /**
198:      * @access private
199:      * @ignore
200:      * @var boolean
201:      */
202:     private $n_name = false;
203:     
204:     /**
205:      * (This method is generated in Translator_default#buildImpl)
206:      * 
207:      * @access private
208:      * @ignore
209:      * @return string
210:      */
211:     private function get_name()
212:     {
213:         return $this->m_name;
214:     }
215:     
216:     /**
217:      * (This method is generated in Translator_default#buildImpl)
218:      * 
219:      * @access private
220:      * @ignore
221:      * @param string $v
222:      * @return string
223:      */
224:     private function set_name($v)
225:     {
226:         Util::validateArgCount(func_num_args(), 1);
227:         Util::validateType($v, "string");
228:         $this->m_name = $v;
229:         $this->n_name = true;
230:         return $this->m_name;
231:     }
232:     
233:     
234:     
235:     /**
236:      * @access private
237:      * @ignore
238:      * @var boolean
239:      */
240:     private $n_url = false;
241:     
242:     /**
243:      * (This method is generated in Translator_default#buildImpl)
244:      * 
245:      * @access private
246:      * @ignore
247:      * @return string
248:      */
249:     private function get_url()
250:     {
251:         return $this->m_url;
252:     }
253:     
254:     
255:     
256:     /**
257:      * (This method is generated in Translator_default#buildImpl)
258:      * 
259:      * @access protected
260:      * @ignore
261:      * @param mixed $r
262:      */
263:     protected function apiDeserializeImpl($r)
264:     {
265:         Util::validateArgCount(func_num_args(), 1);
266:         $this->isNew = $r == null;
267:         if ($this->isNew) {
268:             $r = (object)[];
269:         }
270:         $this->isIncomplete = false;
271:         if (Util::existsPath($r, "ID")) {
272:             $this->m_id = Util::getByPath($r, "ID") == null ? null : "" . Util::getByPath($r, "ID");
273:         }
274:         else {
275:             $this->m_id = null;
276:             $this->isIncomplete = true;
277:         }
278:         $this->n_id = false;
279:         if (Util::existsPath($r, "Scope")) {
280:             $this->m_scope = Util::getByPath($r, "Scope") == null ? null : "" . Util::getByPath($r, "Scope");
281:         }
282:         else {
283:             $this->m_scope = null;
284:             $this->isIncomplete = true;
285:         }
286:         $this->n_scope = false;
287:         if (Util::existsPath($r, "Name")) {
288:             $this->m_name = Util::getByPath($r, "Name") == null ? null : "" . Util::getByPath($r, "Name");
289:         }
290:         else {
291:             $this->m_name = null;
292:             $this->isIncomplete = true;
293:         }
294:         $this->n_name = false;
295:         if (Util::existsPath($r, "URL")) {
296:             $this->m_url = Util::getByPath($r, "URL") == null ? null : "" . Util::getByPath($r, "URL");
297:         }
298:         else {
299:             $this->m_url = null;
300:             $this->isIncomplete = true;
301:         }
302:         $this->n_url = false;
303:     }
304:     
305:     /**
306:      * @ignore
307:      * @access protected
308:      * @param boolean $withClean=false
309:      * @return mixed
310:      */
311:     protected function apiSerializeImpl($withClean=false)
312:     {
313:         Util::validateType($withClean, "boolean");
314:         $missing = new \ArrayObject([]);
315:         $ret = (object)[];
316:         if ($withClean || $this->n_id) {
317:             Util::setByPath($ret, "ID", $this->m_id);
318:         }
319:         if ($withClean || $this->n_scope) {
320:             Util::setByPath($ret, "Scope", $this->m_scope);
321:         }
322:         if ($withClean || $this->n_name) {
323:             Util::setByPath($ret, "Name", $this->m_name);
324:         }
325:         else {
326:             if ($this->isNew) {
327:                 $missing->append("name");
328:             }
329:         }
330:         if ($withClean || $this->n_url) {
331:             Util::setByPath($ret, "URL", $this->m_url);
332:         }
333:         if ($missing->count() > 0) {
334:             throw new SaklientException("required_field", "Required fields must be set before the Icon creation: " . implode(", ", (array)($missing)));
335:         }
336:         return $ret;
337:     }
338:     
339:     /**
340:      * @ignore
341:      */
342:     public function __get($key) {
343:         switch ($key) {
344:             case "id": return $this->get_id();
345:             case "scope": return $this->get_scope();
346:             case "name": return $this->get_name();
347:             case "url": return $this->get_url();
348:             default: return parent::__get($key);
349:         }
350:     }
351:     
352:     /**
353:      * @ignore
354:      */
355:     public function __set($key, $v) {
356:         switch ($key) {
357:             case "name": return $this->set_name($v);
358:             default: return parent::__set($key, $v);
359:         }
360:     }
361: 
362: }
363: 
364: 
API documentation generated by ApiGen 2.8.0