"""Temp handlers.""" from typing import Dict, List from uuid import UUID from fastapi import APIRouter, Depends from pdp.connectors.ows_account import OwsAccountClient from pdp.connectors.ows_participant import OwsParticipantClient from pdp.connectors.redis_client import RedisConnector from pdp.fastapi.datasources import ( get_ows_account_client, get_ows_participant_client, get_redis_connector, ) from pdp.fastapi.schemas import tenant as tenant_schema from pdp.proxies.multi_tenant_proxy import MultiTenantProxy router = APIRouter(prefix="/temp", tags=["temp"]) @router.post( "/infra/multi-tenant-proxy/accounts/", description="Test multi tenant account lookup.", response_model=Dict[UUID, tenant_schema.TenantHierarchy], ) async def multi_tenant_proxy_test( tenants: List[tenant_schema.Tenant], ows_account_client: OwsAccountClient = Depends(get_ows_account_client), ows_participant_client: OwsParticipantClient = Depends(get_ows_participant_client), redis_connector: RedisConnector = Depends(get_redis_connector), ) -> Dict[UUID, tenant_schema.TenantHierarchy]: """Demo Endpoint for the MultiTenantProxy class.""" proxy = MultiTenantProxy( tenants=tenants, redis_client=redis_connector, ows_account_client=ows_account_client, ows_participant_client=ows_participant_client, ) hierarchies = await proxy.gather_tenant_hierarchies() return hierarchies