dump-things-service/dump_things_service/__init__.py
Christian Monch 3fdefc78cc
All checks were successful
Test execution / Test-all (push) Successful in 2m11s
change HTTP status imports to non-deprecated symbols
2026-06-23 08:47:29 +02:00

64 lines
1.3 KiB
Python

from enum import Enum
from typing import (
Any,
Union,
)
from starlette.status import (
HTTP_200_OK,
HTTP_201_CREATED,
HTTP_300_MULTIPLE_CHOICES,
HTTP_400_BAD_REQUEST,
HTTP_401_UNAUTHORIZED,
HTTP_403_FORBIDDEN,
HTTP_404_NOT_FOUND,
HTTP_406_NOT_ACCEPTABLE,
HTTP_409_CONFLICT,
HTTP_413_CONTENT_TOO_LARGE,
HTTP_422_UNPROCESSABLE_CONTENT,
HTTP_500_INTERNAL_SERVER_ERROR,
HTTP_503_SERVICE_UNAVAILABLE,
)
__all__ = [
'Format',
'HTTP_200_OK',
'HTTP_201_CREATED',
'HTTP_300_MULTIPLE_CHOICES',
'HTTP_400_BAD_REQUEST',
'HTTP_401_UNAUTHORIZED',
'HTTP_403_FORBIDDEN',
'HTTP_404_NOT_FOUND',
'HTTP_406_NOT_ACCEPTABLE',
'HTTP_409_CONFLICT',
'HTTP_413_CONTENT_TOO_LARGE',
'HTTP_422_UNPROCESSABLE_CONTENT',
'HTTP_500_INTERNAL_SERVER_ERROR',
'HTTP_503_SERVICE_UNAVAILABLE',
'JSON',
'YAML',
'config_file_name',
'reserved_collection_names',
]
class Format(str, Enum):
json = 'json'
ttl = 'ttl'
JSON = Union[dict[str, Any], list[Any], str, int, float, None]
YAML = JSON
config_file_name = '.dumpthings.yaml'
dump_things_private_collection_name = '__dump_things__'
reserved_collection_names = (
'collections',
'tokens',
'admin_tokens',
'api',
dump_things_private_collection_name,
)