/** * @param $object * @return Endpoint */ public static function factory($object) { $endpoint = new self(); if (isset($object->publicURL)) { $endpoint->setPublicUrl($object->publicURL); } if (isset($object->internalURL)) { $endpoint->setPrivateUrl($object->internalURL); } if (isset($object->region)) { $endpoint->setRegion($object->region); } return $endpoint; }
/** * @param $object * @param string $supportedServiceVersion Service version supported by the SDK * @param OpenCloud\OpenStack $client OpenStack client * @return Endpoint */ public static function factory($object, $supportedServiceVersion, OpenStack $client) { $endpoint = new self(); if (isset($object->publicURL)) { $endpoint->setPublicUrl($endpoint->getVersionedUrl($object->publicURL, $supportedServiceVersion, $client)); } if (isset($object->internalURL)) { $endpoint->setPrivateUrl($endpoint->getVersionedUrl($object->internalURL, $supportedServiceVersion, $client)); } if (isset($object->region)) { $endpoint->setRegion($object->region); } return $endpoint; }