mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-20 11:54:25 +00:00
feat: Add Python SDK with async/await support and comprehensive Telecom Platform API integration
- Add TelecomSDK class with async context manager and aiohttp ClientSession with 30s timeout, 3 retries - Add subscriber management: get_subscriber, list_subscribers with pagination/status filter, create_subscriber, update_subscriber, suspend_subscriber, activate_subscriber, terminate_subscriber - Add usage tracking: get_usage_stats with date range, list_usage_events with filtering, get_real_time_usage
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
class TelecomError(Exception):
|
||||
"""Base exception for all Telecom SDK errors."""
|
||||
|
||||
def __init__(self, message: str, status_code: Optional[int] = None, response_data: Optional[dict] = None):
|
||||
super().__init__(message)
|
||||
self.status_code = status_code
|
||||
self.response_data = response_data or {}
|
||||
|
||||
|
||||
class AuthenticationError(TelecomError):
|
||||
pass
|
||||
|
||||
|
||||
class APIError(TelecomError):
|
||||
pass
|
||||
|
||||
|
||||
class NetworkError(TelecomError):
|
||||
pass
|
||||
|
||||
|
||||
class ValidationError(TelecomError):
|
||||
pass
|
||||
|
||||
|
||||
class RateLimitError(TelecomError):
|
||||
pass
|
||||
|
||||
|
||||
class ServerError(TelecomError):
|
||||
pass
|
||||
Reference in New Issue
Block a user