refactor(doc): update docs static
This commit is contained in:
@@ -6,16 +6,16 @@ class ApiBundle:
|
||||
self._values = values
|
||||
self._by_provider = {value.provider: value for value in values}
|
||||
|
||||
def get_api_providers(self, api_type: str) -> list[str]:
|
||||
def get_api_providers(self, api_type: type[API]) -> list[str]:
|
||||
result = []
|
||||
for value in self._values:
|
||||
if value.type == api_type:
|
||||
if isinstance(value, api_type):
|
||||
result.append(value.provider)
|
||||
return result
|
||||
|
||||
def get_api(self, api_type: type[API], provider: str | None = None) -> API:
|
||||
def get_api(self, api_type: type[API], provider: str) -> API:
|
||||
for value in self._values:
|
||||
if isinstance(value, api_type):
|
||||
if provider is None or provider == value.provider:
|
||||
if provider == value.provider:
|
||||
return value
|
||||
raise ValueError(api_type, provider)
|
||||
|
||||
Reference in New Issue
Block a user