mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-18 19:12:54 +00:00
- Add README.md with installation instructions, architecture overview, and API examples for all SDK modules - Add AuthProvider class with API key and JWT token support (generateJWTToken, validateJWTToken, getHeaders, clearTokenCache methods) - Add HTTPClient base class with retry logic, error handling, and timeout management - Add GraphQLAPI, PaymentAPI, RatingPlanAPI, SubscriberAPI, SystemAPI, and UsageAPI modules - Add TelecomSDK main client integrating all API
21 lines
545 B
Swift
21 lines
545 B
Swift
import Foundation
|
|
|
|
/// API for rating plan management
|
|
public class RatingPlanAPI {
|
|
private let client: HTTPClient
|
|
|
|
public init(client: HTTPClient) {
|
|
self.client = client
|
|
}
|
|
|
|
/// List all available rating plans
|
|
public func list() async throws -> [RatingPlan] {
|
|
return try await client.get(path: "/v1/rating-plans")
|
|
}
|
|
|
|
/// Get a rating plan by ID
|
|
public func get(planID: String) async throws -> RatingPlan {
|
|
return try await client.get(path: "/v1/rating-plans/\(planID)")
|
|
}
|
|
}
|