"""trainingApi URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.urls import path, include

from accounts.api import LoginAPI, UserAPI, RegisterAPI
from email_statistics_calculator.views import get_email_statistics
from emails.views import parse
from gamerun_manager.views import init_gamerun, set_player_answer, next_email
from gamerun_summary.views import get_gamerun_summary
from gameruns.views import emails_from_gamerun
from .router import router
from knox import views as knox_views

urlpatterns = [

    path('gamerun/init/', init_gamerun),
    path('gamerun/setAnswer/', set_player_answer),
    path('gamerun/nextEmail/', next_email),
    path('gamerun/summary/', get_gamerun_summary),
    path('gameruns/<int:gamerun_id>/emails/', emails_from_gamerun),
    path('emails/import/', parse),
    path('emails/<int:email_id>/statistics/', get_email_statistics),
    path('auth/login/', LoginAPI.as_view()),
    path('auth/user/', UserAPI.as_view()),
    path('auth/register/', RegisterAPI.as_view()),
    path('auth/logout/', knox_views.LogoutView.as_view()),

    path('', include(router.urls), name='api'),
]
