# 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)


[((252, 307), 'django.urls.register_converter', 'register_converter', (['converters.ResourceConverter', '"""res"""'], {}), "(converters.ResourceConverter, 'res')\n", (270, 307), False, 'from django.urls import path, register_converter\n'), ((308, 361), 'django.urls.register_converter', 'register_converter', (['converters.AgencyConverter', '"""age"""'], {}), "(converters.AgencyConverter, 'age')\n", (326, 361), False, 'from django.urls import path, register_converter\n'), ((362, 416), 'django.urls.register_converter', 'register_converter', (['converters.ContextConverter', '"""con"""'], {}), "(converters.ContextConverter, 'con')\n", (380, 416), False, 'from django.urls import path, register_converter\n'), ((1215, 1250), 'rest_framework.urlpatterns.format_suffix_patterns', 'format_suffix_patterns', (['urlpatterns'], {}), '(urlpatterns)\n', (1237, 1250), False, 'from rest_framework.urlpatterns import format_suffix_patterns\n'), ((469, 511), 'fiesta.views.views.SubmitStructureRequestView.as_view', 'views.SubmitStructureRequestView.as_view', ([], {}), '()\n', (509, 511), False, 'from fiesta.views import views\n'), ((586, 623), 'fiesta.views.views.SDMXRESTfulSchemaView.as_view', 'views.SDMXRESTfulSchemaView.as_view', ([], {}), '()\n', (621, 623), False, 'from fiesta.views import views\n'), ((712, 749), 'fiesta.views.views.SDMXRESTfulSchemaView.as_view', 'views.SDMXRESTfulSchemaView.as_view', ([], {}), '()\n', (747, 749), False, 'from fiesta.views import views\n'), ((787, 827), 'fiesta.views.views.SDMXRESTfulStructureView.as_view', 'views.SDMXRESTfulStructureView.as_view', ([], {}), '()\n', (825, 827), False, 'from fiesta.views import views\n'), ((889, 929), 'fiesta.views.views.SDMXRESTfulStructureView.as_view', 'views.SDMXRESTfulStructureView.as_view', ([], {}), '()\n', (927, 929), False, 'from fiesta.views import views\n'), ((1009, 1049), 'fiesta.views.views.SDMXRESTfulStructureView.as_view', 'views.SDMXRESTfulStructureView.as_view', ([], {}), '()\n', (1047, 1049), False, 'from fiesta.views import views\n'), ((1155, 1195), 'fiesta.views.views.SDMXRESTfulStructureView.as_view', 'views.SDMXRESTfulStructureView.as_view', ([], {}), '()\n', (1193, 1195), False, 'from fiesta.views import views\n')]