ticketfrei3/kibicara/webapi/__init__.py

43 lines
1.7 KiB
Python
Raw Normal View History

2020-07-01 19:34:16 +00:00
# Copyright (C) 2020 by Thomas Lindner <tom@dl6tom.de>
# Copyright (C) 2020 by Cathy Hu <cathy.hu@fau.de>
# Copyright (C) 2020 by Martin Rey <martin.rey@mailbox.org>
2020-07-01 19:34:16 +00:00
#
# SPDX-License-Identifier: 0BSD
"""Routing definitions for the REST API.
2020-07-11 10:54:07 +00:00
A platform bot shall add its API router in this `__init__.py`
file to get included into the main application.
"""
2020-07-01 19:34:16 +00:00
from fastapi import APIRouter
2020-10-13 08:35:20 +00:00
from kibicara.platforms.email.webapi import router as email_router
2020-07-10 21:53:24 +00:00
from kibicara.platforms.telegram.webapi import router as telegram_router
2020-10-13 08:35:20 +00:00
from kibicara.platforms.test.webapi import router as test_router
2020-07-06 09:14:21 +00:00
from kibicara.platforms.twitter.webapi import router as twitter_router
from kibicara.platforms.twitter.webapi import twitter_callback_router
2020-07-01 19:34:16 +00:00
from kibicara.webapi.admin import router as admin_router
from kibicara.webapi.hoods import router as hoods_router
from kibicara.webapi.hoods.badwords import router as badwords_router
from kibicara.webapi.hoods.triggers import router as triggers_router
router = APIRouter()
router.include_router(admin_router, prefix='/admin', tags=['admin'])
hoods_router.include_router(
triggers_router, prefix='/{hood_id}/triggers', tags=['triggers']
)
hoods_router.include_router(
badwords_router, prefix='/{hood_id}/badwords', tags=['badwords']
)
hoods_router.include_router(test_router, prefix='/{hood_id}/test', tags=['test'])
2020-07-10 21:53:24 +00:00
hoods_router.include_router(
telegram_router, prefix='/{hood_id}/telegram', tags=['telegram']
)
2020-07-06 09:14:21 +00:00
hoods_router.include_router(
twitter_router, prefix='/{hood_id}/twitter', tags=['twitter']
)
router.include_router(twitter_callback_router, prefix='/twitter', tags=['twitter'])
2020-07-06 17:14:12 +00:00
hoods_router.include_router(email_router, prefix='/{hood_id}/email', tags=['email'])
router.include_router(hoods_router, prefix='/hoods')