from ..config import ConfigUnit
from typing import Optional, Union


class WebApiConfig(ConfigUnit):
    NAME = 'web_api'

    @classmethod
    def schema(cls) -> Optional[dict]:
        return {
            'listen_addr': cls._addr_schema(required=True),
            'host': cls._addr_schema(required=True),
            'token': dict(type='string', required=True),
            'recordings_dir': dict(type='string', required=True)
        }