"""
Custom Throttling Classes for Stream Processor API

This module provides specialized throttling classes for different
API endpoints based on their usage patterns and security requirements.
"""

from rest_framework.throttling import UserRateThrottle


class StreamControlThrottle(UserRateThrottle):
    """
    Throttle for stream control operations (start/stop).
    
    More restrictive rate limiting for resource-intensive operations
    that directly control stream capture processes.
    """
    scope = 'stream_control'


class DetectionAPIThrottle(UserRateThrottle):
    """
    Throttle for jingle detection API endpoints.
    
    Moderate rate limiting for detection-related operations
    that involve image processing and analysis.
    """
    scope = 'detection_api'


class NotificationAPIThrottle(UserRateThrottle):
    """
    Throttle for notification API endpoints.
    
    Conservative rate limiting for notification operations
    to prevent spam and abuse.
    """
    scope = 'notification_api'


class BurstRateThrottle(UserRateThrottle):
    """
    Short-term burst protection for high-frequency operations.
    
    Allows for burst activity but prevents sustained abuse.
    """
    scope = 'burst'
    rate = '100/minute'
