Ejemplo n.º 1
0
 /**
  * @param \stdClass|array $parameters
  */
 public function build($parameters)
 {
     foreach ((array) $parameters as $property => $value) {
         $property = \NGCSv1\convert_to_camel_case($property);
         $this->{$property} = $value;
     }
 }
Ejemplo n.º 2
0
 /**
  * @param \stdClass|array $parameters
  */
 public function build($parameters)
 {
     foreach ($parameters as $property => $value) {
         switch ($property) {
             case 'fixed_instance_size_id':
                 $this->fixed_instance_size_id = $value;
                 break;
             case 'vcore':
                 $this->vcore = $value;
                 break;
             case 'cores_per_processor':
                 $this->cores_per_processor = $value;
                 break;
             case 'ram':
                 $this->ram = $value;
                 break;
             case 'hdds':
                 $this->hdds = $value;
                 break;
             default:
                 $this->{\NGCSv1\convert_to_camel_case($property)} = $value;
                 break;
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * @param \stdClass|array $parameters
  */
 public function build($parameters)
 {
     foreach ($parameters as $property => $value) {
         switch ($property) {
             case 'id':
                 $this->id = $value;
                 break;
             case 'ip':
                 $this->ip = $value;
                 break;
             case 'type':
                 $this->type = $value;
                 break;
             case 'reverse_dns':
                 $this->reverse_dns = $value;
                 break;
             case 'firewall_policy':
                 $this->firewall_policy = $value;
                 break;
             case 'load_balancers':
                 $this->load_balancers = $value;
                 break;
             default:
                 $this->{\NGCSv1\convert_to_camel_case($property)} = $value;
                 break;
         }
     }
 }
Ejemplo n.º 4
0
 /**
  * @param \stdClass|array $parameters
  */
 public function build($parameters)
 {
     foreach ($parameters as $property => $value) {
         switch ($property) {
             default:
                 $this->{\NGCSv1\convert_to_camel_case($property)} = $value;
                 break;
         }
     }
 }
Ejemplo n.º 5
0
 /**
  * @param \stdClass|array $parameters
  */
 public function build($parameters)
 {
     foreach ($parameters as $property => $value) {
         switch ($property) {
             case 'fixed_instance_size_id':
                 $this->fixed_instance_size_id = $value;
                 break;
             default:
                 $this->{\NGCSv1\convert_to_camel_case($property)} = $value;
                 break;
         }
     }
 }
Ejemplo n.º 6
0
 /**
  * @param \stdClass|array $parameters
  */
 public function build($parameters)
 {
     foreach ($parameters as $property => $value) {
         switch ($property) {
             case 'id':
                 $this->id = $value;
                 break;
             case 'creation_date':
                 $this->creation_date = $value;
                 break;
             case 'deletion_date':
                 $this->deletion_date = $value;
                 break;
             default:
                 $this->{\NGCSv1\convert_to_camel_case($property)} = $value;
                 break;
         }
     }
 }
Ejemplo n.º 7
0
 /**
  * @param \stdClass|array $parameters
  */
 public function build($parameters)
 {
     foreach ($parameters as $property => $value) {
         switch ($property) {
             case 'id':
                 $this->id = $value;
                 break;
             case 'size':
                 $this->size = $value;
                 break;
             case 'is_main':
                 $this->is_main = $value;
                 break;
             default:
                 $this->{\NGCSv1\convert_to_camel_case($property)} = $value;
                 break;
         }
     }
 }
Ejemplo n.º 8
0
 /**
  * @param \stdClass|array $parameters
  */
 public function build($parameters)
 {
     foreach ($parameters as $property => $value) {
         switch ($property) {
             case 'id':
                 $this->id = $value;
                 break;
             case 'hdds':
                 if (is_object($value)) {
                     array_map(function ($hdd) {
                         return new Image($hdd);
                     }, $value);
                 }
                 break;
             default:
                 $this->{\NGCSv1\convert_to_camel_case($property)} = $value;
                 break;
         }
     }
 }
Ejemplo n.º 9
0
 /**
  * @param \stdClass|array $parameters
  */
 public function build($parameters)
 {
     foreach ($parameters as $property => $value) {
         switch ($property) {
             case 'status':
                 if (is_object($value)) {
                     if (property_exists($value, 'state')) {
                         $this->status['state'] = $value->state;
                     } elseif (property_exists($value, 'percent')) {
                         $this->status['percent'] = $value->percent;
                     }
                 }
                 break;
             case 'hardware':
                 if (is_object($value)) {
                     $this->hardware = new Hardware($value);
                 }
                 break;
             case 'dvd':
                 $this->dvd = $value;
                 break;
             case 'first_password':
                 $this->first_password = $value;
                 break;
             case 'privateNetworks':
                 $this->privateNetworks = $value;
                 break;
             case 'monitoringPolicy':
                 $this->monitoringPolicy = $value;
             case 'datacenter':
                 $this->datacenter = $value;
                 /*
                 case 'size':
                     if (is_object($value)) {
                         $this->size = new Size($value);
                     }
                     break;
                 
                 case 'region':
                     if (is_object($value)) {
                         $this->region = new Region($value);
                     }
                     break;
                 
                 case 'image':
                     if (is_object($value)) {
                         $this->image = new Image($value);
                     }
                     break;
                 
                 case 'next_backup_window':
                     $this->nextBackupWindow = new NextBackupWindow($value);
                     break;
                 */
             /*
             case 'size':
                 if (is_object($value)) {
                     $this->size = new Size($value);
                 }
                 break;
             
             case 'region':
                 if (is_object($value)) {
                     $this->region = new Region($value);
                 }
                 break;
             
             case 'image':
                 if (is_object($value)) {
                     $this->image = new Image($value);
                 }
                 break;
             
             case 'next_backup_window':
                 $this->nextBackupWindow = new NextBackupWindow($value);
                 break;
             */
             default:
                 $this->{\NGCSv1\convert_to_camel_case($property)} = $value;
         }
     }
     /*if (is_array($this->features) && count($this->features)) {
           $this->backupsEnabled = in_array("backups", $this->features);
           $this->virtIOEnabled = in_array("virtio", $this->features);
           $this->privateNetworkingEnabled = in_array("private_networking", $this->features);
           $this->ipv6Enabled = in_array("ipv6", $this->features);
       }*/
 }