from django.urls import path, re_path
from . import file_views

urlpatterns = [
    path('', file_views.FileListView.as_view(), name='file-list'),
    path('upload/', file_views.FileUploadView.as_view(), name='file-upload'),
    # /ui/files/{uuid}-{filename}  — filename is cosmetic, lookup is by uuid only
    re_path(
        r'^(?P<pk>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})-(?P<filename>.+)$',
        file_views.FileDownloadView.as_view(),
        name='file-download',
    ),
    path('<uuid:pk>/delete/', file_views.FileDeleteView.as_view(), name='file-delete'),
    path('<uuid:pk>/toggle-public/', file_views.FileTogglePublicView.as_view(), name='file-toggle-public'),
    path('<uuid:pk>/set-expiry/', file_views.FileSetExpiryView.as_view(), name='file-set-expiry'),
]
