# 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, 0, 11, 55), 'django.urls.register_converter', 'register_converter', ({(11, 19, 11, 47): 'converters.ResourceConverter', (11, 49, 11, 54): '"""res"""'}, {}), "(converters.ResourceConverter, 'res')", False, 'from django.urls import path, register_converter\n'), ((12, 0, 12, 53), 'django.urls.register_converter', 'register_converter', ({(12, 19, 12, 45): 'converters.AgencyConverter', (12, 47, 12, 52): '"""age"""'}, {}), "(converters.AgencyConverter, 'age')", False, 'from django.urls import path, register_converter\n'), ((13, 0, 13, 54), 'django.urls.register_converter', 'register_converter', ({(13, 19, 13, 46): 'converters.ContextConverter', (13, 48, 13, 53): '"""con"""'}, {}), "(converters.ContextConverter, 'con')", False, 'from django.urls import path, register_converter\n'), ((29, 14, 29, 49), 'rest_framework.urlpatterns.format_suffix_patterns', 'format_suffix_patterns', ({(29, 37, 29, 48): 'urlpatterns'}, {}), '(urlpatterns)', False, 'from rest_framework.urlpatterns import format_suffix_patterns\n'), ((16, 35, 16, 77), 'fiesta.views.views.SubmitStructureRequestView.as_view', 'views.SubmitStructureRequestView.as_view', ({}, {}), '()', False, 'from fiesta.views import views\n'), ((17, 72, 17, 109), 'fiesta.views.views.SDMXRESTfulSchemaView.as_view', 'views.SDMXRESTfulSchemaView.as_view', ({}, {}), '()', False, 'from fiesta.views import views\n'), ((18, 86, 18, 123), 'fiesta.views.views.SDMXRESTfulSchemaView.as_view', 'views.SDMXRESTfulSchemaView.as_view', ({}, {}), '()', False, 'from fiesta.views import views\n'), ((19, 35, 19, 75), 'fiesta.views.views.SDMXRESTfulStructureView.as_view', 'views.SDMXRESTfulStructureView.as_view', ({}, {}), '()', False, 'from fiesta.views import views\n'), ((21, 9, 21, 49), 'fiesta.views.views.SDMXRESTfulStructureView.as_view', 'views.SDMXRESTfulStructureView.as_view', ({}, {}), '()', False, 'from fiesta.views import views\n'), ((23, 9, 23, 49), 'fiesta.views.views.SDMXRESTfulStructureView.as_view', 'views.SDMXRESTfulStructureView.as_view', ({}, {}), '()', False, 'from fiesta.views import views\n'), ((26, 9, 26, 49), 'fiesta.views.views.SDMXRESTfulStructureView.as_view', 'views.SDMXRESTfulStructureView.as_view', ({}, {}), '()', False, 'from fiesta.views import views\n')]