# urls.py

from django.urls import path, register_converter
from fiesta import converters 
from fiesta.views import views
from rest_framework.urlpatterns import format_suffix_patterns

# "http://django-sdmx.org/wsrest/"
# "http://django-sdmx.org/ws/"

register_converter(converters.ResourceConverter, 'res')
register_converter(converters.AgencyConverter, 'age')
register_converter(converters.ContextConverter, 'con')

urlpatterns = [
    path('wsreg/SubmitStructure/', views.SubmitStructureRequestView.as_view()),
    path('wsrest/schema/<con:context>/<age:agencyID>/<str:resourceID>', views.SDMXRESTfulSchemaView.as_view()),
    path('wsrest/schema/<con:context>/<age:agencyID>/<str:resourceID>/<str:version>', views.SDMXRESTfulSchemaView.as_view()),
    path('wsrest/<res:resource>/', views.SDMXRESTfulStructureView.as_view()),
    path('wsrest/<res:resource>/<age:agencyID>/',
         views.SDMXRESTfulStructureView.as_view()),
    path('wsrest/<res:resource>/<age:agencyID>/<str:resourceID>/', 
         views.SDMXRESTfulStructureView.as_view()),
    path('wsrest/<res:resource>/<age:agencyID>/<str:resourceID>/'
         '<str:version>/', 
         views.SDMXRESTfulStructureView.as_view()),
]

urlpatterns = format_suffix_patterns(urlpatterns)


[(11, 'django.urls.register_converter', 'register_converter', False, 'from django.urls import path, register_converter\n'), (12, 'django.urls.register_converter', 'register_converter', False, 'from django.urls import path, register_converter\n'), (13, 'django.urls.register_converter', 'register_converter', False, 'from django.urls import path, register_converter\n'), (29, 'rest_framework.urlpatterns.format_suffix_patterns', 'format_suffix_patterns', False, 'from rest_framework.urlpatterns import format_suffix_patterns\n'), (16, 'fiesta.views.views.SubmitStructureRequestView.as_view', 'views.SubmitStructureRequestView.as_view', False, 'from fiesta.views import views\n'), (17, 'fiesta.views.views.SDMXRESTfulSchemaView.as_view', 'views.SDMXRESTfulSchemaView.as_view', False, 'from fiesta.views import views\n'), (18, 'fiesta.views.views.SDMXRESTfulSchemaView.as_view', 'views.SDMXRESTfulSchemaView.as_view', False, 'from fiesta.views import views\n'), (19, 'fiesta.views.views.SDMXRESTfulStructureView.as_view', 'views.SDMXRESTfulStructureView.as_view', False, 'from fiesta.views import views\n'), (21, 'fiesta.views.views.SDMXRESTfulStructureView.as_view', 'views.SDMXRESTfulStructureView.as_view', False, 'from fiesta.views import views\n'), (23, 'fiesta.views.views.SDMXRESTfulStructureView.as_view', 'views.SDMXRESTfulStructureView.as_view', False, 'from fiesta.views import views\n'), (26, 'fiesta.views.views.SDMXRESTfulStructureView.as_view', 'views.SDMXRESTfulStructureView.as_view', False, 'from fiesta.views import views\n')]