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/Util.php";
 12: use \Saklient\Util;
 13: 
 14: /**
 15:  * ライセンス種別情報。
 16:  * 
 17:  * @property-read string $id ID 
 18:  * @property string $name 名前 
 19:  */
 20: class LicenseInfo extends Resource {
 21:     
 22:     /**
 23:      * ID
 24:      * 
 25:      * @access protected
 26:      * @ignore
 27:      * @var string
 28:      */
 29:     protected $m_id;
 30:     
 31:     /**
 32:      * 名前
 33:      * 
 34:      * @access protected
 35:      * @ignore
 36:      * @var string
 37:      */
 38:     protected $m_name;
 39:     
 40:     /**
 41:      * @private
 42:      * @access protected
 43:      * @ignore
 44:      * @return string
 45:      */
 46:     protected function _apiPath()
 47:     {
 48:         return "/product/license";
 49:     }
 50:     
 51:     /**
 52:      * @private
 53:      * @access protected
 54:      * @ignore
 55:      * @return string
 56:      */
 57:     protected function _rootKey()
 58:     {
 59:         return "LicenseInfo";
 60:     }
 61:     
 62:     /**
 63:      * @private
 64:      * @access protected
 65:      * @ignore
 66:      * @return string
 67:      */
 68:     protected function _rootKeyM()
 69:     {
 70:         return "LicenseInfo";
 71:     }
 72:     
 73:     /**
 74:      * @private
 75:      * @access public
 76:      * @ignore
 77:      * @return string
 78:      */
 79:     public function _className()
 80:     {
 81:         return "License";
 82:     }
 83:     
 84:     /**
 85:      * @private
 86:      * @access public
 87:      * @ignore
 88:      * @return string
 89:      */
 90:     public function _id()
 91:     {
 92:         return $this->get_id();
 93:     }
 94:     
 95:     /**
 96:      * @ignore
 97:      * @access public
 98:      * @param \Saklient\Cloud\Client $client
 99:      * @param mixed $obj
100:      * @param boolean $wrapped=false
101:      */
102:     public function __construct(\Saklient\Cloud\Client $client, $obj, $wrapped=false)
103:     {
104:         parent::__construct($client);
105:         Util::validateArgCount(func_num_args(), 2);
106:         Util::validateType($client, "\\Saklient\\Cloud\\Client");
107:         Util::validateType($wrapped, "boolean");
108:         $this->apiDeserialize($obj, $wrapped);
109:     }
110:     
111:     /**
112:      * @access private
113:      * @ignore
114:      * @var boolean
115:      */
116:     private $n_id = false;
117:     
118:     /**
119:      * (This method is generated in Translator_default#buildImpl)
120:      * 
121:      * @access private
122:      * @ignore
123:      * @return string
124:      */
125:     private function get_id()
126:     {
127:         return $this->m_id;
128:     }
129:     
130:     
131:     
132:     /**
133:      * @access private
134:      * @ignore
135:      * @var boolean
136:      */
137:     private $n_name = false;
138:     
139:     /**
140:      * (This method is generated in Translator_default#buildImpl)
141:      * 
142:      * @access private
143:      * @ignore
144:      * @return string
145:      */
146:     private function get_name()
147:     {
148:         return $this->m_name;
149:     }
150:     
151:     /**
152:      * (This method is generated in Translator_default#buildImpl)
153:      * 
154:      * @access private
155:      * @ignore
156:      * @param string $v
157:      * @return string
158:      */
159:     private function set_name($v)
160:     {
161:         Util::validateArgCount(func_num_args(), 1);
162:         Util::validateType($v, "string");
163:         $this->m_name = $v;
164:         $this->n_name = true;
165:         return $this->m_name;
166:     }
167:     
168:     
169:     
170:     /**
171:      * (This method is generated in Translator_default#buildImpl)
172:      * 
173:      * @access protected
174:      * @ignore
175:      * @param mixed $r
176:      */
177:     protected function apiDeserializeImpl($r)
178:     {
179:         Util::validateArgCount(func_num_args(), 1);
180:         $this->isNew = $r == null;
181:         if ($this->isNew) {
182:             $r = (object)[];
183:         }
184:         $this->isIncomplete = false;
185:         if (Util::existsPath($r, "ID")) {
186:             $this->m_id = Util::getByPath($r, "ID") == null ? null : "" . Util::getByPath($r, "ID");
187:         }
188:         else {
189:             $this->m_id = null;
190:             $this->isIncomplete = true;
191:         }
192:         $this->n_id = false;
193:         if (Util::existsPath($r, "Name")) {
194:             $this->m_name = Util::getByPath($r, "Name") == null ? null : "" . Util::getByPath($r, "Name");
195:         }
196:         else {
197:             $this->m_name = null;
198:             $this->isIncomplete = true;
199:         }
200:         $this->n_name = false;
201:     }
202:     
203:     /**
204:      * @ignore
205:      * @access protected
206:      * @param boolean $withClean=false
207:      * @return mixed
208:      */
209:     protected function apiSerializeImpl($withClean=false)
210:     {
211:         Util::validateType($withClean, "boolean");
212:         $missing = new \ArrayObject([]);
213:         $ret = (object)[];
214:         if ($withClean || $this->n_id) {
215:             Util::setByPath($ret, "ID", $this->m_id);
216:         }
217:         if ($withClean || $this->n_name) {
218:             Util::setByPath($ret, "Name", $this->m_name);
219:         }
220:         else {
221:             if ($this->isNew) {
222:                 $missing->append("name");
223:             }
224:         }
225:         if ($missing->count() > 0) {
226:             throw new SaklientException("required_field", "Required fields must be set before the LicenseInfo creation: " . implode(", ", (array)($missing)));
227:         }
228:         return $ret;
229:     }
230:     
231:     /**
232:      * @ignore
233:      */
234:     public function __get($key) {
235:         switch ($key) {
236:             case "id": return $this->get_id();
237:             case "name": return $this->get_name();
238:             default: return parent::__get($key);
239:         }
240:     }
241:     
242:     /**
243:      * @ignore
244:      */
245:     public function __set($key, $v) {
246:         switch ($key) {
247:             case "name": return $this->set_name($v);
248:             default: return parent::__set($key, $v);
249:         }
250:     }
251: 
252: }
253: 
254: 
API documentation generated by ApiGen 2.8.0