Enhance API structure and documentation: Added new tags for Account, Integration, Automation, Linker, Optimizer, and Publisher; updated billing endpoints for admin and customer; improved API reference documentation; fixed endpoint paths in frontend services.
This commit is contained in:
@@ -8,6 +8,7 @@ from rest_framework.response import Response
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.utils import timezone
|
||||
from drf_spectacular.utils import extend_schema
|
||||
|
||||
from igny8_core.business.automation.models import AutomationConfig, AutomationRun
|
||||
from igny8_core.business.automation.services import AutomationService
|
||||
@@ -30,6 +31,7 @@ class AutomationViewSet(viewsets.ViewSet):
|
||||
site = get_object_or_404(Site, id=site_id, account=request.user.account)
|
||||
return site, None
|
||||
|
||||
@extend_schema(tags=['Automation'])
|
||||
@action(detail=False, methods=['get'])
|
||||
def config(self, request):
|
||||
"""
|
||||
@@ -68,6 +70,7 @@ class AutomationViewSet(viewsets.ViewSet):
|
||||
'next_run_at': config.next_run_at,
|
||||
})
|
||||
|
||||
@extend_schema(tags=['Automation'])
|
||||
@action(detail=False, methods=['put'])
|
||||
def update_config(self, request):
|
||||
"""
|
||||
@@ -142,6 +145,7 @@ class AutomationViewSet(viewsets.ViewSet):
|
||||
'next_run_at': config.next_run_at,
|
||||
})
|
||||
|
||||
@extend_schema(tags=['Automation'])
|
||||
@action(detail=False, methods=['post'])
|
||||
def run_now(self, request):
|
||||
"""
|
||||
@@ -175,6 +179,7 @@ class AutomationViewSet(viewsets.ViewSet):
|
||||
status=status.HTTP_500_INTERNAL_SERVER_ERROR
|
||||
)
|
||||
|
||||
@extend_schema(tags=['Automation'])
|
||||
@action(detail=False, methods=['get'])
|
||||
def current_run(self, request):
|
||||
"""
|
||||
@@ -211,6 +216,7 @@ class AutomationViewSet(viewsets.ViewSet):
|
||||
}
|
||||
})
|
||||
|
||||
@extend_schema(tags=['Automation'])
|
||||
@action(detail=False, methods=['post'])
|
||||
def pause(self, request):
|
||||
"""
|
||||
@@ -234,6 +240,7 @@ class AutomationViewSet(viewsets.ViewSet):
|
||||
status=status.HTTP_404_NOT_FOUND
|
||||
)
|
||||
|
||||
@extend_schema(tags=['Automation'])
|
||||
@action(detail=False, methods=['post'])
|
||||
def resume(self, request):
|
||||
"""
|
||||
@@ -262,6 +269,7 @@ class AutomationViewSet(viewsets.ViewSet):
|
||||
status=status.HTTP_404_NOT_FOUND
|
||||
)
|
||||
|
||||
@extend_schema(tags=['Automation'])
|
||||
@action(detail=False, methods=['get'])
|
||||
def history(self, request):
|
||||
"""
|
||||
@@ -291,6 +299,7 @@ class AutomationViewSet(viewsets.ViewSet):
|
||||
]
|
||||
})
|
||||
|
||||
@extend_schema(tags=['Automation'])
|
||||
@action(detail=False, methods=['get'])
|
||||
def logs(self, request):
|
||||
"""
|
||||
@@ -323,6 +332,7 @@ class AutomationViewSet(viewsets.ViewSet):
|
||||
status=status.HTTP_404_NOT_FOUND
|
||||
)
|
||||
|
||||
@extend_schema(tags=['Automation'])
|
||||
@action(detail=False, methods=['get'])
|
||||
def estimate(self, request):
|
||||
"""
|
||||
@@ -342,6 +352,7 @@ class AutomationViewSet(viewsets.ViewSet):
|
||||
'sufficient': site.account.credits >= (estimated_credits * 1.2)
|
||||
})
|
||||
|
||||
@extend_schema(tags=['Automation'])
|
||||
@action(detail=False, methods=['get'])
|
||||
def pipeline_overview(self, request):
|
||||
"""
|
||||
@@ -504,6 +515,7 @@ class AutomationViewSet(viewsets.ViewSet):
|
||||
]
|
||||
})
|
||||
|
||||
@extend_schema(tags=['Automation'])
|
||||
@action(detail=False, methods=['get'], url_path='current_processing')
|
||||
def current_processing(self, request):
|
||||
"""
|
||||
@@ -547,6 +559,7 @@ class AutomationViewSet(viewsets.ViewSet):
|
||||
status=status.HTTP_500_INTERNAL_SERVER_ERROR
|
||||
)
|
||||
|
||||
@extend_schema(tags=['Automation'])
|
||||
@action(detail=False, methods=['post'], url_path='pause')
|
||||
def pause_automation(self, request):
|
||||
"""
|
||||
@@ -596,6 +609,7 @@ class AutomationViewSet(viewsets.ViewSet):
|
||||
status=status.HTTP_500_INTERNAL_SERVER_ERROR
|
||||
)
|
||||
|
||||
@extend_schema(tags=['Automation'])
|
||||
@action(detail=False, methods=['post'], url_path='resume')
|
||||
def resume_automation(self, request):
|
||||
"""
|
||||
@@ -649,6 +663,7 @@ class AutomationViewSet(viewsets.ViewSet):
|
||||
status=status.HTTP_500_INTERNAL_SERVER_ERROR
|
||||
)
|
||||
|
||||
@extend_schema(tags=['Automation'])
|
||||
@action(detail=False, methods=['post'], url_path='cancel')
|
||||
def cancel_automation(self, request):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user