public function denormalize($data, $class, $format = null, array $context = [])
 {
     if (empty($data)) {
         return null;
     }
     if (isset($data->{'$ref'})) {
         return new Reference($data->{'$ref'}, $context['rootSchema'] ?: null);
     }
     $object = new \Docker\API\Model\ResourceUpdate();
     if (!isset($context['rootSchema'])) {
         $context['rootSchema'] = $object;
     }
     if (property_exists($data, 'BlkioWeight')) {
         $object->setBlkioWeight($data->{'BlkioWeight'});
     }
     if (property_exists($data, 'CpuShares')) {
         $object->setCpuShares($data->{'CpuShares'});
     }
     if (property_exists($data, 'CpuPeriod')) {
         $object->setCpuPeriod($data->{'CpuPeriod'});
     }
     if (property_exists($data, 'CpuQuota')) {
         $object->setCpuQuota($data->{'CpuQuota'});
     }
     if (property_exists($data, 'CpusetCpus')) {
         $object->setCpusetCpus($data->{'CpusetCpus'});
     }
     if (property_exists($data, 'CpusetMems')) {
         $object->setCpusetMems($data->{'CpusetMems'});
     }
     if (property_exists($data, 'Memory')) {
         $object->setMemory($data->{'Memory'});
     }
     if (property_exists($data, 'MemorySwap')) {
         $object->setMemorySwap($data->{'MemorySwap'});
     }
     if (property_exists($data, 'MemoryReservation')) {
         $object->setMemoryReservation($data->{'MemoryReservation'});
     }
     if (property_exists($data, 'KernelMemory')) {
         $object->setKernelMemory($data->{'KernelMemory'});
     }
     if (property_exists($data, 'RestartPolicy')) {
         $object->setRestartPolicy($this->serializer->deserialize($data->{'RestartPolicy'}, 'Docker\\API\\Model\\RestartPolicy', 'raw', $context));
     }
     return $object;
 }
 public function denormalize($data, $class, $format = null, array $context = [])
 {
     if (empty($data)) {
         return null;
     }
     if (isset($data->{'$ref'})) {
         return new Reference($data->{'$ref'}, $context['rootSchema'] ?: null);
     }
     $object = new \Docker\API\Model\ResourceUpdate();
     if (!isset($context['rootSchema'])) {
         $context['rootSchema'] = $object;
     }
     if (isset($data->{'BlkioWeight'})) {
         $object->setBlkioWeight($data->{'BlkioWeight'});
     }
     if (isset($data->{'CpuShares'})) {
         $object->setCpuShares($data->{'CpuShares'});
     }
     if (isset($data->{'CpuPeriod'})) {
         $object->setCpuPeriod($data->{'CpuPeriod'});
     }
     if (isset($data->{'CpuQuota'})) {
         $object->setCpuQuota($data->{'CpuQuota'});
     }
     if (isset($data->{'CpusetCpus'})) {
         $object->setCpusetCpus($data->{'CpusetCpus'});
     }
     if (isset($data->{'CpusetMems'})) {
         $object->setCpusetMems($data->{'CpusetMems'});
     }
     if (isset($data->{'Memory'})) {
         $object->setMemory($data->{'Memory'});
     }
     if (isset($data->{'MemorySwap'})) {
         $object->setMemorySwap($data->{'MemorySwap'});
     }
     if (isset($data->{'MemoryReservation'})) {
         $object->setMemoryReservation($data->{'MemoryReservation'});
     }
     if (isset($data->{'KernelMemory'})) {
         $object->setKernelMemory($data->{'KernelMemory'});
     }
     return $object;
 }