"""
Tano Shield - AI Security API Client

A client library for interacting with the Tano Shield AI security services.
"""

# Export core components
from tano_shield.core import (
    TanoShieldClient,
    CREDIT_CONSTANTS,
    TanoShieldError,
    AuthenticationError,
    ApiRequestError,
    InsufficientCreditsError,
    ValidationError,
    RateLimitError
)

# Export service clients
from tano_shield.firewall import FirewallClient
from tano_shield.pii import PIIClient

# Main Tano Shield client
class TanoShield:
    """
    Main Tano Shield client that provides access to all services
    """
    
    def __init__(self, api_key=None, base_url=None, timeout=None, version=None):
        """
        Create a new Tano Shield client with all services
        
        Args:
            api_key (str): API key for authentication
            base_url (str, optional): Base URL for API requests
            timeout (int, optional): Request timeout in seconds
            version (str, optional): API version
        """
        self.options = {
            'api_key': api_key,
            'base_url': base_url,
            'timeout': timeout,
            'version': version
        }
        
        # Initialize base client
        self.client = TanoShieldClient(**self.options)
        
        # Initialize service clients
        self.firewall = FirewallClient(**self.options)
        self.pii = PIIClient(**self.options)
        
        # Expose credit constants
        self.CREDIT_CONSTANTS = CREDIT_CONSTANTS
    
    def set_api_key(self, api_key):
        """
        Set the API key for all clients
        
        Args:
            api_key (str): The API key
        """
        self.options['api_key'] = api_key
        self.client.set_api_key(api_key)
        self.firewall.set_api_key(api_key)
        self.pii.set_api_key(api_key)

# Default export
__all__ = [
    'TanoShield',
    'FirewallClient',
    'PIIClient',
    'TanoShieldClient',
    'CREDIT_CONSTANTS',
    'TanoShieldError',
    'AuthenticationError',
    'ApiRequestError',
    'InsufficientCreditsError',
    'ValidationError',
    'RateLimitError'
]