new Alias('endpoints', Endpoint::class, true), ]; } /** * Indicates whether this catalog entry matches a certain name and type. * * @return bool TRUE if it's a match, FALSE if not */ public function matches(string $name, string $type): bool { return $this->name == $name && $this->type == $type; } /** * Retrieves the catalog entry's URL according to a specific region and URL type. */ public function getEndpointUrl(string $region, string $urlType): string { foreach ($this->endpoints as $endpoint) { if ($endpoint->supportsRegion($region) && $endpoint->supportsUrlType($urlType)) { return $endpoint->getUrl($urlType); } } return ''; } }