-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprograms_api_base.py
More file actions
32 lines (24 loc) · 1.09 KB
/
programs_api_base.py
File metadata and controls
32 lines (24 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# coding: utf-8
from typing import ClassVar, Dict, List, Tuple # noqa: F401
from pydantic import Field
from typing import Any
from typing_extensions import Annotated
from openapi_server.models.application import Application
import logging;
import sys
logging.basicConfig(level=logging.DEBUG, stream=sys.stdout,
format="%(asctime)s [%(levelname)s] %(name)s: %(message)s")
LOG = logging.getLogger(__name__)
class BaseProgramsApi:
subclasses: ClassVar[Tuple] = ()
def __init_subclass__(cls, **kwargs):
super().__init_subclass__(**kwargs)
BaseProgramsApi.subclasses = BaseProgramsApi.subclasses + (cls,)
LOG.warning("API is starting up")
LOG.warning(f"Registered subclass: {cls.__name__}. Current subclasses: {[s.__name__ for s in BaseProgramsApi.subclasses]}")
async def send_app(
self,
application: Annotated[Application, Field(description="The revision state of applications to include in results. When omitted, applications of all revision states are returned.")],
) -> None:
"""Send app"""
...