"""
ATS SDK - Custom Exceptions
"""


class ATSError(Exception):
    """Base exception for all ATS SDK errors"""
    
    def __init__(self, message: str, request_id: str = None):
        super().__init__(message)
        self.message = message
        self.request_id = request_id


class AuthenticationError(ATSError):
    """Authentication failed (401)"""
    pass


class AuthorizationError(ATSError):
    """Authorization failed (403)"""
    pass


class NotFoundError(ATSError):
    """Resource not found (404)"""
    pass


class ValidationError(ATSError):
    """Request validation failed (400)"""
    
    def __init__(self, message: str, errors: list = None, request_id: str = None):
        super().__init__(message, request_id)
        self.errors = errors or []


class RateLimitError(ATSError):
    """Rate limit exceeded (429)"""
    
    def __init__(self, message: str, retry_after: int = None, request_id: str = None):
        super().__init__(message, request_id)
        self.retry_after = retry_after


class QuotaExceededError(ATSError):
    """Quota exceeded"""
    pass


class ServiceError(ATSError):
    """Server error (5xx)"""
    pass


class NetworkError(ATSError):
    """Network connectivity error"""
    pass
