from django.urls import path, re_path
from django.conf.urls import url 


from .views import user_views, requirements_views, main_req_views, suffix_req_views

urlpatterns = [
    url(r'^signup/$', user_views.signup, name='signup'),
    path('users/', user_views.UserList.as_view(), name='api-user-list'),
    path('users/<uuid:pk>/', user_views.UserDetail.as_view(), name='api-post-details'),
    path('ontologies/', requirements_views.OntologiesChoicesViewSet.as_view(), name='api-get-ontologies'),
    path('getontology/<int:groupboil>/', requirements_views.GetOntology.as_view(), name='get-current-ontology'),
    path('groupboilerplates/', requirements_views.BoilerplateGroupCreateAPIView.as_view(), name='api-groupboilerplates-create'),
    path('groupboilerplates/<int:pk>/', requirements_views.BoilerplateGroupDetailsAPIView.as_view(), name='api-groupboilerplates-list'),

    path('groupboilerplates/<int:groupboil>/infer/', requirements_views.InferListAPIView.as_view(), name='api-infer-list'),
    path('groupboilerplates/<int:groupboil>/infer/<int:pk>/', requirements_views.InferDetailsAPIView.as_view(), name='api-infer-details'),
    
    path('groupboilerplates/<int:groupboil>/boilerplates/', requirements_views.BoilerplateListCreateAPIView.as_view(), name='api-requirements-list'),
    path('groupboilerplates/<int:groupboil>/boilerplates/<int:pk>/', requirements_views.BoilerplateDetailsAPIView.as_view(), name='api-requirements-details'),
    path('groupboilerplates/<int:groupboil>/boilerplates/boilerplatedata/', requirements_views.BoilerplateDataListAPIView.as_view(), name='api-boilerlplate-list-data'),
    re_path('groupboilerplates/<int:groupboil>/boilerplates/(?:title=(?P<title_1>\w+)/)?$', requirements_views.BoilerplateList.as_view(), name='api-requirements-details-per-title'), 
    
    #'''Prefix'''
    path('groupboilerplates/<int:groupboil>/boilerplates/<int:boilerplate>/prefix/', requirements_views.PrefixListAPIView.as_view(), name='api-prefix-list'),
    path('groupboilerplates/<int:groupboil>/boilerplates/<int:boilerplate>/prefix/<int:pk>/', requirements_views.PrefixDetailsAPIView.as_view(), name='api-prefix-details'),

    #'''MAIN'''
    path('groupboilerplates/<int:groupboil>/boilerplates/<int:boilerplate>/main/', main_req_views.MainListAPIView.as_view(), name='api-main-list'),
    path('groupboilerplates/<int:groupboil>/boilerplates/<int:boilerplate>/main/<int:pk>/', main_req_views.MainDetailsAPIView.as_view(), name='api-main-details'),
    #'''SUFFIX'''
    path('groupboilerplates/<int:groupboil>/boilerplates/<int:boilerplate>/suffix/', suffix_req_views.SuffixListAPIView.as_view(), name='api-suffix-list'),
    path('groupboilerplates/<int:groupboil>/boilerplates/<int:boilerplate>/suffix/<int:pk>/', suffix_req_views.SuffixDetailsAPIView.as_view(), name='api-suffix-details'),

    #PREFIX CHOICES DATA
    path('groupboilerplates/<int:groupboil>/prefix/choices/simpleprefix/', requirements_views.PrefixChoicesViewSet.as_view(), name='simpleprefixchoices'),
   
    #MAIN CHOICES DATA
    path('groupboilerplates/<int:groupboil>/main/choices/', main_req_views.MainChoicesViewSet.as_view(), name='mainchoices'),
    path('groupboilerplates/<int:groupboil>/main/choices/add/<str:instance>/<str:comment>/', main_req_views.MainChoicesAPIView.as_view(), name='setmainchoices'),
    path('groupboilerplates/<int:groupboil>/main/choices/delete/<str:instance>/<str:comment>/', main_req_views.DeleteMainChoicesAPIView.as_view(), name='deletemainchoices'),
    path('main/choices/shall/', main_req_views.ShallChoicesViewSet.as_view(), name='mainshall'),

    #SUFFIX CHOICES DATA
    ##path('suffix/choices/suffix/', suffix_req_views.SuffixChoicesViewSet.as_view(), name='suffixsuffix'),
    #path('suffix/choices/numunits/', suffix_req_views.NumChoicesViewSet.as_view(), name='suffixnum'),
    #path('suffix/choices/flow/', suffix_req_views.FlowChoicesViewSet.as_view(), name='suffixflow'),

    #Dictionary
    path('groupboilerplates/<int:groupboil>/dictionary/', main_req_views.DictionaryViewSet.as_view(), name='dictionary'),
    path('groupboilerplates/<int:groupboil>/mainsyntax/', main_req_views.MainSyntaxViewSet.as_view(), name='mainsyntax'),

    #Search In Ontology
    path('groupboilerplates/<int:groupboil>/search/<str:instance>/', main_req_views.SearchinOntologyAPIView.as_view(), name='setmainchoices'),


]