private function getBaseUri(DataService $annotation, bool $readonly = false): string
    {
        // Accounts are optional as you need to be able to load an account
        // before you can resolve services.
        if (!($base = $annotation->getBaseUri())) {
            // If no account is specified, we must use the ResolveAllUrls service instead.
            if (!$this->authenticatedClient->hasAccount()) {
                $resolver = new ResolveAllUrls($this->authenticatedClient, $this->cacheItemPool);

                return $resolver->resolve($annotation->getService($readonly))->getUrl().$annotation->getPath();
            }

            $resolved = $this->resolveDomain->resolve($this->authenticatedClient->getAccount());

            $base = $resolved->getUrl($annotation->getService($readonly)).$annotation->getPath();
        }

        return $base;
    }