/**
  * @param $object is json object
  * @param $client Openstack
  * @return Endpoint
  */
 public static function factory($object, Openstack $client)
 {
     $endpoint = new self();
     if (isset($object->publicURL)) {
         $endpoint->setPublicUrl($endpoint->getFormatUrl($object->publicURL, $client));
     }
     if (isset($object->internalURL)) {
         $endpoint->setInternalUrl($endpoint->getFormatUrl($object->internalURL, $client));
     }
     if (isset($object->adminURL)) {
         $endpoint->setAdminUrl($endpoint->getFormatUrl($object->adminURL, $client));
     }
     if (isset($object->region)) {
         $endpoint->setRegion($object->region);
     }
     return $endpoint;
 }