name = $api->getServiceName(); $this->api = $api; $this->namespace = $this->getServiceNamespace($this->name); $this->version = $api->getApiVersion(); $this->docs = $docs; $this->slug = $this->name . '-' . $this->version; $this->uid = $api->getUid(); $this->clientName = $this->namespace . 'Client'; $this->client = 'Aws\\' . $this->namespace . '\\' . $this->clientName; $this->clientLink = 'class-Aws.' . $this->namespace . '.' . $this->namespace . 'Client.html'; $this->exceptionLink = 'class-Aws.' . $this->namespace . '.Exception.' . $this->namespace . 'Exception.html'; $this->namespaceLink = 'namespace-Aws.' . $this->namespace . '.html'; $this->serviceLink = 'api-' . $this->slug . '.html'; $this->shortTitle = $api->getMetadata('serviceAbbreviation'); $this->title = $api->getServiceFullName(); $this->fullNamespace = 'Aws\\' . $this->namespace; $this->fullTitle = $this->title . ' (' . $this->version . ')'; } private function getServiceNamespace($service) { static $namespaces; if (!$namespaces) { // Get the namespaces from the directories. foreach (glob(__DIR__ . '/../../../src/*') as $dir) { $base = basename($dir); if (class_exists("Aws\\{$base}\\{$base}Client")) { $namespaces[Sdk::getEndpointPrefix($base)] = $base; } } } if (!isset($namespaces[$service])) { throw new \RuntimeException("Could not determine the namespace for {$service}."); } return $namespaces[$service]; } }