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:  * リージョン情報。
 18:  * 
 19:  * @property-read string $id ID 
 20:  * @property string $name 名前 
 21:  * @property string $description 説明 
 22:  */
 23: class Region extends Resource {
 24:     
 25:     /**
 26:      * ID
 27:      * 
 28:      * @access protected
 29:      * @ignore
 30:      * @var string
 31:      */
 32:     protected $m_id;
 33:     
 34:     /**
 35:      * 名前
 36:      * 
 37:      * @access protected
 38:      * @ignore
 39:      * @var string
 40:      */
 41:     protected $m_name;
 42:     
 43:     /**
 44:      * 説明
 45:      * 
 46:      * @access protected
 47:      * @ignore
 48:      * @var string
 49:      */
 50:     protected $m_description;
 51:     
 52:     /**
 53:      * @private
 54:      * @access protected
 55:      * @ignore
 56:      * @return string
 57:      */
 58:     protected function _apiPath()
 59:     {
 60:         return "/region";
 61:     }
 62:     
 63:     /**
 64:      * @private
 65:      * @access protected
 66:      * @ignore
 67:      * @return string
 68:      */
 69:     protected function _rootKey()
 70:     {
 71:         return "Region";
 72:     }
 73:     
 74:     /**
 75:      * @private
 76:      * @access protected
 77:      * @ignore
 78:      * @return string
 79:      */
 80:     protected function _rootKeyM()
 81:     {
 82:         return "Regions";
 83:     }
 84:     
 85:     /**
 86:      * @private
 87:      * @access public
 88:      * @ignore
 89:      * @return string
 90:      */
 91:     public function _className()
 92:     {
 93:         return "Region";
 94:     }
 95:     
 96:     /**
 97:      * @private
 98:      * @access public
 99:      * @ignore
100:      * @return string
101:      */
102:     public function _id()
103:     {
104:         return $this->get_id();
105:     }
106:     
107:     /**
108:      * @ignore
109:      * @access public
110:      * @param \Saklient\Cloud\Client $client
111:      * @param mixed $obj
112:      * @param boolean $wrapped=false
113:      */
114:     public function __construct(\Saklient\Cloud\Client $client, $obj, $wrapped=false)
115:     {
116:         parent::__construct($client);
117:         Util::validateArgCount(func_num_args(), 2);
118:         Util::validateType($client, "\\Saklient\\Cloud\\Client");
119:         Util::validateType($wrapped, "boolean");
120:         $this->apiDeserialize($obj, $wrapped);
121:     }
122:     
123:     /**
124:      * @access private
125:      * @ignore
126:      * @var boolean
127:      */
128:     private $n_id = false;
129:     
130:     /**
131:      * (This method is generated in Translator_default#buildImpl)
132:      * 
133:      * @access private
134:      * @ignore
135:      * @return string
136:      */
137:     private function get_id()
138:     {
139:         return $this->m_id;
140:     }
141:     
142:     
143:     
144:     /**
145:      * @access private
146:      * @ignore
147:      * @var boolean
148:      */
149:     private $n_name = false;
150:     
151:     /**
152:      * (This method is generated in Translator_default#buildImpl)
153:      * 
154:      * @access private
155:      * @ignore
156:      * @return string
157:      */
158:     private function get_name()
159:     {
160:         return $this->m_name;
161:     }
162:     
163:     /**
164:      * (This method is generated in Translator_default#buildImpl)
165:      * 
166:      * @access private
167:      * @ignore
168:      * @param string $v
169:      * @return string
170:      */
171:     private function set_name($v)
172:     {
173:         Util::validateArgCount(func_num_args(), 1);
174:         Util::validateType($v, "string");
175:         $this->m_name = $v;
176:         $this->n_name = true;
177:         return $this->m_name;
178:     }
179:     
180:     
181:     
182:     /**
183:      * @access private
184:      * @ignore
185:      * @var boolean
186:      */
187:     private $n_description = false;
188:     
189:     /**
190:      * (This method is generated in Translator_default#buildImpl)
191:      * 
192:      * @access private
193:      * @ignore
194:      * @return string
195:      */
196:     private function get_description()
197:     {
198:         return $this->m_description;
199:     }
200:     
201:     /**
202:      * (This method is generated in Translator_default#buildImpl)
203:      * 
204:      * @access private
205:      * @ignore
206:      * @param string $v
207:      * @return string
208:      */
209:     private function set_description($v)
210:     {
211:         Util::validateArgCount(func_num_args(), 1);
212:         Util::validateType($v, "string");
213:         $this->m_description = $v;
214:         $this->n_description = true;
215:         return $this->m_description;
216:     }
217:     
218:     
219:     
220:     /**
221:      * (This method is generated in Translator_default#buildImpl)
222:      * 
223:      * @access protected
224:      * @ignore
225:      * @param mixed $r
226:      */
227:     protected function apiDeserializeImpl($r)
228:     {
229:         Util::validateArgCount(func_num_args(), 1);
230:         $this->isNew = $r == null;
231:         if ($this->isNew) {
232:             $r = (object)[];
233:         }
234:         $this->isIncomplete = false;
235:         if (Util::existsPath($r, "ID")) {
236:             $this->m_id = Util::getByPath($r, "ID") == null ? null : "" . Util::getByPath($r, "ID");
237:         }
238:         else {
239:             $this->m_id = null;
240:             $this->isIncomplete = true;
241:         }
242:         $this->n_id = false;
243:         if (Util::existsPath($r, "Name")) {
244:             $this->m_name = Util::getByPath($r, "Name") == null ? null : "" . Util::getByPath($r, "Name");
245:         }
246:         else {
247:             $this->m_name = null;
248:             $this->isIncomplete = true;
249:         }
250:         $this->n_name = false;
251:         if (Util::existsPath($r, "Description")) {
252:             $this->m_description = Util::getByPath($r, "Description") == null ? null : "" . Util::getByPath($r, "Description");
253:         }
254:         else {
255:             $this->m_description = null;
256:             $this->isIncomplete = true;
257:         }
258:         $this->n_description = false;
259:     }
260:     
261:     /**
262:      * @ignore
263:      * @access protected
264:      * @param boolean $withClean=false
265:      * @return mixed
266:      */
267:     protected function apiSerializeImpl($withClean=false)
268:     {
269:         Util::validateType($withClean, "boolean");
270:         $missing = new \ArrayObject([]);
271:         $ret = (object)[];
272:         if ($withClean || $this->n_id) {
273:             Util::setByPath($ret, "ID", $this->m_id);
274:         }
275:         if ($withClean || $this->n_name) {
276:             Util::setByPath($ret, "Name", $this->m_name);
277:         }
278:         else {
279:             if ($this->isNew) {
280:                 $missing->append("name");
281:             }
282:         }
283:         if ($withClean || $this->n_description) {
284:             Util::setByPath($ret, "Description", $this->m_description);
285:         }
286:         if ($missing->count() > 0) {
287:             throw new SaklientException("required_field", "Required fields must be set before the Region creation: " . implode(", ", (array)($missing)));
288:         }
289:         return $ret;
290:     }
291:     
292:     /**
293:      * @ignore
294:      */
295:     public function __get($key) {
296:         switch ($key) {
297:             case "id": return $this->get_id();
298:             case "name": return $this->get_name();
299:             case "description": return $this->get_description();
300:             default: return parent::__get($key);
301:         }
302:     }
303:     
304:     /**
305:      * @ignore
306:      */
307:     public function __set($key, $v) {
308:         switch ($key) {
309:             case "name": return $this->set_name($v);
310:             case "description": return $this->set_description($v);
311:             default: return parent::__set($key, $v);
312:         }
313:     }
314: 
315: }
316: 
317: 
API documentation generated by ApiGen 2.8.0